UN/LOCODE
GET/v0/locode
Validates a UN/LOCODE (United Nations Code for Trade and Transport Locations). Codes consist of a 2-letter country code + 3-character location code (e.g. PLWAW for Warsaw, Poland). Returns the location name, subdivision, functions (port, airport, rail, etc.), and IATA code if available.
Try it
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| value | string | Yes | UN/LOCODE to validate (e.g. PLWAW, DEHAM, USNYC) |
Example Requests
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.isvalid.dev/v0/locode?value=PLWAW"
Response Fields
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the code has valid UN/LOCODE format |
| found | boolean | Whether the code exists in the UNECE database |
| locode | string | Normalised 5-character code |
| country | string | ISO 3166-1 alpha-2 country code |
| location | string | 3-character location code |
| name | string | null | Location name (with diacritics) |
| nameAscii | string | null | Location name (ASCII only) |
| subdivision | string | null | ISO 3166-2 subdivision code |
| functions | string[] | Location functions: port, rail, road, airport, postal, multimodal, fixed-transport, border-crossing |
| iata | string | null | IATA code if available |
| coordinates | string | null | Geographic coordinates (UNECE format) |
Example Response
{
"valid": true,
"found": true,
"locode": "PLWAW",
"country": "PL",
"location": "WAW",
"name": "Warszawa",
"nameAscii": "Warszawa",
"subdivision": "14",
"functions": ["rail", "road", "airport", "postal"],
"iata": "WAW",
"coordinates": "5215N 02100E"
}Example Response — invalid
{
"valid": false
}GET/v0/locode/list
Returns all UN/LOCODE entries for a given country. The country parameter is required.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| country | string | Yes | ISO 3166-1 alpha-2 country code (e.g. PL, DE, US) |
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.isvalid.dev/v0/locode/list?country=PL"
Example Response
[
{
"locode": "PLGDN",
"country": "PL",
"location": "GDN",
"name": "Gdańsk",
"nameAscii": "Gdansk",
"subdivision": "22",
"functions": ["port", "rail", "road", "airport", "postal"],
"iata": "GDN",
"coordinates": "5422N 01838E"
},
...
]