Live
Online now
How many people are on your site right now.
curl --request GET \
--url 'https://truestat.io/api/v1/sites/{siteId}/realtime' \
--header 'Authorization: Bearer <token>'{
"data": {
"online": 2
},
"meta": {
"minutes": 10,
"site_id": "6fed8980-a119-4a9c-a4d4-53e448ef9f9e"
}
}One number: how many people are on the site at the moment you ask.
There is no window here
Every other read endpoint takes period or from/to. This one does not —
"right now" has no boundaries to resolve. It takes a lookback instead, and
that is minutes.
The shared parameters are still accepted, because every route parses the same
query contract, and they are ignored. Passing period=last7d here does not
widen anything.
What "online" actually means
A visitor counts as present if they did something within the lookback. So the number is not people looking at the page this instant — nothing on the web can tell you that, because a browser sitting open sends nothing — but people who were doing something recently.
The default lookback is 10 minutes, the same figure the dashboard's own counter uses. That is deliberate: an API reporting a different number than the screen for the same moment would be read as a bug, and rightly.
Widen it with minutes if you want a looser definition of present:
GET /sites/{siteId}/realtime?minutes=30minutes accepts 1 to 360. Above that it is refused rather than clamped —
past six hours you are no longer asking who is here, and
timeseries answers that question better
and more cheaply. A silent clamp would hide the mismatch behind a plausible
answer.
Crawlers are never in this number
bots=included does not change it. A live counter that jumps because a
training run started is not measuring attention — it is measuring machines,
which the AI endpoints do properly and
separately.
Comparing it with the country list
Where they are defaults to a 30-minute
lookback while this one defaults to 10. Call both with the same minutes if
you are showing them together, or the totals will differ and neither will be
wrong.
Authorizations
AuthorizationstringheaderrequiredAn API key from Settings → API keys. Scopes available: analytics:read, sites:read, sites:write, settings:read, settings:write, goals:read, goals:write, funnels:read, funnels:write, notes:read, notes:write, alerts:read, alerts:write, team:read, team:write, revenue:read, revenue:write.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path parameters
siteIdstring (uuid)pathrequiredQuery parameters
minutesintegerqueryResponse
The answer.
dataobjectmetaobjecterrorobjecterrorobjecterrorobjecterrorobject