Documentation · API reference
GET/api/v1/sites/{site}/stats

Figures for a period

Metrics for a site, optionally broken down by one dimension, filtered, and compared with another period.

Parameters

sitein the address
neededA site's id or name
periodin the query
`today`, `yesterday`, `7d`, `30d`, `month`, `year`, `all`, a date, or two dates with `..` between
metricsin the query
Comma-separated metric names. `visitors,views` when left out
byin the query
A dimension to break down by
filterin the query
`dim:op:value`, repeatable. `op` is `is`, `is_not`, `contains` or `matches`
comparein the query
`previous`, `year`, or a period
limitin the query
Most rows wanted
goalin the query
For the goal metrics

The answer

Status 200

StatsResponse

by
string or null
caveats
list of CaveatViewneeded
compare
PeriodView or null
metrics
list of stringneeded
period
PeriodViewneeded
previous_totals
list of number or null or null
rows
list of StatRowneeded
site
stringneeded
totals
list of number or nullneeded

Asking

With your token from Settings
curl -G https://tidekeeper.eu/api/v1/sites/example.org/stats \
    -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
    -d metrics=visitors,views -d by=source -d period=7d
With your token from Settings
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/stats?metrics=visitors,views&by=source&period=7d", {
  headers: {
    Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`,
  },
}).then((r) => r.json());