Website statistics

Operations around Website statistics.

Endpoints

GET /api/websites/:websiteId/active
GET /api/websites/:websiteId/daterange
GET /api/websites/:websiteId/events/series
GET /api/websites/:websiteId/metrics
GET /api/websites/:websiteId/metrics/expanded
GET /api/websites/:websiteId/pageviews
GET /api/websites/:websiteId/stats

Filters

All Endpoints marked with filters can now be filtered with the parameters below.

ParameterTypeDescription
pathstringName of URL.
referrerstringName of referrer.
titlestringName of page title.
querystringName of query parameter.
browserstringName of browser.
osstringName of operating system.
devicestringName of device (ex. Mobile).
countrystringName of country.
regionstringName of region/state/province.
citystringName of city.
languagestringName of browser language.
hostnamestringName of hostname.
tagstringName of tag.
eventstringName of event.
distinctIdstringName of distinct ID.
utmSourcestringUTM source.
utmMediumstringUTM medium.
utmCampaignstringUTM campaign name.
utmContentstringUTM content.
utmTermstringUTM term.
segmentuuidUUID of segment.
cohortuuidUUID of cohort.

Unit Parameter

The unit parameter buckets the data returned. The unit is automatically converted to the next largest applicable time unit if the maximum is exceeded.

UnitMaximum
minuteUp to 60 minutes.
hourUp to 30 days.
dayUp to 6 months.
monthNo limit.
yearNo limit.

GET /api/websites/:websiteId/active

Gets the number of active users on a website.

Sample response

{
  "visitors": 5
}
  • visitors: Number of unique visitors within the last 5 minutes

GET /api/websites/:websiteId/daterange

Gets the date range of available data for a website.

Sample response

{
    "startDate": "2025-12-06T00:00:00Z",
    "endDate": "2026-03-11T21:00:00Z"
}

GET /api/websites/:websiteId/events/series

Gets events within a given time range.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
unitstringTime unit (year | month | hour | day).
timezonestringTimezone (ex. America/Los_Angeles).
filtersobjectCan accept filter parameters.

Sample response

[
  {
    "x": "live-demo-button",
    "t": "2023-04-12T22:00:00Z",
    "y": 1
  },
  {
    "x": "get-started-button",
    "t": "2023-04-12T22:00:00Z",
    "y": 5
  },
  {
    "x": "get-started-button",
    "t": "2023-04-12T23:00:00Z",
    "y": 4
  },
  {
    "x": "live-demo-button",
    "t": "2023-04-12T23:00:00Z",
    "y": 4
  },
  {
    "x": "social-Discord",
    "t": "2023-04-13T00:00:00Z",
    "y": 1
  }
]
FieldDescription
xEvent name.
tTimestamp.
yNumber of events.

GET /api/websites/:websiteId/metrics

Gets metrics for a given time range.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
typestringMetrics type.
filtersobjectCan accept filter parameters.
limitnumber(optional, default 500) Number of rows returned.
offsetnumber(optional, default 0) Number of rows to skip.

Available Types

path | entry | exit | title | query | referrer | channel | domain | country | region | city | browser | os | device | language | screen | event | hostname | tag | distinctId

Sample response

[
  {
    "x": "Mac OS",
    "y": 1918
  },
  {
    "x": "Windows 10",
    "y": 1413
  },
  {
    "x": "iOS",
    "y": 464
  },
  {
    "x": "Android OS",
    "y": 301
  },
  {
    "x": "Linux",
    "y": 296
  },
  {
    "x": "Windows 7",
    "y": 29
  },
  {
    "x": "Chrome OS",
    "y": 12
  }
]
FieldDescription
xUnique value, depending on metric type.
yNumber of visitors.

GET /api/websites/:websiteId/metrics/expanded

Gets expanded metrics for a given time range.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
typestringMetrics type.
filtersobjectCan accept filter parameters.
limitnumber(optional, default 500) Number of rows returned.
offsetnumber(optional, default 0) Number of rows to skip.

Available Types

path | entry | exit | title | query | referrer | channel | domain | country | region | city | browser | os | device | language | screen | event | hostname | tag | distinctId

Sample response

[
  {
    "name": "Mac OS",
    "pageviews": 74020,
    "visitors": 16982,
    "visits": 24770,
    "bounces": 15033,
    "totaltime": 149156302
  },
  {
    "name": "Windows 10",
    "pageviews": 52252,
    "visitors": 12858,
    "visits": 20089,
    "bounces": 12720,
    "totaltime": 137208105
  },
  {
    "name": "iOS",
    "pageviews": 10029,
    "visitors": 4364,
    "visits": 5139,
    "bounces": 3578,
    "totaltime": 23482267
  },
  {
    "name": "Android OS",
    "pageviews": 8147,
    "visitors": 3122,
    "visits": 3854,
    "bounces": 2610,
    "totaltime": 20347972
  },
  {
    "name": "Linux",
    "pageviews": 12462,
    "visitors": 3000,
    "visits": 4278,
    "bounces": 2630,
    "totaltime": 26331069
  }
]
FieldDescription
nameUnique value, depending on metric type.
pageviewsPage hits.
visitorsNumber of unique visitors.
visitsNumber of unique visits.
bouncesNumber of visitors who only visit a single page.
totaltimeTime spent on the website.

GET /api/websites/:websiteId/pageviews

Gets pageviews within a given time range.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
unitstringTime unit (year | month | hour | day).
timezonestringTimezone (ex. America/Los_Angeles).
comparestring(optional) Comparison period (prev | yoy).
filtersobjectCan accept filter parameters.

Sample response

{
  "pageviews": [
    {
      "x": "2025-10-19T07:00:00Z",
      "y": 4129
    },
    {
      "x": "2025-10-20T07:00:00Z",
      "y": 6105
    },
    {
      "x": "2025-10-21T07:00:00Z",
      "y": 4936
    }
  ],
  "sessions": [
    {
      "x": "2025-10-19T07:00:00Z",
      "y": 1397
    },
    {
      "x": "2025-10-20T07:00:00Z",
      "y": 1880
    },
    {
      "x": "2025-10-21T07:00:00Z",
      "y": 1469
    }
  ]
}
  • x: Timestamp.
  • y: Number of pageviews or visitors.

GET /api/websites/:websiteId/stats

Gets summarized website statistics.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
filtersobjectCan accept filter parameters.

Sample response

{
  "pageviews": 15171,
  "visitors": 4415,
  "visits": 5680,
  "bounces": 3567,
  "totaltime": 809968,
  "comparison": {
    "pageviews": 38675,
    "visitors": 10568,
    "visits": 14595,
    "bounces": 9364,
    "totaltime": 2182387
  }
}
FieldDescription
pageviewsPage hits.
visitorsNumber of unique visitors.
visitsNumber of unique visits.
bouncesNumber of visitors who only visit a single page.
totaltimeTime spent on the website.