For the complete documentation index, see llms.txt. This page is also available as Markdown.

Analytics

Get Analytic

post

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

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
brand_kit_idintegerRequired

The Brand Kit ID

Body
brand_kit_idintegerRequired

The Brand Kit ID to query analytics for

grainstring · enumOptional

Time granularity for aggregation. Default: total

Possible values:
start_datestringOptional

Start date (YYYY-MM-DD). Default: 7 days ago

end_datestringOptional

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.

topicsinteger[]Optional

Filter by topic IDs

tagsany ofOptional

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.

integer[]Optional
or
personasinteger[]Optional

Filter by persona IDs

themesinteger[]Optional

Filter sentiment data by theme IDs. Only applies to sentiment_score metric.

brand_mentionedstring · enumOptional

Filter by prompt type. Options: category (generic prompts - recommended for accurate visibility metrics), brand (prompts mentioning the brand). Defaults to category if not specified

Possible values:
limitintegerOptional

Maximum rows to return (1-5000). Default: 100

offsetintegerOptional

Number of records to skip for pagination. Default: 0. Use with limit to page through large result sets.

order_bystringOptional

Custom sort order (e.g., "citation_count DESC")

Responses
200

Successful response

application/json
dataobject[]Optional

Query results with requested dimensions and metrics

errorstringOptional

Error message if query failed

chart_image_urlstring · nullableOptional

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.

post/public_api/brand_kits/{brand_kit_id}/analytics
POST /public_api/brand_kits/{brand_kit_id}/analytics HTTP/1.1
Host: api.airops.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 282

{
  "brand_kit_id": 1,
  "metrics": [
    "mention_rate"
  ],
  "dimensions": [
    "date"
  ],
  "grain": "daily",
  "start_date": "text",
  "end_date": "text",
  "providers": [
    "chat_gpt"
  ],
  "topics": [
    1
  ],
  "tags": [
    1
  ],
  "countries": [
    "AE"
  ],
  "personas": [
    1
  ],
  "themes": [
    1
  ],
  "brand_mentioned": "brand",
  "limit": 1,
  "offset": 1,
  "order_by": "text"
}
{
  "data": [
    {}
  ],
  "meta": {
    "row_count": 1,
    "total_count": 1,
    "execution_time_ms": 1,
    "start_date": "text",
    "end_date": "text",
    "data_availability": {
      "earliest_data_date": "text",
      "latest_data_date": "text",
      "requested_period_has_data": true
    }
  },
  "error": "text",
  "query": {
    "metrics": [
      "text"
    ],
    "dimensions": [
      "text"
    ],
    "filters": {},
    "grain": "text",
    "limit": 1,
    "offset": 1
  },
  "chart_image_url": "text"
}

Last updated

Was this helpful?