osrmroute
Sign in
Products / Navigation

Truck Routing API

Plan truck routes within and across countries on connected roads. Send the dimensions and loaded weight of the vehicle with each request.

6
required vehicle parameters
25
maximum input points
2
additional routes, maximum

Your account’s point and request limits also apply.

See the road for your loaded truck.

Choose an example, edit the vehicle and stops, and calculate. The initial view is a saved result; requests with your key use the actual road network.

Loaded truck · 4 m · 30 t

Calculate for your truck

Edit the vehicle and stops, then request a real route with your API key.

Axle load is the heaviest axle; axle load × axle count must cover total weight.

Applies to mapped roads with independent Truck access. All other restrictions and toll exclusions still apply.

This request: 1 credits, subject to account limits. A processed route miss costs 0.5 credits. Your key stays in this page’s memory.

Request JSON
POST /api/v1/truck/route · JSON
{
  "points": [
    [
      55.2744,
      25.1972
    ],
    [
      55.3077,
      25.2511
    ]
  ],
  "vehicle": {
    "height_m": 4,
    "width_m": 2.55,
    "length_m": 16.5,
    "weight_t": 30,
    "axle_load_t": 10,
    "axle_count": 5
  },
  "steps": true,
  "language": "en",
  "banner_instructions": true,
  "alternatives": 2,
  "geometries": "geojson",
  "overview": "full",
  "include": []
}
Next maneuver · 161 mAt the roundabout, take exit 1

Navigation steps

Selected fields from a saved real route result · 2026-11-28. Not a live request or traffic feed.

Selected step JSON
JSON · legs[0].steps[1]
{
  "intersections": [],
  "maneuver": {
    "modifier": "slight right",
    "instruction": "Exit the roundabout",
    "type": "exit roundabout",
    "bearing_after": 282,
    "bearing_before": 269,
    "location": [
      55.274268,
      25.198382
    ]
  },
  "name": "",
  "duration": 16.597,
  "distance": 161,
  "weight": 43.661,
  "mode": "driving",
  "geometry": {
    "coordinates": [
      [
        55.274268,
        25.198382
      ],
      [
        55.274195,
        25.198396
      ],
      [
        55.274123,
        25.19841
      ],
      [
        55.274051,
        25.198426
      ],
      [
        55.273955,
        25.198451
      ],
      [
        55.273859,
        25.198478
      ],
      [
        55.273774,
        25.198521
      ],
      [
        55.273683,
        25.198554
      ],
      [
        55.273587,
        25.198574
      ],
      [
        55.27349,
        25.198583
      ],
      [
        55.273392,
        25.198579
      ],
      [
        55.273295,
        25.198562
      ],
      [
        55.273203,
        25.198533
      ],
      [
        55.273115,
        25.198492
      ],
      [
        55.273035,
        25.198441
      ],
      [
        55.273004,
        25.198424
      ],
      [
        55.272975,
        25.198408
      ],
      [
        55.272912,
        25.198378
      ],
      [
        55.272848,
        25.198353
      ],
      [
        55.27278,
        25.19833
      ]
    ],
    "type": "LineString"
  },
  "bannerInstructions": [
    {
      "distanceAlongGeometry": 161,
      "primary": {
        "text": "At the roundabout, take exit 1",
        "type": "roundabout",
        "modifier": "slight right",
        "components": [
          {
            "type": "text",
            "text": "At the roundabout, take exit 1"
          }
        ]
      }
    }
  ]
}
Full response JSON

Six parameters. One specific vehicle.

Send loaded external dimensions, total weight, heaviest axle load and axle count including trailers with every request. The route uses that configuration; there is no car-route fallback.

hazmat=true applies mapped general hazardous-material restrictions. Heaviest axle load cannot exceed total weight, and axle count × heaviest load must cover the total.

16.5 m2.55 m4 mLoaded total weight30 t
Height
4 m
Width
2.55 m
Length
16.5 m
Loaded total weight
30 t
Heaviest axle load
10 t
Axle count
5

