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.

Back

When you're localizing, you often need the other direction of the usual question: not "what country is this user in" but "what languages does that country use" — so you can default a locale or offer the right translations.

Country → languages

/alpha/{code} returns a languages array with ISO 639-1 and 639-2 codes:

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

Switzerland comes back with German, French, Italian, and Romansh:

{ "name": "Switzerland", "languages": [
  { "iso639_1": "de", "name": "German" },
  { "iso639_1": "fr", "name": "French" },
  { "iso639_1": "it", "name": "Italian" },
  { "iso639_1": "rm", "name": "Romansh" }
] }

The iso639_1 code is the one you'll usually hand to an i18n library:

const c = await fetch("https://countries.dev/alpha/CH").then((r) => r.json());
const locales = c.languages.map((l) => l.iso639_1); // ["de","fr","it","rm"]

Language → countries

Flip it to find everywhere a language is used:

curl https://countries.dev/lang/fr

One honest note: this is the set of languages associated with each country, not a ranked official-vs-minority breakdown. It's the right input for "pick a sensible default," not for anything that needs legal language status.

Language endpoint docs →

Written by

Dov Azencot

At

Tue Jun 23 2026