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.

Guides: Node.js · Python

Try it

Query Parameters

ParameterTypeRequiredDescription
valuestringYesUN/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

FieldTypeDescription
validbooleanWhether the code has valid UN/LOCODE format
foundbooleanWhether the code exists in the UNECE database
locodestringNormalised 5-character code
countrystringISO 3166-1 alpha-2 country code
locationstring3-character location code
namestring | nullLocation name (with diacritics)
nameAsciistring | nullLocation name (ASCII only)
subdivisionstring | nullISO 3166-2 subdivision code
functionsstring[]Location functions: port, rail, road, airport, postal, multimodal, fixed-transport, border-crossing
iatastring | nullIATA code if available
coordinatesstring | nullGeographic 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

ParameterTypeRequiredDescription
countrystringYesISO 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"
  },
  ...
]