Filters
Maps to:
filters
Filters narrow the respondents included in a query — for example, to a
demographic segment or an audience defined by their answers. Each query carries
a filters list; send an empty list ([]) for no filtering.
How filters combine
- Filters in the list are combined with AND — a respondent must satisfy all of them.
- Multiple values within a single filter are combined with OR — the respondent must match any of that filter's values.
So [age: 18–24 OR 25–34] AND [region: London] means "18–34 year-olds who
live in London".
Operators
Value-based filters accept an op: ==, in, >, >=, <, <=. If
omitted, == is assumed.
Filter types
Look up the available values for each type via the filters catalogue.
Demographic filter
A standard demographic variable and one or more numeric value codes:
{ "name": "gender", "op": "==", "values": [1] }
Profiles filter
A Profiles data-series variable. definition_name is
<dataseries>__<definition>, e.g. profiles_us__age:
{ "definition_name": "profiles_us__age", "op": "in", "values": ["18-24", "25-34"] }
Metric filter
Restrict to respondents who gave a particular answer on a metric, optionally for
a specific brand_id:
{ "metric": "consider", "op": "==", "values": [1], "brand_id": 1007 }
Composite filter
A saved, reusable filter referenced by its identifier, together with the specific response options to include:
{ "uuid": "8ab3…", "responses": ["1f0e…", "2a7c…"] }
Raw expression filter (advanced)
A free-text expression. Powerful but easy to get wrong — prefer the structured types above unless you have a specific need.
{ "expression": "bixdemo_age2 > 1" }
Coming from the BrandIndex UI?
The UI calls filters "audiences". They map to the API filter types like this:
| UI audience | API filter type |
|---|---|
| Core (basic demographics: age, region, gender, income) | Demographic filter |
| Category (variables specific to the chosen category) | Demographic filter |
| Metric (respondents by how they answered a metric) | Metric filter |
| Composite (saved, reusable audiences) | Composite filter |
| Profiles (YouGov Profiles variables) | Profiles filter |
The UI joins all selected audience variables with AND; to combine variables with OR the UI uses its Filter Builder to produce a composite filter — the same AND-across / OR-within behaviour described above.
Interaction with the scoring population
Filters and the scoring population both affect who is counted, but they are distinct: filters restrict which respondents enter the query at all, while the scoring population decides who forms the base of the score within that filtered group.