GET /alpha/{code}

restcountries.com:rest-countries-api

Summary: Get country by code
Operation ID: getCountryByCode
Auth: none

Get a single country by its ISO 3166-1 alpha code. Accepts both 2-letter (cca2) codes like "US" and 3-letter (cca3) codes like "USA". This is the fastest way to retrieve a specific country when you know its standard country code. Returns an array with one country object.

Original spec description

Get a country by its ISO 3166-1 alpha-2, alpha-3, or numeric code.

Usage Tips

- Accepts 2-letter (cca2) or 3-letter (cca3) codes: "us", "US", "USA" all work - Case-insensitive - Returns array with single item, not a direct object - Use /alpha (plural) endpoint with codes param for multiple countries

Parameters (2)

code (string, path, required)

ISO country code (cca2, ccn3, cca3, or cioc)

fields (string, query, optional)

Comma-separated list of fields to include (max 10 fields)

Examples (5)

TitleTypeURLAction
Get by country code openapi-spec https://restcountries.com/v3.1/alpha/us
Search by country code openapi-spec https://restcountries.com/v3.1/alpha/DEU
Get country by alpha code openapi-spec https://restcountries.com/v3/alpha/de
Get country by code openapi-spec https://restcountries.com/v3.1/alpha/de?fields=name,capital,flags
Get country by code probe-gate https://restcountries.com/v3.1/alpha/de?fields=name%2Ccapital%2Cflags

Probe History

Latency

Status Codes

TimeStatusLatencySize
2026-03-23 09:41:40.107895 200 316ms
2026-03-23 09:37:28.743763 200 318ms
2026-03-23 09:30:09.451383 200 314ms
2026-03-23 09:12:26.272380 200 319ms
2026-03-23 09:08:37.199224 200 319ms
2026-03-20T02:21:07.229983 200 357ms

Response Changes

WhenOldNew
2026-03-23 09:08:37.199224 6ae0deeeb5b8 ba24fff20123
2026-03-23 09:12:26.272380 ba24fff20123 6ae0deeeb5b8
2026-03-23 09:30:09.451383 6ae0deeeb5b8 69e9abd87283
2026-03-23 09:37:28.743763 69e9abd87283 ce04c6067285
2026-03-23 09:41:40.107895 ce04c6067285 6ae0deeeb5b8