A MaxMind GeoLite2 alternative with no database to host

MaxMind GeoLite2 means an account, a license key and a database you download and auto-update. countries.dev gives you IP-to-country over a hosted API — no download, no geoipupdate, no key.

Back

MaxMind GeoLite2 is the go-to free GeoIP database, but using it means signing up for an account, generating a license key, downloading the .mmdb files, and keeping them fresh with geoipupdate. If you only need an IP's country and would rather not host a database, countries.dev does it over a hosted API.

IP → country, over an API

curl https://countries.dev/ip          # the caller's own IP
curl https://countries.dev/ip/8.8.8.8  # any IP
{ "ip": "8.8.8.8", "countryCode": "US", "country": { "name": "United States of America", "flag": "🇺🇸" } }

No database, no account, no key — and the full country record (name, flag, currency, languages) comes back, not just a code. You can POST up to 100 IPs in one call.

When to keep the database

GeoLite2 City gives you city and coordinates, offline and at any volume. countries.dev is country level and online. If you need city-level resolution or fully offline lookups, the database is the right tool. If you need country-level without running geoipupdate on a schedule, the API is simpler.

Switching over

Where you'd open a GeoLite2 reader and read country.iso_code, call GET /ip/{address} and read countryCode.

See the IP geolocation API page for a live demo, or read the docs.

Written by

Dov Azencot

At

Fri Jun 26 2026