Fuel Estimate API
Estimate fuel volume and trip value from distance, loaded weight, observed empty/full consumption and your fuel price. Use it alone or include fuel in a Truck request.
/api/v1/fuel/estimate- Request credits
- 1
- Required scopes
route
Usage and limits
Standalone: 1 credit; optional Truck estimate is included in the route price and uses the returned road distance. Requires empty/full calibration at comparable operating conditions. Linear load interpolation; speed, slopes, traffic, wind and idling are not modeled. No validated error percentage. Prices are supplied by you; no currency conversion.
How the fuel estimate works
Supply empty and fully loaded gross weights, observed consumption in L/100 km at both weights, actual loaded gross weight, distance, price per litre and currency. Use measurements from comparable conditions. The loaded weight must stay within your calibration range; the full-load rate cannot be below the empty rate.
load_ratio = (loaded_weight_t - empty_weight_t) / (full_weight_t - empty_weight_t)
L_per_100km = empty_l_per_100km + load_ratio * (full_l_per_100km - empty_l_per_100km)
fuel_liters = distance_km * L_per_100km / 100
fuel_cost = fuel_liters * price_per_literIllustrative inputs, not measured vehicle data: empty 12 t at 20 L/100 km; full 40 t at 34 L/100 km; actual 26 t; distance 500 km; price 1.10 AZN/L. Result: 27 L/100 km, 135 L and 148.50 AZN. Decimal output precision is not prediction accuracy.
For Truck Routing, add this optional fuel object to the existing request. Loaded weight comes from vehicle.weight_t and distance from the returned road route; do not send a separate fuel distance or loaded weight. Without fuel, the route response stays unchanged. Standalone REST and MCP estimates cost 1 credit; adding fuel to Truck costs no extra credits.
{
"fuel": {
"empty_weight_t": 12,
"full_weight_t": 40,
"empty_l_per_100km": 20,
"full_l_per_100km": 34,
"price_per_liter": "1.10",
"currency": "AZN"
}
}This is a linear estimate based on your calibration. Speed, road gradient, traffic, wind, idling and driving style are excluded. No validated error percentage is available. Fuel prices are supplied by you; currencies are not converted. Results are estimates, not a payment or a guaranteed fuel bill.
MCP: estimate_fuel
Request example
Send your API key in the Authorization: Bearer header. The calibration and price below are illustrative inputs, not measured vehicle data.
curl --fail-with-body -X POST "https://osrmroute.com/api/v1/fuel/estimate" \
-H "Authorization: Bearer $OSRMROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"distance_km":500,"loaded_weight_t":26,"fuel":{"empty_weight_t":12,"full_weight_t":40,"empty_l_per_100km":20,"full_l_per_100km":34,"price_per_liter":"1.10","currency":"AZN"}}'method: user_calibrated_linear_load_v1
estimated: true
distance_km
loaded_weight_t
consumption_l_per_100km
fuel_liters
fuel_cost.amount (decimal string)
fuel_cost.currency
accuracy.validated_error_percent: null
basis
exclusions[]