Countries
Every ISO 3166-1 entity with its alpha-2, alpha-3, and numeric codes, plus capital, region, currency code, calling code, official languages, flag emoji, and country-code top-level domain. Use for country pickers, locale routing, fraud-rule geo lookups, and anywhere your code needs a stable identifier for a country.
Quick fetch
Stable, immutable URL. CORS-enabled. No auth.
curl https://staticdata.dev/v1/countries.json
Or use as a typed import:
import { countries } from "https://staticdata.dev/v1/countries.ts"
Formats
- JSON 74.3 KB
/v1/countries.json
min: 53.9 KB 路 /v1/countries.min.json
- CSV 20.7 KB
/v1/countries.csv
- TypeScript 74.5 KB
/v1/countries.ts
export const countries
type Country = (typeof countries)[number]
Schema
Each record in the dataset has the following shape.
| Field | Type | Description | Example |
|---|---|---|---|
| alpha2 | string | ISO 3166-1 alpha-2 code | US |
| alpha3 | string | ISO 3166-1 alpha-3 code | USA |
| numeric | string | ISO 3166-1 numeric code (zero-padded) | 840 |
| name | string | English short name | United States |
| officialName | string | Official long-form name | United States of America |
| capital? | string | null | Capital city (null for entities with no defined capital) | Washington, D.C. |
| region | string | UN M.49 region | Americas |
| subregion | string | UN M.49 subregion | Northern America |
| currency? | string | null | ISO 4217 currency code in primary use | USD |
| callingCode | string | Country calling code with leading + | +1 |
| languages | string[] | ISO 639-1 codes of official or de facto languages | ["en"] |
| flag | string | Flag as Unicode regional indicator emoji | 馃嚭馃嚫 |
| tld | string | Country-code top-level domain | .us |
Preview
First 10 records.
| alpha2 | alpha3 | numeric | name | officialName | capital |
|---|---|---|---|---|---|
| AD | AND | 020 | Andorra | Principality of Andorra | Andorra la Vella |
| AE | ARE | 784 | United Arab Emirates | United Arab Emirates | Abu Dhabi |
| AF | AFG | 004 | Afghanistan | Islamic Emirate of Afghanistan | Kabul |
| AG | ATG | 028 | Antigua and Barbuda | Antigua and Barbuda | Saint John's |
| AI | AIA | 660 | Anguilla | Anguilla | The Valley |
| AL | ALB | 008 | Albania | Republic of Albania | Tirana |
| AM | ARM | 051 | Armenia | Republic of Armenia | Yerevan |
| AO | AGO | 024 | Angola | Republic of Angola | Luanda |
| AQ | ATA | 010 | Antarctica | Antarctica | |
| AR | ARG | 032 | Argentina | Argentine Republic | Buenos Aires |
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/countries.json | jq '.[0]' import type { Country } from "https://staticdata.dev/v1/countries.ts";
const res = await fetch("https://staticdata.dev/v1/countries.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const countries: Country[] = await res.json();
console.log(countries[0]); import urllib.request, json
with urllib.request.urlopen("https://staticdata.dev/v1/countries.min.json") as r:
countries = json.load(r)
print(countries[0]) package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://staticdata.dev/v1/countries.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/countries.min.json").call()?.into_string()?;
let data: Vec<Value> = serde_json::from_str(&body)?;
println!("{:?}", data.first());
Ok(())
} Sources and methodology
The dataset covers UN-recognised states, observer states (Vatican City, Palestine), and the dependent territories that have their own ISO 3166-1 codes. It does not include subnational entities, historical codes, or user-assigned codes.
Names follow ISO 3166-1 short forms in English. Where a country has changed its name (T眉rkiye, Eswatini, Czechia, Cabo Verde) we use the current ISO name. The officialName is the long-form constitutional name.
Calling codes follow ITU-T E.164. For territories sharing a parent country code we keep the shared code (+1 for the United States and Canada) and disambiguate with extended prefixes only where they are ITU-assigned (+1-787 for Puerto Rico).
Currencies are the primary ISO 4217 code used domestically; see the currencies dataset for the full mapping including secondary currencies.
The dataset is updated when ISO 3166-1 publishes a change (typically a few times per year). Each update gets a new version field, and the previous version remains live forever under its versioned /v1/ URL.
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
countries changelog for this dataset's history.