Esc
GETAPI key
Find a port
GETapi.navo24.com/v1/distance/ports
Search ports by name or UN/LOCODE prefix. Ports on the routing network come first, then other UN/LOCODE seaports.
Query parameters
q
At least 2 characters: part of a name, or a UN/LOCODE prefix.
limit
1 to 100, default 20.
Response schema
8 fields
Derived from the example response, nested as the JSON is.
data
The payload. Everything an endpoint returns sits under this key.
data[]
locode
UN/LOCODE of the place.
name
Human-readable name.
country
Country name.
country_code
ISO 3166-1 alpha-2 country code.
lat
Latitude.
lng
Longitude.
source
Where the answer on this call came from: direct_carrier or warm_db.
Errors
A failure answers with an HTTP error status and { "error": { "code", "message" } }. Branch on the code, and log the message.
invalid_request
q is shorter than 2 characters or limit is not an integer.
curl 'https://api.navo24.com/v1/distance/ports?q=rotter&limit=2' \
-H "Authorization: Bearer tmcp_YOUR_API_KEY"const res = await fetch("https://api.navo24.com/v1/distance/ports?q=rotter&limit=2", {
headers: {
"Authorization": "Bearer tmcp_YOUR_API_KEY"
}
});
const data = await res.json();import requests
res = requests.get(
"https://api.navo24.com/v1/distance/ports?q=rotter&limit=2",
headers={"Authorization": "Bearer tmcp_YOUR_API_KEY"},
)
data = res.json() Response
{
"data": [
{
"locode": "NLRTM",
"name": "Rotterdam",
"country": "Netherlands",
"country_code": "NL",
"lat": 51.90438,
"lng": 4.44245,
"source": "network"
},
{
"locode": "USRAJ",
"name": "Rotterdam",
"country": "United States",
"country_code": "US",
"lat": 42.78333,
"lng": -73.96667,
"source": "unlocode"
}
]
}