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
| Parameter | Type | Required | Description |
|---|---|---|---|
| value | string | Yes | The 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
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the code is a recognised ISO 3166-1 country code |
| value | string | The normalised (uppercased) input value |
| format | string | Detected input format: alpha-2, alpha-3, or numeric |
| alpha2 | string | ISO 3166-1 alpha-2 code (e.g. PL) |
| alpha3 | string | ISO 3166-1 alpha-3 code (e.g. POL) |
| numeric | string | ISO 3166-1 numeric code, zero-padded to 3 digits (e.g. 616) |
| name | string | Full 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.
| Field | Type | Description |
|---|---|---|
| alpha2 | string | ISO 3166-1 alpha-2 code |
| alpha3 | string | ISO 3166-1 alpha-3 code |
| numeric | string | ISO 3166-1 numeric code, zero-padded to 3 digits |
| name | string | Full 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" },
...
]