Websites
Get visitor charts for websites
GET
/api/websites/chartsReturns visitor totals and chart data for the requested websites the caller can view, within the selected date range.
Try it
Headers
| Name | Type | Description |
|---|---|---|
| Authorizationrequired | string | Token returned by POST /api/auth/login, or an API key (`umami_…`) created under Settings → API keys (self-hosted only). Bearer <token>. |
| x-umami-share-contextrequired | string | Required context header when authenticating with a share token. <api-key>. |
| x-umami-share-tokenrequired | string | Signed token returned by a share endpoint. <api-key>. |
Query parameters
| Name | Type | Description |
|---|---|---|
| idsrequired | string | Comma-separated resource IDs. Provide between 1 and 20 IDs. |
| startAt | integer | Start of the date range as a Unix timestamp in milliseconds. |
| endAt | integer | End of the date range as a Unix timestamp in milliseconds. |
| timezone | string | IANA time zone used to interpret dates and group results, for example America/New_York. |
| period | enum<string> | Relative date range, for example 7d or 30day, used instead of an explicit startAt/endAt range. Options: today, 24h, 7d, 30d, 0day, 24hour, 0week, 7day, 0month, 30day, 90day, 0year, 6month, 12month |
Responses
200The operation completed successfully.
| Name | Type | Description |
|---|---|---|
| datarequired | object | Data returned by the operation. |
200 example
400Bad request.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
400 example
401Unauthorized.
| Name | Type | Description |
|---|---|---|
| errorrequired | object | Error details returned when the operation fails. |
401 example
Code samples
cURL