Analytics
Send events
Send events from the application with the search key, or from a browser with a scoped key. Tie a click or conversion to the search that produced it with the query_id from the search reply.
Send user_token on each search, the same value as the events’ userToken. A search with a user token is a tracked search: the click-through and conversion rates count only tracked searches, and Count Users counts distinct user tokens. A search without one still counts as a search. On the Algolia-compatible routes, userToken or the X-Algolia-UserToken header does the same.
curl
Python
TypeScript
Up to 1,000 events per request. A click tied to a search carries one position per record id, starting at 1.
Read analytics
curl
Python
TypeScript
Before an index’s first build, analytics return 200 with empty reports, since the index hasn’t served any searches yet.
Query logs can hold sensitive text. On an index with per-record access control, Captain provides analytics until a dedicated analytics key is available.
Analytics by metric
Each metric also has its own endpoint, for dashboards that chart one number over time. They take start_date and end_date (UTC, inclusive, YYYY-MM-DD, the last 7 days by default). For an exact window, send start_time and end_time instead, as unix seconds or ISO 8601 in UTC (2026-10-10T10:00:00Z). end_time is exclusive. The list endpoints also take limit and offset. Every analytics answer carries partial. Analytics requests usually answer within 6 seconds and within about 7.5 seconds at most, even when several dashboards ask at once. A window too large to read whole in that time (more than 500,000 searches, or more than about 3.5 seconds of reading) answers with what was counted, partial: true, partial_reason (row_budget or time_budget) and counted_through, the time of the last record counted. Ask for fewer days to get whole numbers. The same report asked again within a minute, with no new searches since, answers at once.
Rates come with a daily series, so one call fills a chart.
For example, the top searches of the last week: