Stats API
Updated
A read-only key is enough for everything on this page. Create a key under Account settings → Security (API keys) and send it as Authorization: Bearer …. The query format follows Plausible's Stats API v1 for the common subset.
GET /api/v1/stats/realtime/visitors?site_id=example.com
GET /api/v1/stats/aggregate?site_id=example.com&period=30d&metrics=visitors,pageviews,bounce_rate
GET /api/v1/stats/timeseries?site_id=example.com&period=30d&metrics=visitors
GET /api/v1/stats/breakdown?site_id=example.com&period=30d&property=visit:source&limit=10
GET /api/v1/stats/goals?site_id=example.com&period=30d
GET /api/v1/stats/funnels?site_id=example.com
GET /api/v1/stats/funnels/{id}?site_id=example.com&period=30d
GET /api/v1/stats/annotations?site_id=example.com&period=30d
Parameters
| Parameter | Notes |
|---|---|
site_id |
The site's domain. Required |
period |
day, 7d, 30d, month, 6mo, 12mo, year or custom. Default 30d |
date |
YYYY-MM-DD for the period's anchor. For custom: YYYY-MM-DD,YYYY-MM-DD |
metrics |
Comma-separated: visitors, visits, pageviews, views_per_visit, bounce_rate, visit_duration. Default visitors |
filters |
See below |
interval |
Timeseries only. One of the intervals allowed for the period |
compare |
aggregate only. previous_period adds a change percentage |
property |
breakdown only. See below |
limit, page |
breakdown only. limit is 1 to 1000, default 100 |
Days begin and end in the site's timezone.
Responses
{ "results": { "visitors": { "value": 1423 }, "pageviews": { "value": 3320 } } }
timeseries returns results as a list of { "date": …, "visitors": … } rows. breakdown returns a list of rows keyed by the property name, for example { "source": "Google", "visitors": 310 }. realtime/visitors returns a number.
Filters
Join clauses with ;. Separate alternative values with |.
filters=visit:country==DE|FR;event:page==/blog/*
| Operator | Meaning |
|---|---|
== |
is (* is a wildcard) |
!= |
is not |
=~ |
contains |
Dimensions: event:page, event:goal, event:props:NAME, visit:entry_page, visit:exit_page, visit:source, visit:referrer, visit:channel, visit:utm_medium, visit:utm_source, visit:utm_campaign, visit:utm_content, visit:utm_term, visit:country, visit:region, visit:city, visit:browser, visit:os, visit:device.
Breakdown properties
Any dimension above except event:goal and event:props:* works as property.
Goals, funnels and notes
These take site_id, period, date and filters like the others.
goalsreturnsresults, one row per goal withvisitors(unique conversions),events(total),conversion_rateand, for revenue goals,revenue,average_revenueandcurrency.funnelslists the site's funnels (id,name,steps);funnels/{id}returns the visitors reaching each step with drop-off and conversion rates. Funnels come with Pro on Tidemark Cloud.annotationsreturns the notes on the graph for the period that the key's owner may see (date,note,visibility).
OpenAPI
Every endpoint on this page, the Events API and the MCP endpoint are described in an OpenAPI 3.1 document at /api/v1/openapi.json on your installation. It needs no key and works with any API client or code generator.
Errors
| Status | Reason |
|---|---|
| 401 | Missing or invalid key |
| 404 | Unknown site, or you don't have access to it |
| 422 | Unsupported period or property, or a malformed custom date |
Note:
The dashboard's own JSON endpoints under /api/sites/{domain}/stats/… are internal and may change between releases. Build on /api/v1/stats.
Was this helpful?
Ready to try Tidemark?
Free plan, no credit card. No cookies, no footprints.