A free, no-token ipinfo alternative for IP-to-country

Need a country from an IP without signing up for a token? countries.dev resolves any IP to its country — free, keyless and CORS-friendly — and returns the full country record.

Back

ipinfo.io is a solid IP data service — city, ASN and privacy detection — but the useful parts need a token, a sign-up and a paid plan past the free tier. If all you need is the country of an IP, countries.dev does that for free, with no token at all.

IP → country, no token

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 key, no sign-up; CORS is open for browser calls. You also get the full country record attached — name, flag, currencies, languages, calling code, region — so there's no second lookup to turn a code into something useful.

Batch up to 100

curl -X POST https://countries.dev/ip -d '["8.8.8.8","1.1.1.1"]'

Being straight about scope

countries.dev resolves to country level — not city or region — and it doesn't do ASN lookups or VPN/proxy detection. If you need those, ipinfo (or a similar paid service) is the right tool. For country-level geolocation — localization, geo-routing, compliance, analytics — countries.dev covers it without a key.

Switching over

ipinfo returns country: "US"; countries.dev returns countryCode: "US" plus the country object. Rename the field and you're set.

Try the IP geolocation API live, read the docs, or see how to get a user's country from their IP.

Written by

Dov Azencot

At

Fri Jun 26 2026