Get Views Over Time
Daily page views and unique visitors, plus 6-hour buckets for windows up to 14 days.
Returns page views and unique visitors per UTC day for the window, and — for windows of up to 14 days — the same traffic in 6-hour buckets for a finer chart. This is the series behind Insights › Traffic.
Session JWT and org membership required. Any role can read it — an API key gets 401, a non-member 403. Any plan.
Path Parameters
projectIdQuery Parameters
days400 validation_error.30Response — 200 OK
The example shows only the last day's buckets; a real days=7 response has 28.
datadate (YYYY-MM-DD), views and visitors (distinct visitors that day). visitors may arrive as a numeric string — convert it with Number().buckets6-hour buckets covering the days whole UTC days ending today, oldest first — always exactly days × 4 entries. Buckets start at 00:00, 06:00, 12:00 and 18:00 UTC. Empty buckets, including today's that haven't started yet, are returned as zeros.
Each bucket has date (the UTC day of bucketStart), bucketStart (ISO 8601), views and visitors. A bucket's visitors counts distinct visitors in that bucket, so bucket values don't add up to a day's visitors.
null when days is over 14 — chart those windows per day from data — and also when the buckets can't be computed; data is still returned then.
To compare a week with the week before at 6-hour resolution, ask for days=14 and split the 56 buckets in half.
Error Responses
| Status | error.code | When |
|---|---|---|
| 400 | validation_error | days is not an integer from 1 to 365. details.target is query |
| 401 | unauthorized | No session JWT, an invalid or expired one, or an API key |
| 403 | forbidden | You are not a member of the project's workspace |
| 404 | not_found | The project does not exist |