Unlocoder
Coordinate conversion and enriched UN/LOCODE API.
Convert between DD, DMS, UTM, MGRS, and Plus Code. Look up any UN/LOCODE
for timezone, coordinates, elevation, IATA codes, and nearby locations.
Web App ·
API on RapidAPI ·
MCP ·
Quickstart ·
API Reference
What is Unlocoder?
Unlocoder is a coordinate conversion tool and one of the few UN/LOCODE APIs available online. Convert any coordinate format instantly, or look up any of 114,000+ UN/LOCODEs for timezone, elevation, IATA codes, function codes, and nearby location data.
Web converter - free, no sign-up, no ads: unlocoder.com
REST API - programmatic access via RapidAPI
MCP Server - give AI agents coordinate conversion and UN/LOCODE lookup capabilities, available via RapidAPI MCP
| Format |
Example |
| Decimal Degrees (DD) |
51.5074, -0.1278 |
| Degrees Minutes Seconds (DMS) |
51°30'26.64"N 0°7'40.08"W |
| Degrees Decimal Minutes (DDM) |
51°30.444'N 0°7.668'W |
| Universal Transverse Mercator (UTM) |
30U 699375 5710099 |
| Military Grid Reference (MGRS) |
30UXC9937510099 |
| Google Plus Codes |
9C3XGV4C+HQ |
| UN/LOCODE |
GBLON |
Key Features
- Auto-detection - paste any format, the system identifies it
- Configurable precision - 4 to 10 decimal places
- UN/LOCODE enrichment - timezone, UTC offset, local time, elevation, IATA codes, function codes, and status
- Nearby UN/LOCODE search - find the closest ports/locations to any coordinate
- MCP support - connect AI agents (Claude, GPT, etc.) to Unlocoder as a tool via the Model Context Protocol
What is a UN/LOCODE?
A UN/LOCODE (United Nations Code for Trade and Transport Locations) is a five-character code that identifies ports, airports, inland freight terminals, and other trade-relevant locations worldwide. Maintained by UNECE, the directory contains over 114,000 entries across 240+ countries. Each code combines a two-letter country code with a three-letter location identifier - for example, GBLON for London or USNYC for New York. UN/LOCODEs appear in bills of lading, customs declarations, vessel tracking systems, and supply chain software as the standard way to reference trade locations.
UN/LOCODE Data
Programmatic access to UN/LOCODE data is surprisingly hard to find online. Unlocoder provides dedicated endpoints for:
- UN/LOCODE lookup - resolve any code (e.g.
GBLON, USNYC) to coordinates, timezone, UTC offset, local time, and elevation
- Nearby search - find the closest UN/LOCODEs to any coordinate pair (up to 3 results within 5000km)
- Enriched data - goes beyond the raw UNECE directory with timezone resolution, elevation, IATA airport codes, decoded function codes, and confidence scoring
- Continuously updated - ingested from official UNECE sources, not static CSV dumps
The official UNECE directory is published as flat CSV files with roughly 20% of entries missing coordinates. Unlocoder fills every gap with a multi-source enrichment pipeline that cross-references maritime authority data, aeronautical facility records, GeoNames, and Wikidata daily - producing port-specific coordinates (not city centres), IANA timezones, elevation, IATA airport codes, and confidence scores.
Ideal for logistics platforms, freight forwarders, customs software, TMS/WMS systems, and any application that works with international trade locations.
MCP (Model Context Protocol)
Unlocoder is available as an MCP server through RapidAPI, letting AI agents use coordinate conversion and UN/LOCODE lookups as tools.
This means AI assistants can:
- Convert coordinates between formats during conversations
- Look up UN/LOCODE timezones and locations on the fly
- Find the nearest ports or logistics hubs to a given position
To connect, add Unlocoder as an MCP tool via the RapidAPI hub in your agent’s configuration. No additional setup required.
Quickstart
1. Get an API Key
Sign up for a free key on RapidAPI. The free tier includes 500 requests/month.
2. Make Your First Call
curl -X POST "https://unlocoder.p.rapidapi.com/api/convert" \
-H "Content-Type: application/json" \
-H "x-rapidapi-key: YOUR_API_KEY" \
-H "x-rapidapi-host: unlocoder.p.rapidapi.com" \
-d '{"input": "51.5074, -0.1278"}'
3. Get Results
{
"latitude": 51.5074,
"longitude": -0.1278,
"detectedFormat": "DecimalDegrees",
"precision": 6,
"outputs": {
"DecimalDegrees": "51.507400, -0.127800",
"DegreesMinutesSeconds": "51°30'26.64\"N 0°7'40.08\"W",
"DegreesDecimalMinutes": "51°30.444'N 0°7.668'W",
"Utm": "30U 699375 5710099",
"Mgrs": "30UXC9937510099",
"PlusCode": "9C3XGV4C+HQ"
},
"location": {
"code": "GBLON",
"name": "London",
"country": "GB",
"subdivision": "LND",
"function": "1234----",
"status": "AI",
"timezoneId": "Europe/London",
"utcOffset": "+00:00",
"localTime": "2026-03-08 14:30:00",
"elevationMeters": 11,
"nearestCityName": "London",
"nearestCityCountry": "GB",
"nearestCityDistanceKm": 0
},
"nearbyUnLocodes": [
{ "code": "GBTIL", "name": "Tilbury", "function": "1-------", "distanceKm": 3.2 }
]
}
API Reference
Convert Coordinates
Convert any coordinate format to all other formats with auto-detection.
POST /api/convert
| Field |
Type |
Required |
Description |
input |
string |
Yes |
Any supported coordinate format |
precision |
integer |
No |
Decimal places, 4-10 (default: 6) |
Response fields:
| Field |
Description |
latitude / longitude |
Parsed coordinates |
detectedFormat |
Which format was detected |
outputs |
All converted formats |
location |
UN/LOCODE enrichment: timezone, elevation, function codes, IATA, status |
nearbyUnLocodes |
Up to 3 nearest UN/LOCODEs with distance, function codes, IATA, and status |
Lookup UN/LOCODE
Get timezone, coordinates, and metadata for any UN/LOCODE. One of the few publicly available APIs for UN/LOCODE data.
GET /unlocodes/{code}
| Parameter |
Type |
Description |
code |
path |
UN/LOCODE, e.g. GBLON or GB LON |
referenceTime |
query |
Optional ISO 8601 datetime for historical timezone offset |
Response includes: country, location name, subdivision, coordinates, timezone ID, UTC offset, local time, elevation, function codes, IATA code (for airports), status, confidence score, and enrichment timestamp.
Example:
curl "https://unlocoder.p.rapidapi.com/unlocodes/GBLON" \
-H "x-rapidapi-key: YOUR_API_KEY" \
-H "x-rapidapi-host: unlocoder.p.rapidapi.com"
Find Nearby UN/LOCODEs
Find the closest ports, airports, and freight terminals to any coordinate.
GET /unlocodes/nearby?latitude={lat}&longitude={lng}
Returns up to 3 UN/LOCODEs within a 5000km radius, sorted by distance. Useful for identifying the nearest port or terminal to a vessel, warehouse, or delivery point.
Example:
curl "https://unlocoder.p.rapidapi.com/unlocodes/nearby?latitude=40.7128&longitude=-74.0060" \
-H "x-rapidapi-key: YOUR_API_KEY" \
-H "x-rapidapi-host: unlocoder.p.rapidapi.com"
Examples
Full working examples in multiple languages:
Pricing
| Tier |
Price |
Requests/Month |
Rate Limit |
| Basic |
Free |
500 |
60 req/min |
| Pro |
$9/mo |
2,500 |
10 req/sec |
| Enterprise |
Custom |
Custom |
Custom |
The web converter at unlocoder.com is always free (rate-limited to reasonable use).
Links
© 2025-2026 Unlocoder
评论