API

Common endpoints

The API exposes an operation for everything you can do in the app, but most integrations only touch a handful of read endpoints — the ones that power the website Overview screen. This page is a shortcut to those. Each row links to its full reference page for parameters and responses.

All paths below are relative to your API base URL: http://<your-umami-instance>/api when self-hosting, or the Umami Cloud base URL from your API key.


Find your website#

Most stats endpoints need a websiteId.

TaskEndpointDetails
List every website you can accessGET /api/websitesList websites
Get a single websiteGET /api/websites/{websiteId}Get a website

Overview numbers#

The stat cards and active-visitor count at the top of the dashboard.

TaskEndpointDetails
Pageviews, visitors, visits, bounces, total time (with comparison)GET /api/websites/{websiteId}/statsGet website summary statistics
Visitors active in the last 5 minutesGET /api/websites/{websiteId}/activeGet active website visitors

Charts over time#

TaskEndpointDetails
Pageviews and sessions time seriesGET /api/websites/{websiteId}/pageviewsGet pageviews and sessions over time
Events time seriesGET /api/websites/{websiteId}/events/seriesGet custom event counts over time

Breakdowns#

Ranked lists for a single dimension — top pages, referrers, browsers, countries, events, and so on. Pass the dimension with type (path, referrer, browser, os, device, country, event, …).

TaskEndpointDetails
Ranked list of one dimensionGET /api/websites/{websiteId}/metrics?type=pathGet ranked website metrics
Same list with pageviews, visitors, visits, bounces, and time per rowGET /api/websites/{websiteId}/metrics/expanded?type=pathGet detailed website metrics

Realtime#

TaskEndpointDetails
Live countries, URLs, referrers, events, and totals (last 30 minutes)GET /api/realtime/{websiteId}Get real-time website activity

Working example#

Pull website summary statistics for one website over a 24-hour window.

1. Authenticate. On self-hosted Umami, exchange your credentials for a token:

Send that token as Authorization: Bearer <token> on every request below. On Umami Cloud, skip this step and pass your API key the same way: Authorization: Bearer <api-key>. See Authentication.

2. Find the website ID.

3. Get the overview stats. startAt and endAt are millisecond epoch timestamps bounding the range — the example values below span a 24-hour window: