Query events
Count events or unique visitors in a time range. Optionally filter by event name or properties, group by one property, and split results into hour, day, or week buckets that start on the clock of an IANA time zone, UTC by default. Each bucket is returned as the UTC instant at which it starts. The range includes from and excludes to. Duplicate event IDs are counted once. An unknown time zone returns 400.
Authorizations
Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Path Parameters
ID of the analytics project.
1 - 128^[^\u0000]*$Body
count counts events. unique_visitors counts distinct values of distinct_id. Both deduplicate event IDs first.
count, unique_visitors Start of the time range, inclusive. Use an ISO 8601 timestamp with Z for UTC or an offset such as -07:00. Must be before to.
"2026-09-01T00:00:00Z"
End of the time range, exclusive. Use an ISO 8601 timestamp with Z for UTC or an offset such as -07:00. Must be after from.
"2026-09-02T00:00:00Z"
Only include events with this exact name. Omit to include all event names.
1 - 255"page_view"
Split results into time buckets. Hours, days, and Monday-start weeks begin on the clock of timezone, which defaults to UTC. Empty buckets are omitted.
hour, day, week IANA time zone name that sets where buckets start. Defaults to UTC. A day is a local calendar day and lasts 23 or 25 hours when the clocks change. In zones offset by 30 or 45 minutes, hours start on the local clock. UTC offsets such as +05:30 are rejected, as are identifiers outside the IANA database such as PST or BST, and names the service's time zone database does not know, which can lag the newest IANA zones; fall back to UTC when the 400 names timezone. Only bucket boundaries change: from, to, filters, and the UTC format of each row's bucket stay the same. Has no effect without bucket.
1 - 64"America/Los_Angeles"
"Asia/Kolkata"
"UTC"
Group results by one event property. Missing values and null share a group.
1 - 128^[^\u0000]*$"pathname"
Property filters combined with AND. An event must match every filter.
10Maximum number of result rows, including rows created by time buckets and property groups.
1 <= x <= 1000