query for engagement totals and dimension breakdowns, timeseries for values over time, and realtime for who is on the site right now.
Analytics requires the Pro plan or higher. On lower plans these endpoints return
403 with kind forbidden. See Plans and limits.Prerequisites
- An API key with any access role on the website, see Create an API key
- A published website receiving traffic, see the Quickstart
Time ranges and filters
Thequery and timeseries endpoints take startAt and endAt as Unix epoch timestamps in milliseconds, and accept these optional filters as query parameters: path, referrer, title, query, browser, os, device, country, region, city, language, hostname, tag, event, distinctId, utmSource, utmMedium, utmCampaign, utmContent, utmTerm, segment, cohort.
1
Read engagement totals
GET /v1/websites/{websiteId}/analytics/query returns totals for the range.Last 7 days of totals
Response
--data-urlencode 'country=US'. A website with no recorded traffic returns the same shape with zeros.2
Break down by dimension
Add
dimension to the same endpoint to rank values of one dimension alongside the totals. dimension is one of: path, entry, exit, title, query, referrer, channel, domain, country, region, city, browser, os, device, language, screen, event, hostname, tag, distinctId. limit caps the rows (default 25, max 1000).Top pages
Response (truncated)
rows is present only when dimension is set, ranked by page views with full engagement totals per value.3
Read a time series
GET /v1/websites/{websiteId}/analytics/timeseries returns one series bucketed by unit (year, month, day, hour, or minute). series selects which:series=pageviewsreturns parallelpageviewsandsessionsarrays, one point per bucket. Optionalcompare(prevfor the previous period,yoyfor a year earlier) requests comparison data.series=eventsreturns tracked custom-event counts inevents, one point per event name per bucket, shaped{ "x": "<event>", "t": "<period>", "y": <count> }.compareis not valid here.
timezone (an IANA name) controls bucket boundaries, and maxPoints (default 30, max 500) caps how many of the most recent time buckets are returned.Daily pageviews
Response (truncated)
maxPoints, only the most recent buckets are returned and the response carries a truncated field with shown, total, and a hint. Request a coarser unit, a narrower range, or a larger maxPoints for full coverage.4
Watch realtime activity
GET /v1/websites/{websiteId}/analytics/realtime takes no range and returns a compact snapshot of Umami’s trailing 30-minute realtime window:Realtime snapshot
Response
visitors is the distinct visitor count in that 30-minute window; timestamp is the snapshot time as ISO 8601. This is not directly comparable to the removed active endpoint, which counted distinct visitors over five minutes.Troubleshooting
Next steps
- Plans and limits for what each plan includes
- How Cactal works for where analytics sits in the platform