Skip to content
Navo24 Navo24
POSTAPI key

Batch routes

POSTapi.navo24.com/v1/distance/batch

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

routesarrayrequired

Objects with from, to and, optionally, any route option. At most 50.

speed_knotsnumber

Default speed for every route.

routing_modestring

Default routing mode.

avoidstring

Default passages to close.

alternativesboolean

Return alternatives for every route.

mode / modesstring

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.

dataobject[]

The payload. Everything an endpoint returns sits under this key.

data[]object
okboolean

Whether the request succeeded.

dataobject

The payload. Everything an endpoint returns sits under this key.

fromobject
locodestring

UN/LOCODE of the place.

namestring

Human-readable name.

countrystring

Country name.

country_codestring

ISO 3166-1 alpha-2 country code.

latnumber

Latitude.

lngnumber

Longitude.

sourcestring

Where the answer on this call came from: direct_carrier or warm_db.

toobject
locodestring

UN/LOCODE of the place.

namestring

Human-readable name.

countrystring

Country name.

country_codestring

ISO 3166-1 alpha-2 country code.

latnumber

Latitude.

lngnumber

Longitude.

sourcestring

Where the answer on this call came from: direct_carrier or warm_db.

routing_modestring
avoidedobject[]
routeobject

The legs in order. Each carries its two endpoints, its geometry and its vessel.

labelstring

The event in plain words. A non-actual event is tagged "(planned)".

distanceobject
nmnumber
kmnumber
ecaobject
nmnumber
non_eca_nmnumber
sharenumber
zonesobject[]
zones[]object
idstring

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.

namestring

Human-readable name.

nmnumber
transitobject
speed_knotsnumber

Speed over ground, in knots.

hoursnumber
daysnumber
passagesobject[]
passages[]object
idstring

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.

namestring

Human-readable name.

alternativesobject[]
metaobject
countnumber

How many cards the lane returned.

took_msnumber

Errors

A failure answers with an HTTP error status and { "error": { "code", "message" } }. Branch on the code, and log the message.

invalid_request400

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}'
Response
{
  "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
  }
}