Batch routes
Up to 50 routes in one call, for model refreshes and lane tables. Options at the top level apply to every route, and a route can override them, mode and modes included, so one batch can mix sea, road, rail, air and multimodal lanes. Geometry is not returned in batch. One failed route does not fail the batch: it comes back with ok false and its own error. Each route counts as one request.
Request body
Objects with from, to and, optionally, any route option. At most 50.
Default speed for every route.
Default routing mode.
Default passages to close.
Return alternatives for every route.
Default mode for every route, or a modes list for multimodal chains. A route can set its own.
Response schema
45 fields
Derived from the example response, nested as the JSON is.
The payload. Everything an endpoint returns sits under this key.
data[]
Whether the request succeeded.
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.
passages[]
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.
meta
How many cards the lane returned.
Errors
A failure answers with an HTTP error status and { "error": { "code", "message" } }. Branch on the code, and log the message.
The body is not JSON, has no routes array, or holds more than 50 routes.
curl -X POST 'https://api.navo24.com/v1/distance/batch' \
-H "Authorization: Bearer tmcp_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"routes":[{"from":"SGSIN","to":"USHOU"},{"from":"XXXXX","to":"NLRTM"}],"speed_knots":12}'const res = await fetch("https://api.navo24.com/v1/distance/batch", {
method: "POST",
headers: {
"Authorization": "Bearer tmcp_YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"routes": [
{
"from": "SGSIN",
"to": "USHOU"
},
{
"from": "XXXXX",
"to": "NLRTM"
}
],
"speed_knots": 12
})
});
const data = await res.json();import requests
res = requests.post(
"https://api.navo24.com/v1/distance/batch",
headers={"Authorization": "Bearer tmcp_YOUR_API_KEY"},
json={
"routes": [
{
"from": "SGSIN",
"to": "USHOU"
},
{
"from": "XXXXX",
"to": "NLRTM"
}
],
"speed_knots": 12
},
)
data = res.json() {
"data": [
{
"ok": true,
"data": {
"from": {
"locode": "SGSIN",
"name": "Singapore",
"country": "Singapore",
"country_code": "SG",
"lat": 1.23921,
"lng": 103.83246,
"source": "network"
},
"to": {
"locode": "USHOU",
"name": "Houston",
"country": "United States",
"country_code": "US",
"lat": 29.74575,
"lng": -95.28716,
"source": "network"
},
"routing_mode": "short",
"avoided": [],
"route": {
"label": "via Suez Canal",
"distance": {
"nm": 11765.5,
"km": 21789.7
},
"eca": {
"nm": 2746.1,
"non_eca_nm": 9019.3,
"share": 0.2334,
"zones": [
{
"id": "north-american",
"name": "North American ECA",
"nm": 811.3
},
{
"id": "mediterranean",
"name": "Mediterranean Sea ECA",
"nm": 1934.8
}
]
},
"transit": {
"speed_knots": 12.0,
"hours": 980.5,
"days": 40.85
},
"passages": [
{
"id": "gibraltar",
"name": "Strait of Gibraltar"
},
{
"id": "suez",
"name": "Suez Canal"
},
{
"id": "malacca",
"name": "Strait of Malacca"
},
{
"id": "babalmandab",
"name": "Bab-el-Mandeb"
}
]
},
"alternatives": []
}
},
{
"ok": false,
"error": {
"code": "location_not_found",
"message": "from XXXXX is not a known UN/LOCODE with coordinates."
}
}
],
"meta": {
"count": 2,
"took_ms": 34
}
}