Skip to main content

Setup

Put them in your environment or .env; Data APIs covers the other ways.

Notes

  • GeoIP2 calls spend prepaid service credits (402 INSUFFICIENT_FUNDS when they run out); the response’s maxmind.queries_remaining shows the approximate balance. GeoLite calls are free with a daily query limit, and the same 402 means that limit is reached.
  • Use ‘me’ as the IP to look up the caller’s own address. Reserved or private addresses return 400 IP_ADDRESS_RESERVED; an address not in the data returns 404.
  • Many error responses in a row can get the account rate-limited (429).

Endpoints

Get an IP’s country (GeoIP2 Country)

Geolocate an IP to city level (GeoIP2 City Plus)

Get an IP’s full profile (GeoIP2 Insights)

  • Anonymizer flags appear only when true; a missing key means false.

Get an IP’s country (free GeoLite)

Geolocate an IP to city level (free GeoLite)