Skip to main content

Analytics

Timeseries

The same figures as overview, in buckets — what a chart is drawn from.

GET/sites/{siteId}/timeseries
Timeseries
curl --request GET \
  --url 'https://truestat.io/api/v1/sites/{siteId}/timeseries' \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "goals": 0,
      "views": 42,
      "bucket": "2026-09-16 00:00:00",
      "visitors": 23,
      "new_visitors": 19,
      "crawler_views": 1132,
      "goal_value_cents": 0,
      "returning_visitors": 5
    }
  ],
  "meta": {
    "range": {
      "to": "2026-09-16T13:40:00.000Z",
      "tz": "UTC",
      "from": "2026-09-09T00:00:00.000Z",
      "clamped": false
    },
    "site_id": "6fed8980-a119-4a9c-a4d4-53e448ef9f9e"
  }
}

One row per bucket, ready to plot.

The bucket size is chosen for you

Leave unit out and one is picked to suit the window:

WindowBucket
Up to 2 dayshour
Up to 3 monthsday
Up to 2 yearsweek
Longermonth

Pass unit to override it. A year in minutes is half a million buckets, which is not a chart — the cap on limit does not apply here, so choose deliberately.

Crawlers are always in the series

crawler_views is present whatever bots says.

bots=excluded removes crawler traffic from the human figures — visitors, views, sessions. It does not hide the crawler line, because that line is the one number no other analytics tool ships and hiding it by default would bury the reason you installed this.

crawler_views is the total. The split by purpose — answering, indexing, training, referrals — comes from /ai/series, which reads a different query built for exactly that breakdown.

Which goals the goal series counts

goals and goal_value_cents count the goals the site nominates as its revenue signal, set in the dashboard. A site that has nominated none gets every goal counted, which is what the headline figures do.

This is the site's choice rather than the caller's: a chart that counted different goals from the tile above it would be two answers to one question.

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

unitenum<string>query
Bucket size. Chosen from the window when omitted.
options:minutehourdayweekmonth
periodenum<string>query
A named window, resolved in `tz`. Cannot be combined with `from`/`to` — a request carrying both is refused rather than guessed at.
options:todayyesterdaylast24hlast7dlast30dlast12mmonthyearall
fromstring (date-time)query
Start of the window, ISO 8601 with an offset. Must be given together with `to`.
tostring (date-time)query
End of the window. Must be given together with `from`.
tzstringquerydefault: UTC
IANA timezone for day boundaries. `period=today&tz=Europe/Istanbul` means the reader's today, not the server's. Defaults to UTC.
botsenum<string>querydefault: excluded
Whether crawler traffic is counted. Excluded by default — the `/ai/*` endpoints report it separately and always include it.
options:excludedincluded
filter_pathstringquery
Narrow the result to one `path`.
filter_path_patternstringquery
Narrow the result to one `path_pattern`.
filter_hostnamestringquery
Narrow the result to one `hostname`.
filter_entry_pathstringquery
Narrow the result to one `entry_path`.
filter_exit_linkstringquery
Narrow the result to one `exit_link`.
filter_file_downloadstringquery
Narrow the result to one `file_download`.
filter_goalstringquery
Narrow the result to one `goal`.
filter_browserstringquery
Narrow the result to one `browser`.
filter_osstringquery
Narrow the result to one `os`.
filter_devicestringquery
Narrow the result to one `device`.
filter_countrystringquery
Narrow the result to one `country`.
filter_regionstringquery
Narrow the result to one `region`.
filter_citystringquery
Narrow the result to one `city`.
filter_referrerstringquery
Narrow the result to one `referrer`.
filter_channelstringquery
Narrow the result to one `channel`.
filter_utm_sourcestringquery
Narrow the result to one `utm_source`.
filter_utm_mediumstringquery
Narrow the result to one `utm_medium`.
filter_utm_campaignstringquery
Narrow the result to one `utm_campaign`.
filter_gad_campaign_idstringquery
Narrow the result to one `gad_campaign_id`.
filter_utm_termstringquery
Narrow the result to one `utm_term`.
filter_bot_kindstringquery
Narrow the result to one `bot_kind`.

Response

application/json

The answer.

dataunknown
See the example.
metaobject