Geo - BevvyTech/BrewskiDocs GitHub Wiki

Geo Lookup

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.

GET /geo

  • 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’s x-forwarded-for/x-real-ip headers or socket address.
  • Response 200:
    {
      "ip": "203.0.113.24",
      "country": "GB",
      "region": "Bristol"
    }
    • country is the ISO 3166-1 alpha‑2 code when available; region is the best effort subdivision/city label.
  • Response 200 (no match):
    {
      "ip": null,
      "country": null,
      "region": null
    }
  • Errors:
    • 400 – supplied ip is not a valid IPv4/IPv6 literal.
    • 401 – caller not authenticated.
    • 500 – GeoIP lookup failed (e.g., database missing).

ℹ️ Ensure GEOIP_DB_PATH points to a readable MaxMind (GeoLite2 City) database for lookups to succeed.

GET /public/regions

  • 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.
⚠️ **GitHub.com Fallback** ⚠️