Website statistics

Operations around Website statistics.

Endpoints

GET /api/websites/:websiteId/active
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.

Parameters

  • path: (string | optional) Name of URL.
  • referrer: (string | optional) Name of referrer.
  • title: (string | optional) Name of page title.
  • query: (string | optional) Name of query parameter.
  • browser: (string | optional) Name of browser.
  • os: (string | optional) Name of operating system.
  • device: (string | optional) Name of device (ex. Mobile)
  • country: (string | optional) Name of country.
  • region: (string | optional) Name of region/state/province.
  • city: (string | optional) Name of city.
  • hostname: (string | optional) Name of hostname.
  • tag: (string | optional) Name of tag.
  • segment: (uuid | optional) UUID of segment.
  • cohort: (uuid | optional) UUID 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.

  • minute: Up to 60 minutes.
  • hour: Up to 48 hours.
  • day: Up to 12 months.
  • month: No limit.
  • year: No 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/events/series

Gets events within a given time range.

Parameters

  • startAt: (number) Timestamp (in ms) of starting date.
  • endAt: (number) Timestamp (in ms) of end date.
  • unit: Time unit (year | month | hour | day).
  • timezone: Timezone (ex. America/Los_Angeles).
  • filters: Can 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
  }
]
  • x: Event name.
  • t: Timestamp.
  • y: Number of events.

GET /api/websites/:websiteId/metrics

Gets metrics for a given time range.

Parameters

  • startAt: (number) Timestamp (in ms) of starting date.
  • endAt: (number) Timestamp (in ms) of end date.
  • unit: Time unit (year | month | hour | day).
  • timezone: Timezone (ex. America/Los_Angeles).
  • type: Metrics type.
  • filters: Can accept filter parameters.
  • limit: (optional, default 500) Number of rows returned.
  • offset: (optional, default 0) Number of ows to skip.

Available Types

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

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
  }
]
  • x: Unique value, depending on metric type.
  • y: Number of visitors.

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

Gets expanded metrics for a given time range.

Parameters

  • startAt: (number) Timestamp (in ms) of starting date.
  • endAt: (number) Timestamp (in ms) of end date.
  • unit: Time unit (year | month | hour | day).
  • timezone: Timezone (ex. America/Los_Angeles).
  • type: Metrics type.
  • filters: Can accept filter parameters.
  • limit: (optional, default 500) Number of rows returned.
  • offset: (optional, default 0) Number of ows to skip.

Available Types

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

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
  }
]
  • name: Unique value, depending on metric type.
  • pageviews: Pages hits
  • visitors: Number of unique visitors
  • visits: Number of unique visits
  • bounces: Number of visitors who only visit a single page
  • totaltime: Time spent on the website

GET /api/websites/:websiteId/pageviews

Gets pageviews within a given time range.

Parameters

  • startAt: (number) Timestamp (in ms) of starting date.
  • endAt: (number) Timestamp (in ms) of end date.
  • unit: Time unit (year | month | hour | day).
  • timezone: Timezone (ex. America/Los_Angeles).
  • compare: (string | optional) Comparison value prev| yoy.
  • filters: Can 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

  • startAt: (number) Timestamp (in ms) of starting date.
  • endAt: (number) Timestamp (in ms) of end date.
  • unit: Time unit (year | month | hour | day).
  • timezone: Timezone (ex. America/Los_Angeles).
  • filters: Can 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
  }
}
  • pageviews: Pages hits
  • visitors: Number of unique visitors
  • visits: Number of unique visits
  • bounces: Number of visitors who only visit a single page
  • totaltime: Time spent on the website