> For the complete documentation index, see [llms.txt](https://docs.airops.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.airops.com/api-reference/api-reference/brand-kits/analytics.md).

# Analytics

## Get Analytic

> Query analytics data for a Brand Kit with flexible metrics, dimensions, and filters.

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Analytics"}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/public_api/brand_kits/{brand_kit_id}/analytics":{"post":{"summary":"Get Analytic","description":"Query analytics data for a Brand Kit with flexible metrics, dimensions, and filters.","tags":["Analytics"],"operationId":"getBrandKitsAnalytic","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Query results with requested dimensions and metrics","items":{"type":"object"}},"meta":{"type":"object","properties":{"row_count":{"type":"integer","description":"Number of rows returned in this response"},"total_count":{"type":"integer","description":"Total number of rows available across all pages (ignores limit/offset)"},"execution_time_ms":{"type":"integer","description":"Query execution time in milliseconds"},"start_date":{"type":"string","description":"Actual start date used for the query (YYYY-MM-DD), including defaults"},"end_date":{"type":"string","description":"Actual end date used for the query (YYYY-MM-DD), including defaults"},"data_availability":{"type":"object","description":"Information about data availability for the brand kit","properties":{"earliest_data_date":{"nullable":true,"type":"string","description":"Date of the first completed analysis (ISO 8601). Null if none exist."},"latest_data_date":{"nullable":true,"type":"string","description":"Date of the most recent completed analysis (ISO 8601). Null if none exist."},"requested_period_has_data":{"type":"boolean","description":"Whether any completed analyses exist within the requested date range"}}}}},"error":{"type":"string","description":"Error message if query failed"},"query":{"type":"object","description":"Summary of the query parameters used","properties":{"metrics":{"type":"array","items":{"type":"string"}},"dimensions":{"type":"array","items":{"type":"string"}},"filters":{"type":"object"},"grain":{"type":"string"},"limit":{"type":"integer"},"offset":{"type":"integer"}}},"chart_image_url":{"nullable":true,"type":"string","description":"QuickChart.io URL for visualizing the data. Useful for displaying charts or embedding in Notion/Google docs, etc. DO NOT DISPLAY THIS IMAGE DIRECTLY TO THE USER. Null when no data is available to visualize."}}}}}},"400":{"description":"Bad request - invalid parameters, filters, or sort options"},"401":{"description":"Unauthorized - invalid or missing authentication token"},"404":{"description":"Not found - resource does not exist"},"412":{"description":"Precondition failed - AEO not configured for this brand kit"}},"parameters":[{"name":"brand_kit_id","in":"path","required":true,"schema":{"type":"integer"},"description":"The Brand Kit ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"brand_kit_id":{"type":"integer","description":"The Brand Kit ID to query analytics for"},"metrics":{"type":"array","items":{"type":"string","enum":["mention_rate","share_of_voice","citation_rate","citation_share","citation_count","sentiment_score","average_position","answer_count","first_mention_rate"]},"description":"Metrics to calculate. Options: mention_rate (brand mention frequency, 0-100), share_of_voice (percentage of total mentions, 0-100), citation_rate (citation frequency, 0-100), citation_share (relative citation volume, 0-100), citation_count (total citations), sentiment_score (0-100, negative to positive; null when unavailable), average_position (ranking placement), answer_count (total responses), first_mention_rate (first position frequency, 0-100)"},"dimensions":{"type":"array","items":{"type":"string","enum":["date","provider","topic","country","persona","domain","competitor","domain_category","theme"]},"description":"Dimensions to group by (max 3)."},"grain":{"type":"string","enum":["daily","weekly","monthly","total"],"description":"Time granularity for aggregation. Default: total"},"start_date":{"type":"string","description":"Start date (YYYY-MM-DD). Default: 7 days ago"},"end_date":{"type":"string","description":"End date (YYYY-MM-DD). Defaults to yesterday. Must be before today because today's data may still be processing and is incomplete — yesterday is used to ensure robust, complete data. Leave blank unless a specific date is requested."},"providers":{"type":"array","items":{"type":"string","enum":["chat_gpt","gemini","perplexity","google_ai_mode","google_ai_overview","claude","grok","microsoft_copilot"]},"description":"Filter by AI providers"},"topics":{"type":"array","items":{"type":"integer"},"description":"Filter by topic IDs"},"tags":{"description":"Filter by tags. A bare array of tag IDs matches ANY (IN). An object {\"operator\":\"IN\"|\"HAS_ALL\"|\"NOT_IN\",\"value\":[ids]} selects the operator; HAS_ALL matches only items tagged with every listed tag; NOT_IN matches only items tagged with none of the listed tags.","anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"object","properties":{"operator":{"type":"string","enum":["IN","HAS_ALL","NOT_IN"]},"value":{"type":"array","items":{"type":"integer"}}},"required":["operator","value"]}]},"countries":{"type":"array","items":{"type":"string","enum":["AE","AR","AT","AU","BE","BR","CA","CH","CL","CN","CO","CZ","DE","DK","ES","FI","FR","GB","GR","HR","HU","ID","IE","IL","IN","IS","IT","JP","KR","MX","MY","NL","NO","NZ","PE","PH","PL","PT","SE","SG","TH","TR","US","VN"]},"description":"Filter by country codes (ISO 3166-1 alpha-2)"},"personas":{"type":"array","items":{"type":"integer"},"description":"Filter by persona IDs"},"themes":{"type":"array","items":{"type":"integer"},"description":"Filter sentiment data by theme IDs. Only applies to sentiment_score metric."},"brand_mentioned":{"type":"string","enum":["brand","category"],"description":"Filter by prompt type. Options: category (generic prompts - recommended for accurate visibility metrics), brand (prompts mentioning the brand). Defaults to category if not specified"},"limit":{"type":"integer","description":"Maximum rows to return (1-5000). Default: 100"},"offset":{"type":"integer","description":"Number of records to skip for pagination. Default: 0. Use with limit to page through large result sets."},"order_by":{"type":"string","description":"Custom sort order (e.g., \"citation_count DESC\")"}},"required":["brand_kit_id","metrics"],"type":"object"}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.airops.com/api-reference/api-reference/brand-kits/analytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
