Country

GET/v0/country

Validates a country code against the ISO 3166-1 standard. The format is detected automatically from the input: two letters are treated as alpha-2, three letters as alpha-3, and one to three digits as the numeric code (leading zeros are optional). When valid, the response includes all three code representations and the English country name.

Try it

Query Parameters

ParameterTypeRequiredDescription
valuestringYesThe country code to validate. Accepted formats: PL (alpha-2), POL (alpha-3), 616 (numeric)

Example Requests

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/country?value=PL"

Response Fields

FieldTypeDescription
validbooleanWhether the code is a recognised ISO 3166-1 country code
valuestringThe normalised (uppercased) input value
formatstringDetected input format: alpha-2, alpha-3, or numeric
alpha2stringISO 3166-1 alpha-2 code (e.g. PL)
alpha3stringISO 3166-1 alpha-3 code (e.g. POL)
numericstringISO 3166-1 numeric code, zero-padded to 3 digits (e.g. 616)
namestringFull English country name (e.g. Poland)

Example Response

{
  "valid": true,
  "value": "PL",
  "format": "alpha-2",
  "alpha2": "PL",
  "alpha3": "POL",
  "numeric": "616",
  "name": "Poland"
}
GET/v0/country/list

Returns the complete list of all 249 ISO 3166-1 countries, sorted alphabetically by English name. Useful for populating country selectors in forms.

Example Request

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/country/list"

Response

An array of objects, one per country, sorted alphabetically by name.

FieldTypeDescription
alpha2stringISO 3166-1 alpha-2 code
alpha3stringISO 3166-1 alpha-3 code
numericstringISO 3166-1 numeric code, zero-padded to 3 digits
namestringFull English country name

Example Response

[
  { "alpha2": "AF", "alpha3": "AFG", "numeric": "004", "name": "Afghanistan" },
  { "alpha2": "AX", "alpha3": "ALA", "numeric": "248", "name": "Åland Islands" },
  { "alpha2": "AL", "alpha3": "ALB", "numeric": "008", "name": "Albania" },
  ...
]