UN-LOCODE Codelist

878,895
0
Updated:
Files:6
Size:7.43 MB
Formats:csv
License:ODC-PDDL-1.0

The United Nations Code for Trade and Transport Locations is a code list mantained by UNECE, United Nations agency, to facilitate trade. Data comes from the UNECE page, released at least once a yea...

API Access

Access dataset files directly from scripts, code, or AI agents.

Browse dataset files
Dataset Files

Each file has a stable URL (r-link) that you can use directly in scripts, apps, or AI agents. These URLs are permanent and safe to hardcode.

/core/un-locode/
https://datahub.io/core/un-locode/_r/-/.gitignore
https://datahub.io/core/un-locode/_r/-/Makefile
https://datahub.io/core/un-locode/_r/-/README.md
https://datahub.io/core/un-locode/_r/-/UPDATE_SCRIPT_MAINTENANCE_REPORT.md
https://datahub.io/core/un-locode/_r/-/data/alias.csv
https://datahub.io/core/un-locode/_r/-/data/code-list.csv
https://datahub.io/core/un-locode/_r/-/data/country-codes.csv
https://datahub.io/core/un-locode/_r/-/data/function-classifiers.csv
https://datahub.io/core/un-locode/_r/-/data/status-indicators.csv
https://datahub.io/core/un-locode/_r/-/data/subdivision-codes.csv
https://datahub.io/core/un-locode/_r/-/datapackage.json
Key Files

Start with these files — they give you everything you need to understand and access the dataset.

datapackage.jsonmetadata & schema
https://datahub.io/core/un-locode/_r/-/datapackage.json
README.mddocumentation
https://datahub.io/core/un-locode/_r/-/README.md
Typical Usage
  1. 1. Fetch datapackage.json to inspect schema and resources
  2. 2. Download data resources listed in datapackage.json
  3. 3. Read README.md for full context

Data Files

Explore with AI

code-list

Download

Download CSV

About

Main UN/LOCODE codelist. Each row is a location entry identified by a 2-letter country code and a 3-character location code. Rows with an empty Location field are country-name header rows or alias rows and are excluded from this file.
Last updated
12 May 2026
Total rows
...
Format
CSV
File size
7.29 MB

country-codes

Download

Download CSV

About

Lookup table mapping ISO 3166 alpha-2 country codes to country names, as used in the UN/LOCODE codelist.
Last updated
12 May 2026
Total rows
...
Format
CSV
File size
3.94 kB

function-classifiers

Download

Download CSV

About

Lookup table defining the meaning of each position in the Function field of the code-list. Each code corresponds to a transport or logistics function.
Last updated
12 May 2026
Total rows
...
Format
CSV
File size
562 B

status-indicators

Download

Download CSV

About

Lookup table defining the meaning of the Status field in the code-list. Status codes indicate the approval or verification level of each location entry.
Last updated
12 May 2026
Total rows
...
Format
CSV
File size
794 B

subdivision-codes

Download

Download CSV

About

Lookup table of ISO 3166-2 subdivision codes (states, provinces, regions, etc.) referenced by the Subdivision field of the code-list.
Last updated
12 May 2026
Total rows
...
Format
CSV
File size
133 kB

alias

Download

Download CSV

About

Alternative names (aliases) for countries, extracted from UN/LOCODE source files. These are rows in the source data with Change code '=' and no location code.
Last updated
12 May 2026
Total rows
...
Format
CSV
File size
2.73 kB

About this dataset

badge

The United Nations Code for Trade and Transport Locations is a code list maintained by UNECE, United Nations agency, to facilitate trade.

Data

Data comes from the UNECE UN/LOCODE Download page, released at least once a year.

Updating the data

When UNECE publishes a new edition, update the data by running the pipeline locally and committing the result.

Install the required tools (macOS):

brew install mdbtools csvkit gawk
pip install -r scripts/requirements.txt

Download the latest edition from https://unece.org/trade/cefact/UNLOCODE-Download — click the Download link on the new release row. Extract the zip into a release/ folder in the repo root so it has this structure:

release/
  UNLOCODE CodeList.mdb
  csv/
    SubdivisionCodes.csv
    UNLOCODE CodeListPart1.csv
    UNLOCODE CodeListPart2.csv
    UNLOCODE CodeListPart3.csv

Note: the scripts assume this folder structure and file naming. If UNECE changes the release packaging in a future edition, the scripts may need to be adjusted before running.

Then run:

make

Then commit the updated files:

git add data/
git commit -m "Update to edition YYYY-N"
git push

License

All data is licensed under the ODC Public Domain Dedication and Licence (PDDL).