Rail 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
Any form from the Locations table.
Any form from the Locations table.
RAIL (or TRAIN).
Other feasible chains in alternatives[]. Default true for ROAD, RAIL, AIR and /multimodal.
Add terminal handling at each transfer: port 24 h, rail terminal 12 h, airport 12 h, river port 18 h. Default true.
Geometry per section as [lat, lng] pairs. Road sections also give ferry_paths as lines.
Departure date YYYY-MM-DD for the seasonal river rules. Default today (UTC). Only river legs depend on it.
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.
data
from / data
The resolved points: kind (port, airport, country, address, coordinates), name, locode or iata, country_code, lat, lng.
The modes you allowed.
route
Chain type: Sea, Rail, Air, Road, River (road, barge, road) or Sea + River (sea to a river-mouth gateway, then barge).
The modes the chain actually uses, in order.
summary
Total km and nm for the chain.
Total hours and days. duration.hours = moving_hours + handling_hours.
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[]
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.
RIVER: average speed over ground for this leg, current and locks included.
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).
RIVER: lock sites passed. lock_hours is the time they add, already inside duration.
RIVER: named waterways on the leg, longest first, as name, km and class (CEMT class in Europe).
RIVER: seasonal rules that touch this leg on the requested date, with the km affected.
RIVER: credit line for the waterway data this leg was built from. Show it wherever you display the leg.
Each change of mode: at (port, rail terminal or airport), from_mode, to_mode, hours.
true when a road leg was estimated from straight-line distance because road routing was briefly unavailable.
Other feasible chains, same shape, in the order set by optimize.
Present when RIVER is allowed: the date the seasonal rules were applied for.
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.
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=Chongqing%2C%20China&to=Duisburg%2C%20Germany&mode=RAIL&date=2026-10-17' \
-H "Authorization: Bearer tmcp_YOUR_API_KEY"const res = await fetch("https://api.navo24.com/v1/distance/route?from=Chongqing%2C%20China&to=Duisburg%2C%20Germany&mode=RAIL&date=2026-10-17", {
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=Chongqing%2C%20China&to=Duisburg%2C%20Germany&mode=RAIL&date=2026-10-17",
headers={"Authorization": "Bearer tmcp_YOUR_API_KEY"},
)
data = res.json() {
"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
}
}