API: visitor statistics
Read a website's visitor statistics — totals, days, the last 48 hours and top lists — over a date range.
This endpoint gives what the Visitor stats screen shows, with the same checks: the account's package needs the Visitor statistics feature.
bash
A=https://api.yourdomain.com:2087/v1
H="Authorization: Bearer hf_xxx"
curl -s -H "$H" "$A/accounts/sarahbakes/domains/example.com/stats?from=2026-10-01&to=2026-10-26"
The path follows the rules of every per-account endpoint: a customer's token reaches only its own account, a reseller's only its customers'.
| Query | What it is |
|---|---|
from, to |
first and last day, YYYY-MM-DD (at most 13 months back; never after today, UTC) |
days |
instead of from/to: the last 7, 30 (default), 90 or 365 days |
| Field | What it is |
|---|---|
total |
visitors, pages, hits (requests), bytes, bots over the range |
days |
one object per day: day, visitors, pages, hits, bytes, bots |
hours |
24 numbers: requests per hour of the day (UTC), bots left out |
last48 |
the last 48 hours: hour, visitors, pages, hits, bytes |
pagesTop, refsTop, countriesTop, devicesTop, browsersTop, osTop, statusTop |
the top 10 of each list: key, n, pct |
tracked, since, updated, behind |
whether the log is read hourly, from which day, the last read, and whether a backlog is still being read |
No visitor address is ever part of the answer: the statistics don't store any.