geo
Public GeoIP lookup endpoints for country and city-level detection.
| Field | Value |
|---|
| Serverless service | drive-api-geo |
| Runtime | nodejs22.x, arm64 |
| Region | ap-southeast-2 |
| Deployed HTTP operations | 2 |
| Local worker harnesses | 0 |
| OpenAPI | /openapi/geo.yaml · interactive |
Deployed routes
| Method | Path | Auth | Summary |
|---|
| GET | /geo/country | Public | Caller country from CloudFront viewer header |
| GET | /geo/city | Public | City-level GeoIP lookup (MaxMind) |
Behaviour notes
/geo/country reads the CloudFront-Viewer-Country header and returns {country}; missing header returns {}.
/geo/city resolves IP from ip, X-Forwarded-For, or API Gateway sourceIp, then looks up MaxMind city data.
- Local/private IPv4 ranges are rejected with
400.
- The city route returns state, city, postcode, latitude, longitude, accuracy radius, and timezone when MaxMind data is available.
Source map
- services/geo/serverless.yml
- services/geo/functions/geoDetectionCountry.ts
- services/geo/functions/geoDetectionCity.ts
- data/GeoLite2-City/