Read your TrueStat data from your own code — and manage your account with it.
| Page | Covers |
| Getting an API key | Including the part where it is shown once |
| Authentication | |
| Rate limits | |
| Endpoint reference | Every endpoint and every parameter |
| Examples | Real requests and real responses |
| Errors | Every code, and what to do about each |
On every plan
The API is on both tiers, at every traffic step — Starter included, and so is MCP. See Plans compared.
Your plan changes how many sites and people you have, and how far back your history goes. It does not change what you can read or how you read it.
What it is for
Reading your figures, and running the account around them:
Put your visitor count on your own homepage, status page or internal dashboard.
Chart your traffic in your own tool, with your own ranges and filters.
Report which AI crawlers read your site — the thing only TrueStat can answer.
Configure what you measure and who sees it — goals, funnels, alerts, notes, site settings, the shared board, the widget and your team.
What it is not for
Reading is the larger half, but the API writes too. Goals, goal rules, funnels, alerts, notes, site settings, integrations, the shared board, the widget and team membership can all be created or changed over HTTP, each behind its own write scope — see Authentication for the scope grid.
Three things stay dashboard-only, and each for a reason rather than for want of building: minting an API key (a credential that issues credentials turns one leak into permanent access), deleting a site (irreversible), and transferring ownership of an account.
Writing a pageview is also not something this API does. To send events,
use the tracking script — or POST /goals for a conversion your
server knows about and the browser does not.
Two things that are deliberately absent
There is no visitor endpoint. No visitor list, no per-visitor journey, no lookup by id. That is not a gap to be filled later — it needs the cross-day person identity TrueStat is built without. See What we deliberately cannot do.
There is no endpoint that posts a payment. Revenue arrives from your
payment provider and is reconciled against it, so a figure you could POST
would be a figure your Stripe account has never seen. What you can do is
read it — revenue_cents on
overview and
timeseries — and manage the connection
itself with the integrations endpoints,
which connect, disconnect and re-sync a provider under revenue:write.
Goals are read the same way: ranked by
breakdowns with dimension=goal, broken
open by goal properties, and sequenced by
funnels.