{"doc_excerpts":[{"source_url":"https://docs.umami.is/docs/api-reference/get-website-pageviews","text":"# Get pageviews and sessions over time\n\n`/api/websites/{websiteId}/pageviews`\n\nReturns pageviews and sessions grouped by the requested time interval and timezone, including a comparison period when requested.\n\n## Headers\n\n| Name | Type | Description |\n --- \n| Authorizationrequired | string | Authentication credentials, e.g. `Bearer <token>`. |\n\n`Bearer <token>`\n\n## Path parameters\n\n| Name | Type | Description |\n --- \n| websiteIdrequired | string | Website ID. |\n\n## Query parameters"},{"source_url":"https://docs.umami.is/docs/api-reference/get-website-pageviews","text":"| Name | Type | Description |\n --- \n| startAt | number | Start of the date range as a Unix timestamp in milliseconds. |\n| endAt | number | End of the date range as a Unix timestamp in milliseconds. |\n| startDate | string | Start of the date range as an ISO 8601 date or date-time. |\n| endDate | string | End of the date range as an ISO 8601 date or date-time. |\n| timezone | string | IANA time zone used to interpret dates and group results, for example America/New\\_York. |\n| unit | string | Time interval used to group results: minute, hour, day, month, or year. |\n| compare | enum<string> | Comparison period: prev for the previous period or yoy for the same period last year. Options: `prev`, `yoy` |\n| path | string | Filter by page URL path. |\n| referrer | string | Filter by referring URL. |"},{"source_url":"https://docs.umami.is/docs/api-reference/get-website-pageviews","text":"`{\n \"compare\": {\n \"endDate\": \"2024-01-15T09:30:00Z\",\n \"pageviews\": [\n {\n \"x\": \"string\",\n \"y\": 0\n }\n ],\n \"sessions\": [\n {\n \"x\": \"string\",\n \"y\": 0\n }\n ],\n \"startDate\": \"2024-01-15T09:30:00Z\"\n },\n \"endDate\": \"2024-01-15T09:30:00Z\",\n \"pageviews\": [\n {\n \"x\": \"string\",\n \"y\": 0\n }\n ],\n \"sessions\": [\n {\n \"x\": \"string\",\n \"y\": 0\n }\n ],\n \"startDate\": \"2024-01-15T09:30:00Z\"\n}`\n\n| Name | Type | Description |\n --- \n| errorrequired | object | Error details returned when the operation fails. |\n| properties | | |\n\n`{\n \"error\": {\n \"code\": \"bad-request\",\n \"message\": \"Bad request.\",\n \"status\": 400\n }\n}`\n\n| Name | Type | Description |\n --- \n| errorrequired | object | Error details returned when the operation fails. |\n| properties | | |"}],"events":[{"label":"pageview e01","timestamp_seconds":1772881140,"utc_instant":"2026-03-07T10:59:00Z"},{"label":"pageview e02","timestamp_seconds":1772881260,"utc_instant":"2026-03-07T11:01:00Z"},{"label":"pageview e03","timestamp_seconds":1772956740,"utc_instant":"2026-03-08T07:59:00Z"},{"label":"pageview e04","timestamp_seconds":1772956860,"utc_instant":"2026-03-08T08:01:00Z"},{"label":"pageview e05","timestamp_seconds":1772963940,"utc_instant":"2026-03-08T09:59:00Z"},{"label":"pageview e06","timestamp_seconds":1772964060,"utc_instant":"2026-03-08T10:01:00Z"},{"label":"pageview e07","timestamp_seconds":1772967540,"utc_instant":"2026-03-08T10:59:00Z"},{"label":"pageview e08","timestamp_seconds":1772967660,"utc_instant":"2026-03-08T11:01:00Z"},{"label":"pageview e09","timestamp_seconds":1772994540,"utc_instant":"2026-03-08T18:29:00Z"},{"label":"pageview e10","timestamp_seconds":1772994660,"utc_instant":"2026-03-08T18:31:00Z"},{"label":"pageview e11","timestamp_seconds":1773039540,"utc_instant":"2026-03-09T06:59:00Z"},{"label":"pageview e12","timestamp_seconds":1773039660,"utc_instant":"2026-03-09T07:01:00Z"}],"expected":[{"bucket_label":"2026-03-07","count":3},{"bucket_label":"2026-03-08","count":8},{"bucket_label":"2026-03-09","count":1}],"fixture_description":"Twelve pageviews were recorded for one website at the UTC instants listed below. Several fall just before or just after local midnight in Los Angeles, Auckland and Kolkata, and one pair falls on either side of the Los Angeles daylight-saving change on March 8, 2026, so each local day's count depends on the selected time zone.","follow_up_examples":[{"expected":[{"bucket_label":"2026-03-07","count":1},{"bucket_label":"2026-03-08","count":6},{"bucket_label":"2026-03-09","count":5}],"observed":[{"bucket_label":"2026-03-07","count":2},{"bucket_label":"2026-03-08","count":8},{"bucket_label":"2026-03-09","count":2}],"timezone":"Pacific/Auckland"},{"expected":[{"bucket_label":"2026-03-07","count":2},{"bucket_label":"2026-03-08","count":7},{"bucket_label":"2026-03-09","count":3}],"observed":[{"bucket_label":"2026-03-07","count":2},{"bucket_label":"2026-03-08","count":8},{"bucket_label":"2026-03-09","count":2}],"timezone":"Asia/Kolkata"}],"http_status":200,"locale":"en-US","observed":[{"bucket_label":"2026-03-07","count":2},{"bucket_label":"2026-03-08","count":8},{"bucket_label":"2026-03-09","count":2}],"request":{"method":"GET","path":"/api/websites/11111111-1111-4111-8111-111111111111/pageviews","query":{"endAt":"1773100799999","startAt":"1772841600000","timezone":"America/Los_Angeles","unit":"day"}},"schema_version":1,"timezone":"America/Los_Angeles","user_action":"Requested the daily pageview counts for one website from March 7 to March 9, 2026, with the time zone set to America/Los_Angeles, and compared each day's count with the visits recorded for that local day."}