---
title: "Calculate your fuel surcharge from the EIA weekly diesel index"
method: GET
path: "/v1/fuel-surcharge/calculate"
tags: ["Fuel Surcharge"]
---

# Calculate your fuel surcharge from the EIA weekly diesel index

`GET /v1/fuel-surcharge/calculate`

## Request

- Base URL: `https://api.oilpriceapi.com`
- URL: `https://api.oilpriceapi.com/v1/fuel-surcharge/calculate`
- Auth: API key in header `Authorization`

Applies your own surcharge schedule to the stored EIA (DOE) weekly
retail on-highway diesel series and returns the result for the latest
week plus a weekly table, newest first. Two methods: `percent`
(surcharge % = completed increments over base x percent per increment)
and `per_mile` ((diesel - base) / mpg, USD per mile). Diesel at or
below the base price is a 0 surcharge. Each week carries its EIA week
date and retrieval time. A region with no stored week returns 404.

## Query parameters

- `base_price` number, required
- `method` 'percent' | 'per_mile'
- `increment` number
- `percent_per_increment` number
- `rounding` 'floor' | 'ceil' | 'exact'
- `mpg` number
- `region` 'national' | 'east-coast' | 'midwest' | 'gulf-coast' | 'rocky-mountain' | 'west-coast' | 'california'
- `weeks` integer

## Response `200`

Surcharge for the latest EIA week and the weekly table

- object
  - `status` string
  - `data` object
    - `region` string
    - `commodity_code` string
    - `index` string
    - `as_of` string, date: EIA week of the latest stored diesel price.
    - `stale` boolean: True when the latest EIA week is more than 9 days old (ingestion behind).
    - `stale_reason` string, nullable
    - `inputs` object
    - `current` FuelSurchargeCalculationWeek
      - `week_of` string, date: EIA week the diesel price was observed for.
      - `diesel_price` number: EIA weekly retail on-highway diesel, USD/gallon.
      - `diesel_change` number, nullable: Change from the prior EIA week, USD/gallon.
      - `retrieved_at` string, date-time
      - `surcharge_percent` number: Present for method=percent.
      - `surcharge_per_mile` number: Present for method=per_mile, USD per mile.
    - `weeks` FuelSurchargeCalculationWeek[]
      - `week_of` string, date: EIA week the diesel price was observed for.
      - `diesel_price` number: EIA weekly retail on-highway diesel, USD/gallon.
      - `diesel_change` number, nullable: Change from the prior EIA week, USD/gallon.
      - `retrieved_at` string, date-time
      - `surcharge_percent` number: Present for method=percent.
      - `surcharge_per_mile` number: Present for method=per_mile, USD per mile.

## Other responses

- `400`: Missing or invalid parameters; every problem is listed in `data.errors`
- `401`: Unauthorized - Invalid API key
- `404`: No EIA weekly diesel price stored for the region
- `500`: Unexpected server error. Retry transient failures with bounded backoff and retain the request ID when contacting support.

## Changes

- **2026-10-26** `9e633619fedf`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/changes/v1/fuel-surcharge/calculate/get.md)

---

[API](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1.md) - [All operations](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/oilpriceapi/apis/oil-price-api-v1/revisions/7f8b4d763210?raw)
