Overview

These endpoints provide access to your website analytics data, including statistics, metrics, and time-series data for building custom dashboards and reports.

Analytics Endpoints

Usage Examples

Get Basic Website Statistics

GET /api/websites/abc123/stats?startAt=1683072000000&endAt=1685750399000

Get Time-Series Data for Charts

GET /api/websites/abc123/chart-data?timeframe=last7days&interval=daily&metric=pageviews

Get Comprehensive Dashboard Metrics

GET /api/websites/abc123/metrics?timeframe=last30days

Get Page Performance Data

GET /api/websites/abc123/pageviews?groupBy=url&limit=50

Filtering Options

Most analytics endpoints support filtering by:

  • Time Range: startDate, endDate, timeframe
  • Page: url parameter
  • Traffic Source: referrer parameter
  • Technology: browser, os, device parameters
  • Geography: country parameter

Time Intervals

When requesting time-series data, you can specify intervals:

  • minute: Minute-by-minute data (for real-time)
  • hour: Hourly aggregation
  • day: Daily aggregation
  • week: Weekly aggregation
  • month: Monthly aggregation
  • auto: Automatically choose based on date range

Predefined Timeframes

Use these convenient timeframes instead of custom date ranges:

  • today: Current day
  • yesterday: Previous day
  • last7days: Last 7 days
  • last30days: Last 30 days
  • custom: Use with startDate and endDate