{"openapi":"3.1.0","info":{"title":"GoatCounter (BYOK) API","version":"0.1.0","description":"GoatCounter (BYOK) lets an AI assistant read your own GoatCounter data through the GoatCounter API with a key you supply (API token (needs the statistics and site read permissions)). Read-only: 8 tools (get_current_user, list_sites, get_site, list_paths, get_total_stats, list_top_pages, list_path_referrers, get_stats_breakdown). The BYOK key travels with each request, is used for that one call...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-goatcounter.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-goatcounter/docs"},"termsOfService":"https://connectorbay.com/byok-goatcounter/terms"},"servers":[{"url":"https://byok-goatcounter.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-goatcounter/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/get_current_user":{"post":{"operationId":"get_current_user","summary":"Show which GoatCounter token and user the key belongs to: token name, permission bitmask and the user's site id. Use for","description":"Show which GoatCounter token and user the key belongs to: token name, permission bitmask and the user's site id. Use for \"Which GoatCounter account does my token belong to\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"site":{"description":"Your GoatCounter site code, the first part of your address: 'mysite' for mysite.goatcounter.com. Letters, digits and hyphens only.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Site","type":"string"}},"required":["site"],"title":"get_current_userArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_sites":{"post":{"operationId":"list_sites","summary":"List the GoatCounter sites the token can see: id, code, custom domain, state, creation and first hit time and whether da","description":"List the GoatCounter sites the token can see: id, code, custom domain, state, creation and first hit time and whether data was received. Use for \"Which GoatCounter sites do I have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"site":{"description":"Your GoatCounter site code, the first part of your address: 'mysite' for mysite.goatcounter.com. Letters, digits and hyphens only.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Site","type":"string"}},"required":["site"],"title":"list_sitesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_site":{"post":{"operationId":"get_site","summary":"Get one GoatCounter site by numeric id: code, custom domain, state, dates and whether data has been received. Use for \"S","description":"Get one GoatCounter site by numeric id: code, custom domain, state, dates and whether data has been received. Use for \"Show GoatCounter site 1\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"site":{"description":"Your GoatCounter site code, the first part of your address: 'mysite' for mysite.goatcounter.com. Letters, digits and hyphens only.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Site","type":"string"},"site_id":{"description":"Numeric site id from list_sites, for example 1.","maximum":1000000000,"minimum":1,"title":"Site Id","type":"integer"}},"required":["site","site_id"],"title":"get_siteArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_paths":{"post":{"operationId":"list_paths","summary":"List the tracked paths (pages and events) of the site without statistics, sorted by path id. Page with 'after'. Use for ","description":"List the tracked paths (pages and events) of the site without statistics, sorted by path id. Page with 'after'. Use for \"Which page paths does GoatCounter track on my site\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"site":{"description":"Your GoatCounter site code, the first part of your address: 'mysite' for mysite.goatcounter.com. Letters, digits and hyphens only.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Site","type":"string"},"limit":{"anyOf":[{"maximum":200,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"Maximum number of paths (1 to 200; default 20).","title":"Limit"},"after":{"anyOf":[{"maximum":1000000000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Only paths with an id greater than this; use the last id of the previous page.","title":"After"}},"required":["site"],"title":"list_pathsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_total_stats":{"post":{"operationId":"get_total_stats","summary":"Count total page views and events of the site in a period, with the unique-visitor total and a per-day series. Use for \"","description":"Count total page views and events of the site in a period, with the unique-visitor total and a per-day series. Use for \"How many page views did my site get in the last week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"site":{"description":"Your GoatCounter site code, the first part of your address: 'mysite' for mysite.goatcounter.com. Letters, digits and hyphens only.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Site","type":"string"},"start":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Start of the period as an ISO 8601 / RFC 3339 time rounded to the hour, for example 2026-10-01T00:00:00Z. Default: one week ago.","title":"Start"},"end":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"End of the period as an ISO 8601 / RFC 3339 time rounded to the hour. Default: now.","title":"End"}},"required":["site"],"title":"get_total_statsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_top_pages":{"post":{"operationId":"list_top_pages","summary":"List pages by visitors in a period (sorted by count) with path id, title and visitor count. Page with limit and exclude_","description":"List pages by visitors in a period (sorted by count) with path id, title and visitor count. Page with limit and exclude_paths. Use for \"What are my most visited pages on GoatCounter this week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"site":{"description":"Your GoatCounter site code, the first part of your address: 'mysite' for mysite.goatcounter.com. Letters, digits and hyphens only.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Site","type":"string"},"start":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Start of the period as an ISO 8601 / RFC 3339 time rounded to the hour, for example 2026-10-01T00:00:00Z. Default: one week ago.","title":"Start"},"end":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"End of the period as an ISO 8601 / RFC 3339 time rounded to the hour. Default: now.","title":"End"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"Maximum number of rows to return (1 to 100; default 20).","title":"Limit"},"exclude_paths":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated path ids to leave out, used to page through results (pass the ids already received).","title":"Exclude Paths"}},"required":["site"],"title":"list_top_pagesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_path_referrers":{"post":{"operationId":"list_path_referrers","summary":"List where visitors of one page came from in a period, with referrer name and count. Use for \"Where do visitors to my pa","description":"List where visitors of one page came from in a period, with referrer name and count. Use for \"Where do visitors to my path id 1 come from\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"site":{"description":"Your GoatCounter site code, the first part of your address: 'mysite' for mysite.goatcounter.com. Letters, digits and hyphens only.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Site","type":"string"},"path_id":{"description":"Numeric path id from list_paths or list_top_pages, for example 1.","maximum":1000000000000,"minimum":1,"title":"Path Id","type":"integer"},"start":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Start of the period as an ISO 8601 / RFC 3339 time rounded to the hour, for example 2026-10-01T00:00:00Z. Default: one week ago.","title":"Start"},"end":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"End of the period as an ISO 8601 / RFC 3339 time rounded to the hour. Default: now.","title":"End"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"Maximum number of rows to return (1 to 100; default 20).","title":"Limit"},"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of rows to skip, for paging when 'more' is true.","title":"Offset"}},"required":["site","path_id"],"title":"list_path_referrersArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_stats_breakdown":{"post":{"operationId":"get_stats_breakdown","summary":"Break site visitors down by one dimension in a period: browsers, systems, locations, languages, screen sizes, campaigns ","description":"Break site visitors down by one dimension in a period: browsers, systems, locations, languages, screen sizes, campaigns or top referrers, with counts. Use for \"Which browsers do my visitors use\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"site":{"description":"Your GoatCounter site code, the first part of your address: 'mysite' for mysite.goatcounter.com. Letters, digits and hyphens only.","maxLength":200,"pattern":"^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$","title":"Site","type":"string"},"page":{"description":"Dimension: browsers, systems, locations, languages, sizes, campaigns or toprefs.","enum":["browsers","systems","locations","languages","sizes","campaigns","toprefs"],"title":"Page","type":"string"},"start":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Start of the period as an ISO 8601 / RFC 3339 time rounded to the hour, for example 2026-10-01T00:00:00Z. Default: one week ago.","title":"Start"},"end":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"End of the period as an ISO 8601 / RFC 3339 time rounded to the hour. Default: now.","title":"End"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"Maximum number of rows to return (1 to 100; default 20).","title":"Limit"},"offset":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Number of rows to skip, for paging when 'more' is true.","title":"Offset"}},"required":["site","page"],"title":"get_stats_breakdownArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}