Sites

Visitor analytics for a site over a lookback window

Reads pageview / unique-visitor / traffic-source / country / visit-duration metrics live from Cloudflare Analytics Engine. Counts are estimates (adaptive sampling). Returns a zeroed result when analytics is unconfigured or no events have been recorded yet.

get/sites/{id}/analytics

Request

  • Base URL: https://api.nippy.host
  • URL: https://api.nippy.host/sites/{id}/analytics
  • Auth: bearer (a scheme the document does not define)

Path parameters

idstring required

Site UUID

Query parameters

fromstring

Window start, ISO 8601. Omit for "all time" — the server starts the window at the earliest recorded event for the site.

tostring

Window end, ISO 8601. Defaults to now; clamped to now.

interval'1m' | '5m' | '15m' | '1h' | '3h' | '6h' | '1d' | '1w'

Series bucket width (spacing between chart points). Must be one of the widths allowed for the window's duration; an unsupported value is clamped to that duration's default. Defaults to the duration's default.

tzOffsetnumber

Viewer's UTC offset in minutes, east-positive (i.e. -new Date().getTimezoneOffset(); e.g. 60 for UTC+1, -300 for UTC−5). Series buckets are aligned to the viewer’s local day/hour boundaries using this. Defaults to 0 (UTC).

Response

interval'1m' | '5m' | '15m' | '1h' | '3h' | '6h' | '1d' | '1w' required

Series bucket width actually used (echoes the request, clamped to a width allowed for the window duration; falls back to that duration's default).

granularity'minute' | 'hour' | 'day' | 'week' required

Class of the bucket interval (minute | hour | day) — drives axis-label formatting on the dashboard.

fromstring required

Window start, ISO timestamp (UTC).

tostring required

Window end, ISO timestamp (UTC).

Example response

{
  "series": [
    {
      "date": "2026-05-20"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.