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

GET /v1/stats

GET /v1/stats — aggregations over events.

Aggregate counts or unique-visitor counts over a time range, optionally grouped and/or time-bucketed.

Auth

Required scope

read

Key kinds

rk_*

Request

GET /v1/stats?metric=count&from=…&to=…&event=signup&group_by=source,medium&interval=day
Authorization: Bearer rk_live_…

Query parameters

Name
Required
Notes

metric

no

count (default) or uniques (unique anonymous_ids, HyperLogLog estimate).

from

yes

ISO 8601 timestamp (inclusive).

to

yes

ISO 8601 timestamp (exclusive).

event

no

Filter to one event name.

group_by

no

Comma-separated columns. Allowed: event_name, source, medium, country, device_type, browser, os, path.

interval

no

hour, day, or week. Adds a bucket column to the output.

limit

no

1–1000, default 100.

Response

When interval is set, each row also has a bucket column:

Examples

Daily signups by source

Unique visitors per country, last 7 days

Total page views this month

(Note the \$ to escape the $ in shell. In code, just send "$pageview".)

Errors

  • 400 invalid_group_by — column not in the allow-list. Response includes the allowed columns.

  • 400 invalid_paramsfrom/to missing or metric not one of count/uniques.

Last updated

Was this helpful?