---
title: "Fuel cost of a trip and of regular driving"
method: POST
path: "/v1/fuel-cost"
tags: ["Calculators"]
---

# Fuel cost of a trip and of regular driving

`POST /v1/fuel-cost`

## 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`

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 body

- FuelCostRequest
  - `distance_km` number, required: Trip distance in kilometres.
  - `consumption_l_per_100km` number, required: Vehicle consumption in litres per 100 km, the New Zealand convention, so a LOWER number is a more efficient vehicle. This is not miles per gallon and not kilometres per litre.
  - `price_per_litre` number, required: Pump price in NZD per litre.
  - `weekly_km` number: Kilometres driven in a typical week, used for the running costs. Leave at zero for a one-off trip: the weekly, monthly and annual figures then come back as zero rather than as an error.

## Response `200`

Trip cost, cost per kilometre, and weekly to annual running costs.

- FuelCostResponse
  - `result` FuelCostResult, required
    - `distance_km` number, required: Trip distance you sent, in kilometres.
    - `consumption_l_per_100km` number, required: Consumption you sent, L/100km.
    - `price_per_litre` number, required: Pump price you sent, NZD per litre.
    - `weekly_km` number, required: Weekly distance you sent, in kilometres.
    - `litres_used` number, required: Fuel the trip consumes, in litres.
    - `trip_cost` number, required: What the trip costs in fuel, in NZD.
    - `cost_per_km` number, required: Fuel cost of one kilometre. Zero when distance_km is zero, rather than an error, matching the website.
    - `cost_per_100km` number, required: Fuel cost of 100 km, which is consumption times price and does not depend on the trip distance. Useful for comparing vehicles.
    - `weekly_cost` number, required: Fuel cost of a typical week, from weekly_km.
    - `monthly_cost` number, required: A twelfth of the annual cost, NOT the weekly cost times 4.33 and not a calendar month. Matches the website.
    - `annual_cost` number, required: Weekly cost over 52 weeks, in NZD.
    - `annual_km` number, required: Weekly distance over 52 weeks, in kilometres.
  - `disclaimer` string, required: Scope and limits of this calculation.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/calculate/apis/calculate-co-nz-api.md) · [All operations](https://skmtc.dev/calculate/apis/calculate-co-nz-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calculate/apis/calculate-co-nz-api/revisions/aa59a8e76614?raw)
