API

Get pages

GEThttps://api.visitors.now/v1/analytics/pages

Returns top pages ranked by visitors. Supports cursor-based pagination.

Request

index.ts
const res = await fetch("https://api.visitors.now/v1/analytics/pages?period=7d&limit=10", {
  headers: { Authorization: `Bearer ${VISITORS_API_KEY}` },
});

const { items, nextCursor } = await res.json();

Query parameters

period

string

Time period. Default: 30d.

start

string

Custom start date (ISO 8601).

end

string

Custom end date (ISO 8601).

tz

string

Timezone. Default: UTC.

filters

string

JSON-encoded filter object.

cursor

string

Pagination cursor from a previous response.

limit

number

Number of results per page. Default: 50.

search

string

Filter pages by pathname.

Response

{
  "items": [
    {
      "pathname": "/",
      "people": 1204,
      "views": 3891
    },
    {
      "pathname": "/pricing",
      "people": 542,
      "views": 1203
    },
    {
      "pathname": "/docs",
      "people": 389,
      "views": 876
    }
    // ...
  ],
  "nextCursor": "eyJwIjozODksInYiOiIvZG9jcyJ9"
}