Geo - BevvyTech/BrewskiDocs GitHub Wiki
| Method | Path | Description |
|---|---|---|
GET |
/geo |
Resolve the requester (or supplied IP) to a country/town using the GeoIP database. |
GET |
/public/regions |
Return the platform’s curated UK region list for group workflows and public UIs. |
- Auth: Bearer token (any authenticated user).
-
Query Parameters:
-
ip(optional, string) – explicit IPv4/IPv6 address to look up. When omitted, the API uses the caller’sx-forwarded-for/x-real-ipheaders or socket address.
-
-
Response 200:
{ "ip": "203.0.113.24", "country": "GB", "region": "Bristol" }-
countryis the ISO 3166-1 alpha‑2 code when available;regionis the best effort subdivision/city label.
-
-
Response 200 (no match):
{ "ip": null, "country": null, "region": null } -
Errors:
-
400– suppliedipis not a valid IPv4/IPv6 literal. -
401– caller not authenticated. -
500– GeoIP lookup failed (e.g., database missing).
-
ℹ️ Ensure
GEOIP_DB_PATHpoints to a readable MaxMind (GeoLite2 City) database for lookups to succeed.
- Auth: None (public).
-
Response 200:
{ "regions": [ { "key": "england", "label": "England" }, { "key": "scotland", "label": "Scotland" }, { "key": "wales", "label": "Wales" }, { "key": "northern-ireland", "label": "Northern Ireland" } ] } - The list is stable and mirrors the top-level regions exposed on the storefront; clients should map sub-region granularity themselves if required.