Fuel cost of a trip and of regular driving
Work out what fuel costs, for one trip and for ongoing driving.
Consumption is litres per 100 km, which is how New Zealand quotes it and how it is printed on a Gen Vehicle Fuel Economy Label. A LOWER number is a more efficient vehicle. Sending miles per gallon or kilometres per litre here will produce a confident and completely wrong answer.
Two figures answer different questions. cost_per_100km depends only on the vehicle and the pump price, so it is the one to compare two cars with. cost_per_km depends on the trip you asked about.
Leave weekly_km at zero for a one-off trip. The weekly, monthly and annual figures then come back as zero rather than as an error.
monthly_cost is a twelfth of the annual figure, not the weekly cost times 4.33 and not a calendar month.
Fuel only. Not road user charges, which diesel and electric vehicles pay by the kilometre, and not servicing, tyres, insurance or depreciation.
Request
- Base URL: https://api.calculate.co.nz
- URL: https://api.calculate.co.nz/v1/fuel-cost
- Auth: API key in header X-API-Key
Request body
Example request
{
"consumption_l_per_100km": 7.8,
"distance_km": 642,
"price_per_litre": 2.79,
"weekly_km": 250
}Response
Trip cost, cost per kilometre, and weekly to annual running costs.
Example response
{
"disclaimer": "Estimate only. Real consumption varies with driving style, load, terrain, traffic and tyre pressure, and pump prices move daily. Fuel only: this is not the full cost of running a vehicle.",
"result": {
"annual_cost": 2829,
"annual_km": 13000,
"consumption_l_per_100km": 7.8,
"cost_per_100km": 21.76,
"cost_per_km": 0.22,
"distance_km": 642,
"litres_used": 50.1,
"monthly_cost": 235.76,
"price_per_litre": 2.79,
"trip_cost": 139.71,
"weekly_cost": 54.41,
"weekly_km": 250
}
}Changes
No recorded changes to this operation across all 1 revision of this API.