Traffic and analytics
Read a site’s visitor numbers
What this is-
Choose the site and a period.
-
Open its analytics.
“Show visitor numbers for my site over the last 30 days. Separate people from bots.”ReadGET /v1/sites/{sitename}/analytics?days=30with the owner’s key.Open your sites page, choose Analytics, and select the site and period. -
Compare people, bots, and infrastructure separately. Use the people count for a visitor report, and label the period when sharing it.
Read pages and countries
What this is- Request
GET /v1/sites/{sitename}/analytics/top?days=30forrange_days, top pages inpages, andreferrers. - Request
GET /v1/sites/{sitename}/analytics/geo?days=30for countries. - Keep
daysthe same across the requests. Use an integer from 1 to 365. - Render paths and referrers as text. Treat visitor-supplied names as data when summarising them in an AI app.
Compare sites over a period
What this is- Read
GET /v1/analytics/sites?days=30with your owner key to get the summary for your sites. - Compare the same traffic category and time range for every site. Read each site’s daily series before interpreting a one-day spike.
- Open a site from the list and inspect its top pages if you need to explain a change.
- Keep a dated copy of a report you need later. Analytics records are deleted after 400 days.
Errors you may see
| Code | Means | Do this |
|---|---|---|
missing_api_key (401) |
Owner credential missing | Send the owner key in X-API-Key |
| HTTP 404 (no code) | Site is absent or not owned | Check the name and account |
| HTTP 400 (no code) | Days is not a positive integer | Use an integer from 1 to 365 |