{"components":{"schemas":{"DayCount":{"description":"Pageviews of a single day.","properties":{"count":{"format":"int64","type":"integer"},"day":{"description":"Day in `YYYY-MM-DD` (site timezone).","example":"2026-08-20","type":"string"}},"required":["day","count"],"type":"object"},"ErrorResponse":{"description":"Stable machine-readable error shape for every v1 error.","properties":{"error":{"description":"One of: `invalid_period`, `upstream_unavailable`, `panel_disabled`.","example":"invalid_period","type":"string"}},"required":["error"],"type":"object"},"PageCount":{"description":"Pageview count of a single path.","properties":{"count":{"format":"int64","type":"integer"},"path":{"example":"/blog/hello","type":"string"},"title":{"type":"string"}},"required":["path","title","count"],"type":"object"},"PagesResponse":{"description":"Most-viewed pages for a fixed period.","properties":{"generated_at":{"description":"See [`SummaryResponse::generated_at`].","type":"string"},"pages":{"description":"At most 20 entries, sorted by count descending.","items":{"$ref":"#/components/schemas/PageCount"},"type":"array"},"period":{"example":"7d","type":"string"}},"required":["period","generated_at","pages"],"type":"object"},"PanelsResponse":{"description":"The enabled panels of this deployment (the exposure policy, readable).","properties":{"panels":{"items":{"type":"string"},"type":"array"}},"required":["panels"],"type":"object"},"RankedItem":{"description":"One row of a ranked panel.","properties":{"count":{"format":"int64","type":"integer"},"name":{"description":"Display name (browser, referrer host, country, ...).","type":"string"}},"required":["name","count"],"type":"object"},"RankedResponse":{"description":"Uniform shape of every ranked panel (referrers, browsers, systems,\nsizes, locations, languages, campaigns).","properties":{"generated_at":{"description":"See [`SummaryResponse::generated_at`].","type":"string"},"items":{"description":"At most 20 entries, count descending. Possibly empty — a panel\nwith no data in the period is a valid, empty answer.","items":{"$ref":"#/components/schemas/RankedItem"},"type":"array"},"panel":{"description":"The panel name (echoed).","example":"referrers","type":"string"},"period":{"example":"7d","type":"string"}},"required":["panel","period","generated_at","items"],"type":"object"},"SummaryResponse":{"description":"Pageview total and per-day series for a fixed period.","properties":{"days":{"description":"One entry per day of the period, oldest first, gaps zero-filled.","items":{"$ref":"#/components/schemas/DayCount"},"type":"array"},"generated_at":{"description":"RFC 3339 instant the underlying data was fetched from the backend.\nWhile the gateway serves stale data during a backend outage, this\nkeeps naming the original fetch time.","type":"string"},"period":{"description":"The requested period (echoed).","example":"30d","type":"string"},"total":{"description":"Total pageviews in the period.","format":"int64","type":"integer"}},"required":["period","generated_at","total","days"],"type":"object"}}},"info":{"description":"Public, cached stats API in front of a private GoatCounter instance. Data is aggregate pageview statistics only — no visitor data exists here.","license":{"name":"MIT"},"title":"goatcounter-stats-gateway","version":"0.3.2"},"openapi":"3.1.0","paths":{"/api/v1/languages":{"get":{"operationId":"languages","parameters":[{"description":"7d or 30d (default 30d)","in":"query","name":"period","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankedResponse"}}},"description":"Ranked rows, count descending, possibly empty"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unknown period"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Panel disabled by this deployment's policy"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Backend unavailable and nothing cached"}},"tags":[]}},"/api/v1/locations":{"get":{"operationId":"locations","parameters":[{"description":"7d or 30d (default 30d)","in":"query","name":"period","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankedResponse"}}},"description":"Ranked rows, count descending, possibly empty"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unknown period"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Panel disabled by this deployment's policy"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Backend unavailable and nothing cached"}},"tags":[]}},"/api/v1/openapi.json":{"get":{"operationId":"openapi_json","responses":{"200":{"description":"This deployment's contract: the capability document filtered to its enabled panels"}},"tags":[]}},"/api/v1/pages":{"get":{"operationId":"pages","parameters":[{"description":"7d or 30d (default 30d)","in":"query","name":"period","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagesResponse"}}},"description":"Most-viewed pages, count descending"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unknown period"},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Backend unavailable and nothing cached"}},"tags":[]}},"/api/v1/panels":{"get":{"operationId":"panels","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PanelsResponse"}}},"description":"The enabled panels of this deployment"}},"tags":[]}}}}