Skip to main content

GET /api/timeseries

Returns daily pageview counts grouped by calendar day (UTC) for the given domain and optional date range. Only $pageview events are counted. Results are ordered chronologically ascending, making this endpoint ideal for rendering line charts.
Days with zero pageviews are not included in the response — the array contains only days that have at least one event. If you are rendering a chart over a fixed date window, you will need to fill in the missing dates with zero values on the client.

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 JSON array of daily buckets, ordered by date ascending.
date
string
Calendar date in YYYY-MM-DD format (UTC). Computed via strftime('%Y-%m-%d', timestamp) in SQLite.
pageviews
number
Number of $pageview events recorded on that date.
Response shape
[
  { "date": "2025-01-01", "pageviews": 482  },
  { "date": "2025-01-02", "pageviews": 631  },
  { "date": "2025-01-03", "pageviews": 519  },
  { "date": "2025-01-04", "pageviews": 124  }
]
StatusMeaning
200 OKQuery succeeded (empty array if no data)
400 Bad Requestdomain query parameter is missing
500 Internal Server ErrorDatabase query failed

Examples

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

Build docs developers (and LLMs) love