Skip to main content
In v1, the audience, location and timeframe were written into one prompt. In v2 you resolve each part with its own endpoint first, and pass the resulting codes and IDs to Step 3:
Create an audience once and reuse its ID. Every later POST /insights/generate call for the same audience takes the same enforced_audiences value, so results stay consistent and you avoid extra calls.

Choose datasets (optional)

Skip this section to use the default datasets for your account. To scope the analysis to specific datasets, list the datasets available to you and keep their code values. All codes you pass in one request must come from the same tree. See Working with Multiple Data Sets.
Request
Response
The list is empty if your account has no dataset access. If you choose datasets, pass the same dataset_codes array on every later request in the chain.

Resolve location and timeframe

Send only the locations and timeframes in prompt. Keep location_codes and wave_codes from the response for the next steps. The response may return default codes even when you did not name a location or timeframe; pass those on as well.
Request
Response
global_filters.inaccessible_location_names lists any requested locations your account cannot access. To change the scope later, see Step 4.

Define the audience

Create an audience

Describe the audience in plain language and pass the codes from the previous section. You can create up to 10 audiences in one request.
Request
Response
Store audiences[].id. Check name and description to confirm the audience matches what you asked for. A description that could not be created or matched is listed in failed_audiences with the reason, and the other audiences are still returned:
audiences[].datasets shows where the audience is stored. Do not copy it into dataset_codes.

Or use a saved audience

To use an audience saved on the GWI platform, search for it by name and keep the id of the matching result.
Request
Response
Optional fields: exclude_audience_ids leaves audiences out of the results, and limit sets the maximum number of results (1–100).

Combine audiences (optional)

To analyze people who belong to two or more audiences, or to any of them, join their IDs into one audience. Pass two or more IDs from POST /audiences/generate or POST /audiences/search in audiences, and set join_type: name is optional. A name is generated when you omit it.
Request
Response
Pass the returned id in enforced_audiences in Step 3. Audiences that cannot be combined, for example because they share no dataset, location or wave, return unprocessable.