staticdata.dev
Menu
Datasets About Contact

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.

v1.0.0 MIT 212 records Updated 2026-04-25 stable Source:  ISO 3166-1, REST Countries (CC0 fork)

Quick fetch

Stable, immutable URL. CORS-enabled. No auth.

bash
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

    Open

    min: 53.9 KB 路 /v1/countries.min.json

  • CSV 20.7 KB

    /v1/countries.csv

    Open
  • TypeScript 74.5 KB

    /v1/countries.ts

    export const countries

    type Country = (typeof countries)[number]

    Open

Schema

Each record in the dataset has the following shape.

Schema
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.

Data preview
alpha2alpha3numericnameofficialNamecapital
ADAND020AndorraPrincipality of AndorraAndorra la Vella
AEARE784United Arab EmiratesUnited Arab EmiratesAbu Dhabi
AFAFG004AfghanistanIslamic Emirate of AfghanistanKabul
AGATG028Antigua and BarbudaAntigua and BarbudaSaint John's
AIAIA660AnguillaAnguillaThe Valley
ALALB008AlbaniaRepublic of AlbaniaTirana
AMARM051ArmeniaRepublic of ArmeniaYerevan
AOAGO024AngolaRepublic of AngolaLuanda
AQATA010AntarcticaAntarctica
ARARG032ArgentinaArgentine RepublicBuenos Aires

Showing 10 of 212. View full data:  JSON 路 CSV

Fetch examples

Drop-in snippets in five languages.

curl
curl -sSL https://staticdata.dev/v1/countries.json | jq '.[0]'
JavaScript
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]);
Python
import urllib.request, json

with urllib.request.urlopen("https://staticdata.dev/v1/countries.min.json") as r:
    countries = json.load(r)

print(countries[0])
Go
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])
}
Rust
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.

Related datasets