---
title: "View analytics for your pages"
method: GET
path: "/api/analytics"
---

# View analytics for your pages

`GET /api/analytics`

## Request

- Base URL: `https://lucid.page`
- URL: `https://lucid.page/api/analytics`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `apiKey`
  - none

Per-day view counts over a trailing window, computed from server-side pageview tracking. Requires authentication (session or lp_ key). Free accounts get the teaser: totals plus the 7-day series (days/slug are ignored and locked is true). Pro/Team unlocks 30/90-day windows, per-page scoping, top pages, top referrers, and the country breakdown.

## Query parameters

- `days` 7 | 30 | 90
- `slug` string

## Response `200`

The analytics report for the requested window

- object
  - `days` integer
  - `slug` string, nullable
  - `totals` object
    - `views` integer
    - `prevViews` integer: Views in the preceding window of the same length
  - `series` object[]: One entry per day, zero-filled
    - `date` string
    - `views` integer
  - `topDocs` object[], nullable: Top pages by views; empty when scoped to a slug, null for free accounts
    - `slug` string
    - `title` string, nullable
    - `views` integer
  - `referrers` object[], nullable: Top referrer hosts; a null host means direct traffic. Null for free accounts
    - `host` string, nullable
    - `views` integer
  - `countries` object[], nullable: Top ISO 3166-1 alpha-2 countries (Pro/Team); null for free accounts
    - `country` string
    - `views` integer
  - `locked` boolean: True on the free plan: the report is the 7-day teaser and topDocs/referrers/countries are null

## Other responses

- `401`: Missing or invalid credentials
- `404`: The requested slug is not owned by the caller
- `503`: Index temporarily unavailable

---

[API](https://skmtc.dev/lucid/apis/lucid-page.md) · [All operations](https://skmtc.dev/lucid/apis/lucid-page/llms.txt) · [OpenAPI document](https://skmtc.dev/lucid/apis/lucid-page/revisions/ac6b8c27c38b?raw)
