Skip to content

Stats

GET /api/v1/sites/:id/stats

The same seven numbers the Overview tiles show, plus the equivalent window immediately before and the delta between them.

Parameter Values Default
range today, yesterday, 24h, 7d, 30d, 90d, 12m, week, month 30d
any filter key none

The range is resolved in the site’s timezone, not yours.

Terminal window
curl -s -H "Authorization: Bearer tk_live_…" \
"https://tracing.tools/api/v1/sites/pk_live_a91c3f04/stats?range=7d&country=DE"
{
"site": {
"id": "6f2b1e7c-9a54-4f21-8c3a-1d0b7e5f4a92",
"domain": "acme.com"
},
"range": {
"key": "7d",
"start": "2026-09-10T22:00:00.000Z",
"end": "2026-09-16T17:41:12.913Z",
"timezone": "Europe/Berlin"
},
"data": {
"visitors": 4812,
"pageviews": 11934,
"sessions": 6201,
"bounces": 3477,
"bounceRate": 56.07160135462022,
"totalTimeMs": 519337000,
"avgVisitMs": 83750.8,
"viewsPerVisit": 1.9245283018867925,
"revenueCents": 189400
},
"previous": {
"visitors": 4407,
"pageviews": 10802,
"sessions": 5730,
"bounces": 3301,
"bounceRate": 57.609075043630016,
"totalTimeMs": 464130000,
"avgVisitMs": 81000.0,
"viewsPerVisit": 1.8851657940031396,
"revenueCents": 164900
},
"delta": {
"visitors": 9.190378942591332,
"pageviews": 10.479540825772997,
"sessions": 8.220592495636109,
"bounces": 5.331717661314753,
"bounceRate": -2.6772866634384,
"totalTimeMs": 11.89474071057461,
"avgVisitMs": 3.3960493827160494,
"viewsPerVisit": 2.0886571273667874,
"revenueCents": 14.857489387507579
}
}
Field Meaning
visitors Distinct visitor ids. Read as browser-days — see How visitors are counted
pageviews Events of type pageview
sessions Distinct visits the filtered events belong to
bounces Visits with one or fewer pageviews
bounceRate bounces / sessions × 100
totalTimeMs Sum of session durations
avgVisitMs totalTimeMs / sessions
viewsPerVisit pageviews / sessions
revenueCents Revenue reported by events in the slice, in minor units

previous and delta are null only if the range carries no comparison window — in practice every range does.

delta is a percentage change per field. When the previous value is zero and the current one is not, it is 100. When both are zero, it is 0.

revenueCents is in the currency’s minor unit, which is not always one hundredth — see Revenue events. The site’s currency is on /sites.

Status Body
401 {"error":"Missing or invalid API key"}
404 {"error":"site not found"}

An unrecognised range is not an error — it falls back to 30d. An unrecognised filter parameter is ignored.