Documentation Index
Fetch the complete documentation index at: https://developers.scrunch.com/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A Scrunch workspace
- An API key with Query access
- A brand ID for the brand you want to query
Call the API
cURL
Python
JavaScript / TypeScript
Set your API key
Get your API key from Organization Settings → API Keys and set it as environment variables:export SCRUNCH_API_KEY="your-api-key-here"
export SCRUNCH_BRAND_ID="your-brand-id"
Make your first Query API request
This example retrieves weekly brand presence for the last 30 days.curl "https://api.scrunchai.com/v1/$SCRUNCH_BRAND_ID/query?fields=date_week,brand_presence_percentage&start_date=2025-01-01&end_date=2025-01-31" \
-H "Authorization: Bearer $SCRUNCH_API_KEY" \
-H "Accept: application/json"
Example output:{
"total": 4,
"limit": 1000,
"offset": 0,
"rows": [
{
"date_week": "2025-01-06",
"brand_presence_percentage": 42.1
},
{
"date_week": "2025-01-13",
"brand_presence_percentage": 47.8
}
]
}
Install dependencies
pip install requests pandas
Create your script
import requests
import pandas as pd
API_KEY = "your-api-key"
BRAND_ID = "your-brand-id"
BASE_URL = f"https://api.scrunchai.com/v1/{BRAND_ID}/query"
params = {
"fields": "date_week,brand_presence_percentage",
"start_date": "2025-01-01",
"end_date": "2025-01-31",
}
response = requests.get(
BASE_URL,
headers={"Authorization": f"Bearer {API_KEY}"},
params=params,
timeout=30,
)
response.raise_for_status()
data = response.json()
df = pd.DataFrame(data)
print(df)
Create your code
import axios from "axios";
const API_KEY = "your-api-key";
const BRAND_ID = "your-brand-id";
async function main() {
const url = `https://api.scrunchai.com/v1/${BRAND_ID}/query`;
const response = await axios.get(url, {
headers: { Authorization: `Bearer ${API_KEY}` },
params: {
fields: "date_week,brand_presence_percentage",
start_date: "2025-01-01",
end_date: "2025-01-31",
},
});
console.log(response.data.rows);
}
main().catch(console.error);
Next steps
Query API overview
Learn how fields, dimensions, and metrics work together.
Build dashboards
Send Query data into Looker Studio or your BI tool.
Responses API
Get full answers, citations, and sentiment when you need row-level detail.