Compare brand visibility by location
Use a store-level breakdown when a client asks where the brand appears in AI answers. Keep the time window and source filters fixed so the stores have a common basis for comparison.
Before you start
Use an Analyzer or Optimizer key with analytics:read in AEO_API_KEY. Set BRAND_ID to a brand with answers collected for its registered locations.
1. Pick a reporting window
Set START_AT and END_AT to UTC date-times. The start is inclusive and the end is exclusive. For October 2026, use 2026-10-01T00:00:00Z and 2026-11-01T00:00:00Z.
curl --fail-with-body --get 'https://api.aeoapi.dev/v2/analytics/locations' \
-H "Authorization: Bearer $AEO_API_KEY" \
--data-urlencode "brand_id=$BRAND_ID" \
--data-urlencode "start_at=$START_AT" \
--data-urlencode "end_at=$END_AT" \
--data-urlencode 'group_by=location'Each location row in data includes its location_id. Show valid_answers beside mention_rate. A rate based on two answers carries less evidence than a rate based on fifty. If meta.next_cursor has a value, send it as cursor with the same filters to read the remaining rows.
2. Compare cities across the same window
curl --fail-with-body --get 'https://api.aeoapi.dev/v2/analytics/locations' \
-H "Authorization: Bearer $AEO_API_KEY" \
--data-urlencode "brand_id=$BRAND_ID" \
--data-urlencode "start_at=$START_AT" \
--data-urlencode "end_at=$END_AT" \
--data-urlencode 'group_by=city'Use the returned city, region and country together when labeling a row. Grouped results use answers with a location ID. The API calculates the city rate from its answers, so averaging individual store rates can give a different result.
3. Report what the sample supports
Inspect average_rank only when the API returns a rank. Keep a null value distinct from zero. A city with few answers may need more location-targeted collections before you can explain a difference. Include the dates and sample counts in the monthly client report.