400 invalid_request and the list of parameters it does take, so a typo such as rang=7d never silently returns the default period.
Period
Pick the period with a preset inrange, or with a custom from and to. Passing both is an error.
Last day of a custom period, inclusive, as
YYYY-MM-DD in UTC. Requires from, and must be the same day as from or later. A period that would end in the future ends now.
Days start and end at midnight UTC. Every response echoes the resolved period in
range, with from inclusive, to exclusive and a readable label:
400 invalid_request:
Comparison
previous compares with the period just before, of the same length. year compares with the same dates one year earlier. none turns comparison off.{ "value", "previous", "change" }, where change is a ratio: 0.12 is +12% and -0.1 is -10%. Without one, previous and change are null. Breakdown rows get a change in visitors, and the timeseries endpoint adds a previous array of points.
Filters
Narrow any report to a segment with one or morefilter parameters. Each has the form dimension:op:value. Repeat the parameter to add filters; all of them must match.
dimension:op:value, repeatable, up to 10. f is accepted as another name for filter, so you can copy filters from a dashboard URL.
Use values exactly as they appear in a breakdown row’s
key: a two-letter country code such as DE, a source name such as Google, a path such as /pricing. URL-encode values that contain spaces, &, # or +.
The realtime, funnel list and visitor journey endpoints take no filters; sending one returns 400 with “This endpoint does not take filters.” A malformed filter returns 400 with the list of dimensions and operators.
Imported history
When a site has history imported from Plausible, four endpoints include those days by default, as the dashboard does:/stats, /timeseries, /breakdown/{dimension} and /events.
false leaves imported days out, so the numbers cover only what CrispStats recorded. true is the same as leaving it out.- Imported days are always left out while a
filteris on: the export has daily totals, not visits. - Imported days end the day before the first day CrispStats recorded traffic for the site, so a day is never counted twice.
- Imported visitors are counted per day, as CrispStats counts its own in the default privacy mode.
- Imported days have no hostnames, regions or cities, and no event properties.
- Other endpoints never include imported days, and do not take
imported. - With
granularity=hour, a period that holds imported days is returned by day instead; the response’sgranularitysays which.
GET /sites tells you whether a site has imported history and which days it covers, in each site’s imported field. It is null for a site without an import:
Granularity
GET /sites/{siteId}/timeseries buckets the period by granularity.
hour, day, week or month. The default depends on the period length: hour up to 2 days, day up to 92 days, week up to 366 days, then month.400 invalid_request, for example range=all&granularity=hour. Choose a coarser granularity or a shorter period. Visitors are unique within each bucket, so they do not add up across buckets: use GET /stats for a period total. The last bucket may carry "partial": true while it is still filling.
Endpoint parameters
Each endpoint’s own parameters, besides the period, comparison and filters. Numbers outside the bounds return400 invalid_request.
GET /sites, /realtime and /funnels take no parameters at all. /visitors/{visitorId} takes only sessions, with no period or filters.
The {dimension} path segment of a breakdown takes the same dimension names as filters. An unknown dimension returns 400.
Pagination
Three endpoints page withlimit and offset. Each response says how many rows exist in total:
To read every row, increase
offset by limit until offset reaches the total:
/realtime returns the top 5 pages, sources and countries and the 10 most recent events, /retention the 12 most recent cohorts, and /goals and /funnels up to 50 entries. Each page request counts against your rate limit.
Next steps
Errors
Read the
fields object on validation errors.Rate limits
Budget requests when you page through large reports.
Filters in the dashboard
The same filters and comparisons, applied in the dashboard.