Skip to main content

Overview

The structured query endpoint accepts a JSON request body describing the dimensions, metrics, filters, and comparisons you want, and returns a columnar result. Use it when you need richer query shapes than the GET query endpoint supports — for example, post-aggregation thresholds, negated filters, or period-over-period comparison in a single round trip.
The structured endpoint and the GET endpoint share the same dimensions, metrics, and brand scoping. They differ in expressivity and request shape: the structured endpoint takes a JSON body and adds having, negate, and comparison.

When to use

Use the structured endpoint when you need to:
  • Filter on metric thresholds after aggregation (for example, only weeks with at least 10 responses).
  • Exclude a set of values rather than include them (negate: true).
  • Pull a current-period result and a prior-period result in one request, aligned for charting.
  • Submit complex filter combinations that are awkward to encode in URL parameters.
For straightforward dimension-and-metric pulls, the GET query endpoint remains the simpler choice.

Authentication

Authenticate with a Bearer API key. The key must include the Query scope and have access to the target brand. See Provision an API Key.

Request body

DimensionFilter

HavingFilter

Comparison

When comparison is set, start_date and end_date are required and the response includes a synthetic period dimension with values current and prior. Each period is capped at limit / 2 rows so the merged result stays within limit. Prior-period dates are aligned to current-period bucket labels so the two series overlay on a chart.

Response

The response is columnar.
Date dimensions are formatted as labels: dateYYYY-MM-DD, date_week → ISO YYYY-Www (uses ISO week-numbering year, so dates near the year boundary group with their ISO week — for example, 2024-12-30 is 2025-W01), date_monthYYYY-MM, date_quarterYYYY-Q#, date_yearYYYY.

Examples

Multi-metric weekly trend with a platform filter

Threshold the result with HAVING

Return only weeks that received at least 10 responses.

Period-over-period comparison

The response prepends a period column. Prior dates are mapped to current-period labels so the series can be plotted on a single x-axis.

Exclude specific prompts


Limits

Requests that exceed these limits are rejected with HTTP 422.

Errors


Query API overview

Field reference shared with the GET endpoint.

Query API quickstart

First request walkthrough.