Language Codes
ISO 639-1 (alpha-2), 639-2 (alpha-3 terminological and bibliographic), the language's English name and native name, the dominant writing script, and writing direction. Use for language pickers, lang attributes on HTML, RTL detection, and content negotiation.
Quick fetch
Stable, immutable URL. CORS-enabled. No auth.
curl https://staticdata.dev/v1/language-codes.json
Or use as a typed import:
import { languageCodes } from "https://staticdata.dev/v1/language-codes.ts"
Formats
- JSON 24.6 KB
/v1/language-codes.json
min: 17.9 KB · /v1/language-codes.min.json
- CSV 6.2 KB
/v1/language-codes.csv
- TypeScript 24.8 KB
/v1/language-codes.ts
export const languageCodes
type LanguageCode = (typeof languageCodes)[number]
Schema
Each record in the dataset has the following shape.
| Field | Type | Description | Example |
|---|---|---|---|
| alpha2 | string | ISO 639-1 alpha-2 code | en |
| alpha3T | string | ISO 639-2/T (terminological) alpha-3 code | eng |
| alpha3B | string | ISO 639-2/B (bibliographic) alpha-3 code | eng |
| name | string | English name | English |
| nativeName | string | Native name | English |
| script | string | Primary writing script | Latin |
| direction | "ltr" | "rtl" | Writing direction | ltr |
Preview
First 10 records.
| alpha2 | alpha3T | alpha3B | name | nativeName | script |
|---|---|---|---|---|---|
| aa | aar | aar | Afar | Afaraf | Latin |
| ab | abk | abk | Abkhazian | Аҧсуа | Cyrillic |
| af | afr | afr | Afrikaans | Afrikaans | Latin |
| ak | aka | aka | Akan | Akan | Latin |
| am | amh | amh | Amharic | አማርኛ | Ethiopic |
| ar | ara | ara | Arabic | العربية | Arabic |
| as | asm | asm | Assamese | অসমীয়া | Bengali |
| ay | aym | aym | Aymara | Aymar aru | Latin |
| az | aze | aze | Azerbaijani | Azərbaycan dili | Latin |
| ba | bak | bak | Bashkir | Башҡорт теле | Cyrillic |
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/language-codes.json | jq '.[0]' import type { LanguageCode } from "https://staticdata.dev/v1/language-codes.ts";
const res = await fetch("https://staticdata.dev/v1/language-codes.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const languageCodes: LanguageCode[] = await res.json();
console.log(languageCodes[0]); import urllib.request, json
with urllib.request.urlopen("https://staticdata.dev/v1/language-codes.min.json") as r:
languageCodes = json.load(r)
print(languageCodes[0]) package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://staticdata.dev/v1/language-codes.min.json")
if err != nil { panic(err) }
defer resp.Body.Close()
var data []map[string]any
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
panic(err)
}
fmt.Println(data[0])
} use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let body = ureq::get("https://staticdata.dev/v1/language-codes.min.json").call()?.into_string()?;
let data: Vec<Value> = serde_json::from_str(&body)?;
println!("{:?}", data.first());
Ok(())
} Sources and methodology
The dataset covers languages with an ISO 639-1 alpha-2 assignment. ISO 639-3 codes (the most exhaustive list) are not included here.
For most languages the terminological (alpha3T) and bibliographic (alpha3B) codes are identical. They differ for a small number of languages with separate library-cataloguing traditions (German has deu/ger, French has fra/fre, Greek has ell/gre, etc.). Use alpha3T unless you specifically need the bibliographic variant.
Direction is rtl for Arabic, Hebrew, Persian, Urdu, Pashto, Yiddish, Divehi, Hausa, and Uyghur. All others are ltr in their dominant script.
Native names use the language’s preferred script.
Versioning
URLs under /v1/ are immutable. The data they return will not change in a way
that breaks consumers. Schema-incompatible updates ship under a new version path. See the
language-codes changelog for this dataset's history.