UN LOCODE Ports Airports Logistics Locations API
Free tier included · LogisticsUN/LOCODE API gives logistics platforms, freight forwarders, and trade applications instant access to global transport and trade locations. It covers over 116,000 official UNECE trade points including sea ports, rail terminals, road hubs, airports, and postal exchanges. Beyond standard UNECE lookups and radius searches, this API features built-in **IATA airport code resolution** (`/iata/{code}`) and **coordinate format conversion** (`/convert` for DMS, UTM, MGRS, and Plus Codes), matching and exceeding the capabilities of leading market alternatives while providing significantly higher monthly quotas at a lower price point.
Whether you need to validate a shipping location by its UN/LOCODE code (e.g. `USLAX`), search for ports and terminals by name with ISO country and transport function filters, or find logistics hubs within a radius of geographic coordinates using great-circle (haversine) distance, this API handles it with sub-millisecond local SQLite lookups.
Honest limits: All queries operate against an offline UNECE snapshot (ODC-PDDL license). Search queries require at least 2 characters and return up to 200 results per call. Radius searches are capped at 500 km, and coordinate lookups or code lookups ignore surrounding whitespace and are case-insensitive.
Endpoints
| Method | Path | What it does |
|---|---|---|
GET | / | API metadata: human-readable name, version, and paths to interactive docs and health check. |
GET | /health | Liveness probe; returns status "ok" when the service is up. |
GET | /meta | Returns snapshot metadata (record count, build date, license) alongside function codes and status code dictionaries. |
GET | /lookup | Look up a single UN/LOCODE record by its full code (e.g. USLAX). Spaces and case are ignored. |
GET | /search | Search locations by name (case-insensitive substring) with optional country and transport function filters. |
GET | /country | List UN/LOCODE locations of a specific country ordered by name. |
GET | /nearby | Find transport locations within a radius of geographic coordinates using great-circle distance. |
GET | /iata/{code} | Resolve a 3-letter IATA airport code into its corresponding UN/LOCODE record. |
GET | /convert | Convert decimal latitude and longitude coordinates into DMS, UTM, MGRS, or Plus Code formats. |
Quick start
curl -X GET "https://locode.p.rapidapi.com/meta" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-H "X-RapidAPI-Host: locode.p.rapidapi.com"
FAQ
Where does the UN/LOCODE data come from?
Data is powered by a local UNECE snapshot under the ODC-PDDL license, covering over 116,000 global trade and transport locations.
Can I resolve IATA airport codes directly?
Yes! Use the `/iata/{code}` endpoint to instantly translate 3-letter airport codes like LAX or HAM into full UN/LOCODE records.
How does the nearby search calculate distances?
The `/nearby` endpoint uses great-circle (haversine) distance calculations with proper bounding box scans that handle polar regions and the antimeridian correctly.
Are my queries logged or shared?
No. All requests are processed entirely offline and statelessly with no request logging or data retention.
Try UN LOCODE Ports Airports Logistics Locations free
Free tier on every plan. Get an API key and start calling in under a minute.
Open on RapidAPI