/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Get Views Over Time

Get Views Over Time

Daily page views and unique visitors, plus 6-hour buckets for windows up to 14 days.

GET/v1/projects/{projectId}/analytics/views-over-timeTry it
Session token

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.

Note

Session JWT and org membership required. Any role can read it — an API key gets 401, a non-member 403. Any plan.

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID.

Query Parameters

NameDescription
days:integerquery
Window in whole UTC days ending today, 1–365. Any other value returns 400 validation_error.
Default30

Response — 200 OK

The example shows only the last day's buckets; a real days=7 response has 28.

NameDescription
data:array
One entry per UTC day that had traffic, oldest first: date (YYYY-MM-DD), views and visitors (distinct visitors that day). visitors may arrive as a numeric string — convert it with Number().
buckets:array | null

6-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

Statuserror.codeWhen
400validation_errordays is not an integer from 1 to 365. details.target is query
401unauthorizedNo session JWT, an invalid or expired one, or an API key
403forbiddenYou are not a member of the project's workspace
404not_foundThe project does not exist
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl "https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/analytics/views-over-time?days=7" \
-H "Authorization: Bearer $SYNTEXT_JWT"
Responseapplication/json
200OK
{
"data": [
{ "date": "2026-11-07", "views": 412, "visitors": 188 },
{ "date": "2026-11-08", "views": 97, "visitors": 61 }
],
"buckets": [
{ "date": "2026-11-08", "bucketStart": "2026-11-08T00:00:00.000Z", "views": 31, "visitors": 22 },
{ "date": "2026-11-08", "bucketStart": "2026-11-08T06:00:00.000Z", "views": 66, "visitors": 41 },
{ "date": "2026-11-08", "bucketStart": "2026-11-08T12:00:00.000Z", "views": 0, "visitors": 0 },
{ "date": "2026-11-08", "bucketStart": "2026-11-08T18:00:00.000Z", "views": 0, "visitors": 0 }
]
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext