Get a country by ISO alpha code

Returns a single country matching the given ISO 3166-1 alpha-2 or alpha-3 code (case-insensitive).

GET
/alpha/{code}

Returns a single country matching the given ISO 3166-1 alpha-2 or alpha-3 code (case-insensitive).

Path Parameters

code*string

ISO 3166-1 alpha-2 (e.g. IL) or alpha-3 (e.g. ISR) code.

Query Parameters

fields?string

Comma-separated list of top-level fields to include, e.g. name,capital,flag. Overrides the lean default, so you can also request the normally-omitted fields (translations, altSpellings, maps, regionalBlocs). Use fields=full (or full=true) for the complete record.

full?boolean

Country responses are lean by default (they omit the bulky translations, altSpellings, maps and regionalBlocs fields). Set full=true to return the complete record instead.

Response Body

application/json

text/plain

curl -X GET "https://example.com/alpha/ISR?fields=name%2Ccapital%2Cflag&full=true"
{  "name": "Israel",  "topLevelDomain": [    ".il"  ],  "alpha2Code": "IL",  "alpha3Code": "ISR",  "callingCodes": [    "972"  ],  "capital": "Jerusalem",  "altSpellings": [    "string"  ],  "subregion": "Western Asia",  "region": "Asia",  "population": 9216900,  "latlng": [    31.5,    34.75  ],  "demonym": "Israeli",  "area": 20770,  "timezones": [    "UTC+02:00"  ],  "borders": [    "EGY",    "JOR",    "LBN",    "SYR"  ],  "nativeName": "ישראל",  "numericCode": "376",  "flags": {    "svg": "http://example.com",    "png": "http://example.com"  },  "currencies": [    {      "code": "ILS",      "name": "Israeli new shekel",      "symbol": "₪"    }  ],  "languages": [    {      "iso639_1": "he",      "iso639_2": "heb",      "name": "Hebrew",      "nativeName": "עברית"    }  ],  "flag": "🇮🇱",  "maps": {    "googleMaps": "http://example.com",    "openStreetMaps": "http://example.com"  },  "populationDensity": 443.6}
"Country not found"