Get Site Stats
Retrieve aggregated analytics for a specific site.GET /v1/stats
Query Parameters
string
required
The unique ID of the site to query. Get this value from GET /v1/sites.
string
default:"30d"
The time period to aggregate data over. Accepted values:
string
The start of a custom date range in
YYYY-MM-DD format (e.g. 2024-02-01). Required when period=custom.string
The end of a custom date range in
YYYY-MM-DD format (e.g. 2024-02-28). Required when period=custom. Must be greater than or equal to date_from.string
default:"both"
The metric(s) to return. Accepted values:
Example Requests
Example Response
Response Fields
integer
The total number of pageviews recorded in the requested period. Omitted when
metric=visitors.integer
The number of unique visitors counted in the requested period. TinyTrack counts visitors using a daily-salted, cookieless fingerprint — no personal data is stored or returned. Omitted when
metric=pageviews.array
An ordered array of the most-viewed pages in the requested period, from highest to lowest view count. Each entry in the array contains:
path(string) — the URL path (e.g./blog/intro)views(integer) — the pageview count for that path in the period
string
The start of the period actually used for the query, in
YYYY-MM-DD format. Useful for confirming the resolved range when you used a named period like 7d.string
The end of the period actually used for the query, in
YYYY-MM-DD format.