Free forever · No API key · Open data

The free country data API for developers

countries.dev is a free REST API for country data — ISO codes, flags, currencies, languages, calling codes and capitals — plus 34,000 cities, 12 million places, 1.8 million postal codes and IP geolocation. No API key, no rate limits, no sign-up.

One API

All your geographic data in one place

Countries, cities, places, postal codes and IP geolocation — every endpoint returns clean JSON, free and without a key.

Quick start

One request, no setup

No keys to generate and nothing to install — call an endpoint and parse the JSON.

Get a country by ISO code

curl https://countries.dev/alpha/US

Look up a city

curl https://countries.dev/cities?q=tokyo

Geolocate the caller’s IP

curl https://countries.dev/ip

Resolve a postal code

curl https://countries.dev/postal/US/90210

Why countries.dev

Built to get out of your way

Free forever

No paid tiers, no trials, no surprise bills. Free for production and side projects alike.

No API key

No accounts, tokens or sign-up. Make a request and you get JSON back.

Fast responses

Index-backed queries and aggressive caching keep every endpoint quick.

Comprehensive data

250 countries, 34k cities, 12M places, 1.8M postal codes and IP geolocation.

Clear documentation

Interactive, copy-paste-ready docs for every endpoint and parameter.

Open data

Built on open datasets (GeoNames, CC BY 4.0) so you always know the source.

FAQ

Frequently asked questions

Is countries.dev free?

Yes — completely free. There is no API key, no sign-up and no rate-limit tier. You can use it in production, side projects or class. The underlying data is open (GeoNames, CC BY 4.0).

Do I need an API key?

No. There are no keys, tokens or accounts. Send a request to any endpoint and you get JSON back — that is the whole setup.

What data does the country API return?

For each country you get ISO 3166 codes (alpha-2, alpha-3 and numeric), names and native names, flags (SVG, PNG and emoji), currencies, languages, calling codes, capital, region and subregion, borders, area, population and timezones. Beyond countries there are 34,000 cities, 12 million places, 1.8 million postal codes and IP geolocation.

Is there a rate limit?

There are no per-key quotas. Responses are cached and served quickly, so you can call the API as often as your application needs.

Can I get a user’s country from their IP address?

Yes. GET /ip returns the country for the caller’s IP address with no key required, and you can pass any IP explicitly. See the IP geolocation docs at /docs/api/ip.

Is countries.dev a good alternative to RestCountries?

It is a free, keyless alternative designed to be easy to move to. RestCountries v3 is deprecated and newer versions require sign-up, while countries.dev stays free. See the migration guide at /blog/migrate-from-restcountries.

How do I get a country by its ISO code?

Use GET /alpha/{code} with an alpha-2 or alpha-3 code, for example /alpha/US or /alpha/USA. Full details are in the documentation at /docs/api/alpha.

Start building in seconds

No key, no sign-up — just country, city, place and postal data over a simple REST API.