Approach the stop from the right side.

Set a snap ceiling and heading for each point. Use curb for the local driving side. Exclude toll roads, motorways, ferries and tunnels. Unpaved avoidance permits unpaved access at the route’s endpoints. Arrival-side selection requires mapped administrative attribution; missing data is rejected without charge.

radiuses · bearings · approaches
exclude · avoid_unpaved

Get data for each turn.

steps=true adds route legs, maneuvers, road names and source-provided lane data. Instructions support 31 languages. Optional banners and text/SSML describe the next maneuver; audio and a finished navigation application are not included.

steps=true · language=az
banner_instructions=true

Send the truck and the stops.

Use JSON POST with a Bearer key allowed to use route. Input points and GeoJSON coordinates use [longitude, latitude]. Distance is in metres and estimated duration in seconds. Copying the example sends no request.

1 credit per started group of 10 points: 2–10 points cost 1, 11–20 cost 2, and 21–25 cost 3. Alternatives and navigation add no credits. A processed no-nearby-road or no-connected-route result costs 0.5 credit once. Invalid input, access/coverage rejection, truck_excluded_road and service failures are not charged.

Get an API key
cURL · JSON POST
curl -X POST 'https://osrmroute.com/api/v1/truck/route' \
  -H 'Authorization: Bearer YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "points": [
    [
      55.2744,
      25.1972
    ],
    [
      55.3077,
      25.2511
    ]
  ],
  "vehicle": {
    "height_m": 4,
    "width_m": 2.55,
    "length_m": 16.5,
    "weight_t": 30,
    "axle_load_t": 10,
    "axle_count": 5
  },
  "steps": true,
  "language": "en",
  "banner_instructions": true,
  "alternatives": 2
}'

Concise API reference

Options and additional data
steps
true adds steps and route legs.
language
Instruction language: az, ar, bg, ca, cs, da, de, el, en, es, et, fi, fr, he, hi, hu, it, ja, ko, nb, nl, pl, pt, ro, ru, sk, sl, sv, tr, uk, vi; steps=true.
banner_instructions
Next-maneuver display guidance; requires steps=true.
voice_instructions
Text and SSML; requires steps=true. No audio file. · az/de/en/es/fr/pt/ru/tr.
voice_units
metric, imperial or british_imperial; requires voice_instructions=true.
waypoint_names
One semicolon-separated name per point; up to 500 name characters total.
waypoint_external_ids
Semicolon-separated external IDs; up to 128 characters per point.
alternatives
0–2 extra whole-route candidates, also for multiple stops. The network may yield fewer.
radiuses
One 0–250 m value or null per point; array length equals points.
bearings
One [heading,tolerance] or null per point; 0–360° and 0–180°.
approaches
One curb or unrestricted per point. Centerline/intersection points may have no distinct side.
exclude
toll, motorway, ferry, tunnel, cash_only_tolls, country_border, state_border; ≤50 point(lon lat). Endpoint roads are checked too. Missing border attribution: uncharged 503.
avoid_unpaved
Avoids mapped unpaved roads in the interior; unpaved endpoint access is permitted.
geometries
geojson (default), polyline or polyline6; applies to route and step geometries.
continue_straight
true uses break-through intermediate stops to avoid immediate reversal. Point order is unchanged.
annotations
Per-segment distance (m), duration (s), speed (m/s), mapped maxspeed. Requires full overview; unknown limits stay unknown.
notifications
all/none. Mapped road-class events with full-geometry indices; admin events only with known attribution. Not live incidents.
overview
full, simplified or false. Step shapes remain full; event indices refer to full geometry.
layers
One mapped road layer -10–10 or null per point; not a building floor.
waypoint_targets
One arrival-side [longitude,latitude] target or null per point; steps=true.
waypoints
Increasing true-stop indices including first and last. Other points shape the path; steps=true.
waypoints_per_route
Input-point projections onto each alternative’s own route geometry.
avoid_maneuver_radius
Try to avoid early turns within 1–1000 m. Unsatisfied preference returns maneuver_radius_fallback.
roundabout_exits
Separate roundabout exit maneuvers; true/false.
depart_at
now or ISO date in 2000–2037. Missing graph timezones: uncharged 503; not live traffic.
arrive_by
Arrival timestamp; mutually exclusive with depart_at. Missing graph timezones: uncharged 503.
alley_bias
-1 discourages alleys; +1 reduces the avoidance penalty. A preference, not a guarantee.
include
hov2, hov3 and hot permissions; off by default. HOV3 also permits HOV2. Mapped HOV-only roads need independent Truck access; toll prices are not calculated.
fuel
Paid plans can request fuel and cost estimates using your own calibration. Uses the preferred route’s actual distance and adds no route credits. Traffic, speed, grade, wind and idling are not modeled; no validated error percentage is available.
Limits, coverage and access

