Rest API
Get pageview totals
GET /api/v1/insights/pageviews
Pageview totals for a date range, split by whether the visitor was new or returning and whether the pageview was personalized.
Notes
startTimeandendTimeare required and areYYYY-MM-DDdays, not timestamps. The range is inclusive- Results are served from a query cache.
statustells you whether the numbers are ready, andlastUpdatewhen they were computed - Pass
forceRefresh=trueto recompute instead of reading the cache. It is slow, so use it only when you know the cache is stale
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Your API key from account settings.
The email address of your user.
The ID of your account. You can find this in the account settings.
The ID of the workspace you want to use.
Query Parameters
Section titled “Query Parameters ”First day of the range, inclusive, as YYYY-MM-DD.
Last day of the range, inclusive, as YYYY-MM-DD.
Recompute instead of reading the query cache. Slow - only worth it when you know the cache is stale.
Responses
Section titled “ Responses ”Pageview totals for the range.
Pageview counts split by new versus returning visitors. day is set only in the per-day variant.
object
Whether the cached numbers are ready.
Unix timestamp (ms) when the numbers were computed.
object
object
Example
{ "status": "ready", "lastUpdate": 1757462400000, "new": { "pageviewsPersonalized": 4210, "pageviewsNotPersonalized": 18734 }, "isReturning": { "pageviewsPersonalized": 1980, "pageviewsNotPersonalized": 6402 }}Unauthorized - invalid API key.
StartTime or endTime was missing.