Prerequisites
- A Scrunch API key with Responses access (provision one here)
- A brand ID for the brand you want to load
- A cloud data warehouse (BigQuery, Snowflake, Redshift, Databricks, etc.)
How the Responses API works
The Responses API returns one record per AI response. Each record includes the full response text, citations, brand and competitor evaluations, and prompt metadata. Key characteristics:- 1:1 response model — each item represents a single, distinct AI response
- Denormalized — arrays like
tags,competitors, andcitationsare embedded in each record - Reverse chronological — newest responses are returned first
- Supports date filtering and pagination — ideal for incremental ETL
Incremental loading strategy
Use date windows and pagination to pull new responses on a recurring schedule.Choose your sync window
Use
start_date and end_date (both YYYY-MM-DD, UTC) to define a date range. For daily loads, pull the previous UTC day after midnight to ensure completeness.Paginate through all results
The API returns paginated results. Increment The response includes a
offset by limit until you have all records for the window.total count so you know when you’re done:Some fields like
brand_present, brand_sentiment, tags, and stage may be re-evaluated if prompt metadata or brand configuration changes in Scrunch. Always upsert rather than append-only.Schema design
Each API record includes arrays (tags, competitors, citations) that should be normalized into separate tables to avoid row explosion.
Responses fact table
Store one row per response with scalar fields:| Column | Type | Notes |
|---|---|---|
id | STRING | Primary key (globally unique) |
created_at | TIMESTAMP | When the response was captured |
prompt_id | STRING | Foreign key to the prompt |
prompt | STRING | Text of the prompt |
platform | STRING | ChatGPT, Perplexity, Claude, etc. |
persona_id | STRING | |
persona_name | STRING | |
stage | STRING | Funnel stage enum |
branded | BOOLEAN | Whether the prompt includes brand names |
brand_present | BOOLEAN | |
brand_sentiment | STRING | positive, mixed, negative, or null |
brand_position | STRING | top, middle, bottom, or null |
country | STRING | |
response_text | STRING | Full AI-generated answer (markdown) |
Bridge tables
Unnest each array into its own table, keyed byresponse_id.
response_tags
| Column | Type |
|---|---|
response_id | STRING |
tag | STRING |
| Column | Type |
|---|---|
response_id | STRING |
competitor_name | STRING |
present | BOOLEAN |
sentiment | STRING |
position | STRING |
| Column | Type |
|---|---|
response_id | STRING |
url | STRING |
title | STRING |
snippet | STRING |
source_type | STRING |
Computing metrics
Once your data mart is loaded, you can aggregate responses into daily performance summaries. Group onDATE(created_at), prompt_id, prompt, platform to match the way Scrunch reports prompt-level performance by default.
The following examples use PostgreSQL syntax. Translate as needed for your warehouse.