Skip to content
Navo24 Navo24
GETAPI key

Route with geometry

GETapi.navo24.com/v1/distance/route

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

fromstringrequired

Origin UN/LOCODE or lat,lng.

tostringrequired

Destination UN/LOCODE or lat,lng.

speed_knotsnumber

Service speed, 3 to 40.

pathbooleanrequired

Set to true.

Response schema

41 fields

Derived from the example response, nested as the JSON is.

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[]
pathnumber[][]

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.

alternativesobject[]
metaobject
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

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.

location_not_found404

The location is well formed but we cannot place it: an unknown code, or an address the geocoder does not find.

no_route422

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.

geocoder_unavailable503

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