---
id: "unlocode"
kind: "datatype"
status: "stable"
is_pii: false
categories: ["geo"]
langs: ["en"]
quality: 90
url: "http://registry.apicrafter.io/datatype/unlocode"
---

# UN/LOCODE (`unlocode`)

N/LOCODE, the United Nations Code for Trade and Transport Locations, is a geographic coding scheme developed and maintained by United Nations Economic Commission for Europe (UNECE). UN/LOCODE assigns codes to locations used in trade and transport with functions such as seaports, rail and road terminals, airports, Postal Exchange Office and border crossing points. The first issue in 1981 contained codes for 8,000 locations. The version from 2011 contained codes for about 82,000 locations.

- Personal data (PII): no
- Categories: Geographic identifiers (geo)
- Countries: global
- Languages: English (en)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^[A-Z]{2} ?[A-Z2-9]{3}$
```

## Examples

- `ITGOA` — Genoa
- `CHGVA` — Geneva

## Mappings

- wikidata: `P1937`

## Metacrafter rules

2 rules: 1 match the field name, 1 match values.

- `unlocodefield` (field, `common/geo.yaml`)
- `unlocodevalue` (data, `common/geo.yaml`)

## Supported by tools

- `metacrafter`

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/UN/LOCODE>
- wikidata: <https://www.wikidata.org/wiki/Property:P1937>

## Quality

Score 90/100. Missing: negative example, translation.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/unlocode.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/geo/unlocode.yaml>
