Route with geometry
The same call with path=true. It adds the polyline as [lat, lng] pairs, ready for Leaflet, Mapbox or any map. The example is New York to Rotterdam at 16 knots, where almost half the voyage is inside an ECA. The path is trimmed to its first three points here.
Query parameters
Origin UN/LOCODE or lat,lng.
Destination UN/LOCODE or lat,lng.
Service speed, 3 to 40.
Set to true.
Response schema
41 fields
Derived from the example response, nested as the JSON is.
data
The payload. Everything an endpoint returns sits under this key.
from
UN/LOCODE of the place.
Human-readable name.
Country name.
ISO 3166-1 alpha-2 country code.
Latitude.
Longitude.
Where the answer on this call came from: direct_carrier or warm_db.
to
UN/LOCODE of the place.
Human-readable name.
Country name.
ISO 3166-1 alpha-2 country code.
Latitude.
Longitude.
Where the answer on this call came from: direct_carrier or warm_db.
route
The legs in order. Each carries its two endpoints, its geometry and its vessel.
The event in plain words. A non-actual event is tagged "(planned)".
distance
eca
zones[]
Stable identifier for the record. On the tracking endpoints this is the container UUID, except on a portfolio summary row, where it is the container number.
Human-readable name.
transit
Speed over ground, in knots.
The drawn geometry of the leg as lat and lng pairs. Empty on an inland leg, where we do not draw a line we cannot verify.
meta
Errors
A failure answers with an HTTP error status and { "error": { "code", "message" } }. Branch on the code, and log the message.
A parameter is missing or malformed: an unknown mode, speed_knots outside 3 to 40, an unknown passage in avoid, a pol/pod that is not a sea port, or a date that is not YYYY-MM-DD.
The location is well formed but we cannot place it: an unknown code, or an address the geocoder does not find.
No route joins the two points with the modes and passages you allowed, for example SEA only between two inland cities. When a seasonal river closure is the cause, the message names each closure, its typical window and the date it usually reopens.
Free-text address lookup is briefly down. Codes and coordinates keep working.
curl 'https://api.navo24.com/v1/distance/route?from=USNYC&to=NLRTM&speed_knots=16&path=true' \
-H "Authorization: Bearer tmcp_YOUR_API_KEY"const res = await fetch("https://api.navo24.com/v1/distance/route?from=USNYC&to=NLRTM&speed_knots=16&path=true", {
headers: {
"Authorization": "Bearer tmcp_YOUR_API_KEY"
}
});
const data = await res.json();import requests
res = requests.get(
"https://api.navo24.com/v1/distance/route?from=USNYC&to=NLRTM&speed_knots=16&path=true",
headers={"Authorization": "Bearer tmcp_YOUR_API_KEY"},
)
data = res.json() {
"data": {
"from": {
"locode": "USNYC",
"name": "New York",
"country": "United States",
"country_code": "US",
"lat": 40.70547,
"lng": -74.01768,
"source": "network"
},
"to": {
"locode": "NLRTM",
"name": "Rotterdam",
"country": "Netherlands",
"country_code": "NL",
"lat": 51.90438,
"lng": 4.44245,
"source": "network"
},
"routing_mode": "short",
"avoided": [],
"route": {
"label": "direct",
"distance": {
"nm": 3322.3,
"km": 6153.0
},
"eca": {
"nm": 1618.3,
"non_eca_nm": 1704.0,
"share": 0.4871,
"zones": [
{
"id": "north-american",
"name": "North American ECA",
"nm": 1241.6
},
{
"id": "north-sea",
"name": "North Sea ECA",
"nm": 376.7
}
]
},
"transit": {
"speed_knots": 16.0,
"hours": 207.6,
"days": 8.65
},
"passages": [],
"path": [
[
40.70875,
-74.02382
],
[
40.6676,
-74.0488
],
[
40.6285,
-74.0561
]
]
},
"alternatives": []
},
"meta": {
"took_ms": 12
}
}