---
title: "Traffic pulse — sites receiving views in a trailing window"
method: GET
path: "/stats/traffic"
tags: ["Stats"]
---

# Traffic pulse — sites receiving views in a trailing window

`GET /stats/traffic`

## Request

- Base URL: `https://api.nippy.host`
- URL: `https://api.nippy.host/stats/traffic`
- Auth: `bearer` (a scheme the document does not define)

Admin-only view of which sites got pageviews inside the trailing window, ordered by most-recent view, each with in-window totals and a bucketed series showing when the views landed. Window totals cover every active site; the row list is capped at `siteLimit`. Sites with no views in the window are absent — for the full directory use `GET /stats/sites`. Served from a short server-side cache (keyed per window preset).

## Query parameters

- `window` '1h' | '24h' | '7d' | '30d'

## Response `200`

- APIStatsTraffic
  - `window` '1h' | '24h' | '7d' | '30d', required: Trailing window preset this response covers.
  - `interval` string, required: Bucket width of the per-site series (implied by the window preset).
  - `from` string, required: Window start (ISO 8601).
  - `to` string, required: Window end (ISO 8601).
  - `buckets` string[], required: UTC-floored start times of the series buckets, oldest first (ISO 8601). Every site row carries exactly one series entry per bucket.
  - `pageviews` number, required: Sample-corrected pageviews across all sites in the window.
  - `uniqueVisitors` number, required: Distinct visitors across all sites in the window (sum of per-site uniques; the visitor hash is site-scoped, so the sum is exact).
  - `activeSites` number, required: Number of sites that received at least one view in the window — may exceed `sites.length` when the list is capped at `siteLimit`.
  - `siteLimit` number, required: Maximum rows the `sites` list carries. When `activeSites` exceeds this, the list holds the most recently viewed sites.
  - `sites` APIStatsTrafficSite[], required
    - `id` string, required: Site id (UUID).
    - `subdomain` string, required: Subdomain on the platform apex.
    - `url` string, required: Public URL the site is served at.
    - `status` 'pending' | 'awaiting_verification' | 'live' | 'inactive' | 'suspended', required: Lifecycle status of the site.
    - `ownerName` string, nullable, required: Name of the owning account — null if the account is missing.
    - `ownerUserId` string, nullable, required: User id of the owning account's owner membership — links the row to the admin user drill-down. Null when the account has no bound owner membership.
    - `plan` 'free' | 'basic' | 'pro' | 'max', required: Plan tier of the owning account (defaults to free).
    - `pageviews` number, required: Sample-corrected pageviews inside the window.
    - `uniqueVisitors` number, required: Distinct visitors inside the window. The visitor hash rotates daily, so multi-day windows sum daily uniques rather than deduplicate across days.
    - `lastViewAt` string, required: Timestamp of the most recent view in the window (ISO 8601).
    - `series` number[], required: Pageviews per bucket across the window, oldest first — one entry per `buckets` timestamp, zero-filled. Powers the per-row sparkline.
  - `generatedAt` string, required: When this snapshot was computed (ISO 8601).

## Other responses

- `403`: Admin access required

---

[API](https://skmtc.dev/nippy/apis/nippy-backend-api.md) · [All operations](https://skmtc.dev/nippy/apis/nippy-backend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nippy/apis/nippy-backend-api/revisions/7ab23f040a55?raw)