2–25 points; your account may set a lower limit. Both cumulative straight-line input distance and returned road distance are capped at 10,000 km. Snapping up to 250 m, a 16 KiB body and 10 requests/minute/key. Routing requires connected, mapped roads. Calculation deadline: 20 seconds; service failures are not charged.

Uses mapped size and access restrictions. Timed routing and border avoidance require graph timezones and administrative attribution; missing data returns an uncharged 503. Hazard-class rules, live traffic, EV and audible playback are separate. Unknown rules and legal completeness are not verified; follow posted signs.

Free accounts can try Truck Routing up to 20 times in a 24-hour window starting with the first attempt, at up to 2 requests per minute per account. The trial uses included Free credits only; purchased credits are not charged. Fuel estimates require a paid plan.

400: invalid request; 401/403: key or access; 429: limit. truck_no_route and truck_no_nearby_road mean a suitable road could not be found. truck_excluded_road prevents returning a candidate that violates a selected road exclusion. Unsupported controls are not silently accepted.

Documentation

Fuel calculation

Include a fuel profile in your Truck request to use the returned road distance and actual loaded vehicle weight. Included in the route price. The calculator below runs locally without a key.

Linear estimation from your empty/full consumption calibration. Speed, gradients, traffic, wind and idling are not modeled. No measured error percentage is available.

Try your own data
Trip
Observed calibration
Fuel price
Browser calculation

Estimated fuel

135 L
Consumption
27 L/100 km
Fuel value
202.5 USD
Linear consumption model between empty and fully loaded calibration, with the selected gross weight marked.20 L/100 km34 L/100 km12 t40 tLoaded gross weight · tConsumption · L/100 km

Illustrative calibration and price. These are not measured vehicle data or current pump prices.

Request
JSON · fuel
{
  "fuel": {
    "empty_weight_t": 12,
    "full_weight_t": 40,
    "empty_l_per_100km": 20,
    "full_l_per_100km": 34,
    "price_per_liter": "1.50",
    "currency": "USD"
  }
}
Response
JSON
{
  "method": "user_calibrated_linear_load_v1",
  "estimated": true,
  "distance_km": "500.000000",
  "loaded_weight_t": "26.000000",
  "consumption_l_per_100km": "27.000000",
  "fuel_liters": "135.000000",
  "fuel_cost": {
    "amount": "202.500000",
    "currency": "USD",
    "price_per_liter": "1.500000"
  },
  "accuracy": {
    "validated_error_percent": null
  },
  "basis": "User-supplied empty/full consumption at comparable operating conditions; linear interpolation by loaded weight.",
  "exclusions": [
    "speed_changes",
    "road_gradient",
    "traffic",
    "wind",
    "idling",
    "driving_style"
  ]
}

OSRMRoute Support

Talk directly to our team

HERE TO HELP

How can we help?

Send a message. Ticket replies are also sent to your verified email.

Your chats

Your chats will appear here.