Skip to content
Navo24 Navo24
GETAPI key

Rail route

GETapi.navo24.com/v1/distance/route

Rail over the world network with mode=RAIL, plus the road legs to and from the railhead. The example is Chongqing to Duisburg, the China to Europe rail corridor.

Query parameters

fromstringrequired

Any form from the Locations table.

tostringrequired

Any form from the Locations table.

modestringrequired

RAIL (or TRAIN).

alternativesboolean

Other feasible chains in alternatives[]. Default true for ROAD, RAIL, AIR and /multimodal.

handlingboolean

Add terminal handling at each transfer: port 24 h, rail terminal 12 h, airport 12 h, river port 18 h. Default true.

pathboolean

Geometry per section as [lat, lng] pairs. Road sections also give ferry_paths as lines.

datestring

Departure date YYYY-MM-DD for the seasonal river rules. Default today (UTC). Only river legs depend on it.

seasonalboolean

false switches the seasonal river rules off: no closures, no slow-downs, no seasonal_notes. Default true.

Response schema

19 fields

Nested exactly as the JSON is. Open a branch to read its fields; hover a name for the full dot-path.

dataobject
from / dataobject
toobject

The resolved points: kind (port, airport, country, address, coordinates), name, locode or iata, country_code, lat, lng.

transport_modes[]array

The modes you allowed.

routeobject
labelstring

Chain type: Sea, Rail, Air, Road, River (road, barge, road) or Sea + River (sea to a river-mouth gateway, then barge).

transport_modes[]array

The modes the chain actually uses, in order.

summaryobject
distanceobject

Total km and nm for the chain.

durationobject

Total hours and days. duration.hours = moving_hours + handling_hours.

cost_indexnumber

Relative cost in thousands of km-equivalents at SEA 1, RIVER 1.8, RAIL 3, ROAD 6, AIR 40 per km. For ranking, not a price.

sections[]array

Legs in order: transport_mode, from, to, distance, duration, path. SEA legs add speed_knots, via, eca and passages. ROAD legs add driving_hours and ferry_paths. RIVER legs add the fields below.

speed_kmhnumber

RIVER: average speed over ground for this leg, current and locks included.

currentobject

RIVER: km sailed with the current (downstream_km), against it (upstream_km) and on still water such as canals, lakes and tidal reaches (slack_water_km).

locksinteger

RIVER: lock sites passed. lock_hours is the time they add, already inside duration.

waterways[]array

RIVER: named waterways on the leg, longest first, as name, km and class (CEMT class in Europe).

seasonal[]array

RIVER: seasonal rules that touch this leg on the requested date, with the km affected.

attributionstring

RIVER: credit line for the waterway data this leg was built from. Show it wherever you display the leg.

transfers[]array

Each change of mode: at (port, rail terminal or airport), from_mode, to_mode, hours.

estimatedboolean

true when a road leg was estimated from straight-line distance because road routing was briefly unavailable.

alternatives[]array

Other feasible chains, same shape, in the order set by optimize.

datestring

Present when RIVER is allowed: the date the seasonal rules were applied for.

seasonal_notes[]array

Seasonal river rules that changed the answer: id, kind (closure, ice_risk, low_water), note, typical_window, source, then time_factor for a slow-down or reopens_about for a closure, and effect: no_route (the river chain is gone), detour (it goes round the closed stretch) or slower.

Errors

A failure carries { "ok": false, "error": { "code", "message", "severity" } }. 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=Chongqing%2C%20China&to=Duisburg%2C%20Germany&mode=RAIL&date=2026-10-17' \
  -H "Authorization: Bearer tmcp_YOUR_API_KEY"
Response
{
  "data": {
    "from": {
      "kind": "address",
      "name": "Chongqing",
      "country_code": "CN",
      "lat": 30.05518,
      "lng": 107.87487
    },
    "to": {
      "kind": "address",
      "name": "Duisburg",
      "country_code": "DE",
      "lat": 51.435,
      "lng": 6.75956
    },
    "transport_modes": [
      "RAIL",
      "ROAD"
    ],
    "optimize": "cost",
    "route": {
      "label": "Rail",
      "transport_modes": [
        "ROAD",
        "RAIL"
      ],
      "summary": {
        "distance": {
          "km": 10303.4,
          "nm": 5563.4,
          "meters": 10303400
        },
        "duration": {
          "hours": 351.8,
          "days": 14.66,
          "seconds": 1266480
        },
        "moving_hours": 339.8,
        "handling_hours": 12.0,
        "speed_kmh": 29.29,
        "cost_index": 31.52
      },
      "sections": [
        {
          "transport_mode": "ROAD",
          "from": {
            "kind": "address",
            "name": "Chongqing",
            "country_code": "CN",
            "lat": 30.05518,
            "lng": 107.87487
          },
          "to": {
            "kind": "rail_terminal",
            "lat": 30.57056,
            "lng": 106.88778
          },
          "distance": {
            "km": 201.9,
            "nm": 109.0,
            "meters": 201936
          },
          "duration": {
            "hours": 3.1,
            "days": 0.13,
            "seconds": 11264
          },
          "driving_hours": 3.1
        },
        {
          "transport_mode": "RAIL",
          "from": {
            "kind": "rail_terminal",
            "lat": 30.57056,
            "lng": 106.88778
          },
          "to": {
            "kind": "rail_terminal",
            "lat": 51.42889,
            "lng": 6.77389
          },
          "distance": {
            "km": 10101.5,
            "nm": 5454.4,
            "meters": 10101500
          },
          "duration": {
            "hours": 336.7,
            "days": 14.03,
            "seconds": 1212180
          }
        }
      ],
      "transfers": [
        {
          "at": {
            "kind": "rail_terminal",
            "lat": 30.57056,
            "lng": 106.88778
          },
          "from_mode": "ROAD",
          "to_mode": "RAIL",
          "hours": 12.0
        }
      ],
      "estimated": false
    },
    "alternatives": []
  },
  "meta": {
    "took_ms": 221
  }
}