countries.dev Blog

The free, open-source country data API.

Get the capital city of any country

Look up a country's capital from its name or ISO code, or find which country a capital belongs to — in one request, with no API key.

Wed Jun 24 2026

A free postal & ZIP code lookup API

Turn a postal or ZIP code into a place name, region and coordinates — 90210 to Beverly Hills, California — in one request. Free, no API key, ~120 countries.

Wed Jun 24 2026

Reverse geocode coordinates to the nearest city

Turn latitude and longitude into the nearest cities — with names, country, population and distance — in one request. Free reverse geocoding, no API key.

Wed Jun 24 2026

Which country owns a domain extension? (.io, .ai, .tv)

Every two-letter domain ending is a country code. Map a ccTLD like .io, .ai or .tv back to its country in one request — or look up a country's TLD. No API key.

Wed Jun 24 2026

A lighter GeoNames alternative for country data

GeoNames needs a username on every request and rate-limits its free server. If you only need country data, countries.dev is keyless and focused.

Tue Jun 23 2026

RestCountries now needs an API key. Here's a free alternative.

RestCountries v3.1 is deprecated and v5 requires an API key, with a 500-request/month free tier. countries.dev is a free, keyless alternative that returns the same country data.

Tue Jun 23 2026

Get a country's bordering countries

List the countries that share a land border with any country — as full records, not just ISO codes. One request, no API key.

Tue Jun 23 2026

Converting between ISO country codes (alpha-2, alpha-3, numeric)

US, USA, and 840 are the same country in three ISO formats. Convert between alpha-2, alpha-3, numeric, and the country name with one request — no API key.

Tue Jun 23 2026

List countries by continent

Get every country in Europe, Asia, Africa and more with one request — plus the one quirk in how "continent" is bucketed, and how to slice finer with subregions.

Tue Jun 23 2026

Country calling codes from an API

Get a country's phone calling code from its ISO code, pull every dialing code at once for a phone input, or find which country a +code belongs to. No API key.

Tue Jun 23 2026

A country flags API (emoji and SVG)

Get a country's flag as a Unicode emoji or an SVG/PNG image from its ISO code — no key, no sprite sheets, no hard-coded asset list.

Tue Jun 23 2026

Country population data from an API

Get a country's population, rank countries by size, or filter to "over 100 million" — in one request, no API key, no scraping a Wikipedia table.

Tue Jun 23 2026

Build a country search autocomplete

A country autocomplete is a substring problem — type "uni" and expect the United-something countries. Here's one built on the free countries.dev API, no key.

Tue Jun 23 2026

How to get a currency from a country code

Turn an ISO country code into its currency code, name, and symbol with one request — or go the other way and list every country on a currency.

Tue Jun 23 2026

Get the languages spoken in a country

Look up a country's languages (with ISO 639 codes) to pick a default locale, or find every country that speaks a given language. No API key.

Tue Jun 23 2026

Migrating from RestCountries to countries.dev

A code-first guide to replacing RestCountries v3.1 or v5 with countries.dev — endpoint-by-endpoint mapping, the response shape, and no API key.

Mon Jun 22 2026

A free IP geolocation API with no key

Most IP geolocation APIs need a token or cap you fast. countries.dev resolves an IP to its full country record over HTTPS — no key, no signup.

Sun Jun 21 2026

Get a list of all countries as JSON

One request returns every country as JSON — names, ISO codes, capitals, currencies, languages and flags. No API key, no CSV wrangling.

Sat Jun 20 2026

How to get a user's country from their IP

Detect a visitor's country from their IP address in one request, with no API key — and get the full country record back, not just a two-letter code.

Fri Jun 19 2026

How to build a country dropdown with flags

A small, dependency-free country select dropdown with flag emojis, built on the free countries.dev API — no API key required.

Thu Jun 18 2026

Introducing countries.dev: a free country API with no key

countries.dev is a free REST API for country data — no API key, no signup, no monthly quota. Here's what's in it and why it exists.

Wed Jun 17 2026