Skip to main content

Live

Online now

How many people are on your site right now.

GET/sites/{siteId}/realtime
Online 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=30

minutes 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

Authorizationstringheaderrequired

An 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)pathrequired
The site's id, from `GET /sites`. A site that is not yours and a site that does not exist both answer 403, so this cannot be used to discover other people's ids.

Query parameters

minutesintegerquery
How far back to look, in minutes. A visitor counts as present if they did something within it. Refused above 360 rather than clamped — past that the question is no longer 'who is here' and `/timeseries` answers it better.

Response

application/json

The answer.

dataobject
metaobject