Skip to main content

GET /api/stats

Returns aggregate statistics for all $pageview events matching the given domain and optional date range.
Only $pageview events are counted. Custom events and autocaptured $click events do not contribute to these numbers.

Query parameters

domain
string
required
The domain to query (e.g. example.com). Must match the d field sent in event payloads exactly.
from
string
Start of the date range, inclusive. ISO 8601 date string (YYYY-MM-DD). If omitted, results cover all time up to to.
to
string
End of the date range, inclusive. ISO 8601 date string (YYYY-MM-DD). If omitted, results cover all time from from.

Response

Returns a single JSON object.
pageviews
number
Total number of $pageview events in the window.
unique_visitors
number
Count of distinct visitor_id values across those pageviews.
sessions
number
Count of distinct session_id values across those pageviews.
Response shape
{
  "pageviews": 14823,
  "unique_visitors": 4201,
  "sessions": 6034
}
StatusMeaning
200 OKQuery succeeded
400 Bad Requestdomain query parameter is missing
500 Internal Server ErrorDatabase query failed

Examples

curl "https://your-iris-host/api/stats?domain=example.com&from=2025-01-01&to=2025-01-31"

Build docs developers (and LLMs) love