Skip to content

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

  • startTime and endTime are required and are YYYY-MM-DD days, not timestamps. The range is inclusive
  • Results are served from a query cache. status tells you whether the numbers are ready, and lastUpdate when they were computed
  • Pass forceRefresh=true to recompute instead of reading the cache. It is slow, so use it only when you know the cache is stale
x-api-key
required
string

Your API key from account settings.

x-user-email
required
string

The email address of your user.

x-account-id
required
string

The ID of your account. You can find this in the account settings.

x-website-id
required
string

The ID of the workspace you want to use.

startTime
required
string format: date

First day of the range, inclusive, as YYYY-MM-DD.

endTime
required
string format: date

Last day of the range, inclusive, as YYYY-MM-DD.

forceRefresh
boolean

Recompute instead of reading the query cache. Slow - only worth it when you know the cache is stale.

Pageview totals for the range.

Pageview counts split by new versus returning visitors. day is set only in the per-day variant.

object
status

Whether the cached numbers are ready.

string
lastUpdate

Unix timestamp (ms) when the numbers were computed.

number
day
string
new
object
pageviewsPersonalized
number
pageviewsNotPersonalized
number
isReturning
object
pageviewsPersonalized
number
pageviewsNotPersonalized
number
Example
{
"status": "ready",
"lastUpdate": 1757462400000,
"new": {
"pageviewsPersonalized": 4210,
"pageviewsNotPersonalized": 18734
},
"isReturning": {
"pageviewsPersonalized": 1980,
"pageviewsNotPersonalized": 6402
}
}

Unauthorized - invalid API key.

StartTime or endTime was missing.