---
title: "US Gasoline & Diesel Prices API"
slug: us-gasoline-diesel-prices
url: https://apyhub.com/martin10291/service/us-gasoline-diesel-prices
provider: Martin Petrov
categories: [Verification Kit]
tags: [fuel-prices, gasoline, diesel, price-history, travel-cost, us-data]
auth: api_key
version: 1.0
service_type: sync
endpoints: 1
atoms: 100
mcp: true
---

# US Gasoline & Diesel Prices API

US gasoline and diesel prices API returns latest, history, or trip cost data by area. Send areas, fuels, and dates, get JSON back. Free tier, no card.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/martin10291/us-gasoline-diesel-prices` | What it does Returns US gasoline and diesel price data by area in a JSON object. Depending on mode,… | 100 |

## Endpoint reference

### Gas Prices API - US Gasoline & Diesel by State, Weekly History

`POST https://api.eu.apyhub.com/martin10291/us-gasoline-diesel-prices` · 100 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `mpg` | body | number | no | trip mode: vehicle fuel economy in US mpg. Default 25 when litersPer100km is also empty. |
| `mode` | body | string | no | latest = newest weekly price per area and fuel with weekly/yearly change and 52-week high/low; history = price series between startDate and endDate (weekly, or monthly/yearly averages); trip = fuel c… |
| `sort` | body | string | no | latest mode: area order (default), cheapest first, most expensive first, or biggest weekly rise first. One of: area, priceAsc, priceDesc, changeWeek. Example: `area`. |
| `areas` | body | array of string | no | US, PADD1..PADD5 (East Coast, Midwest, Gulf Coast, Rocky Mountain, West Coast), PADD1A/1B/1C, PADD5XCA, states CA CO FL MA MN NY OH TX WA, cities BOS CHI CLE DEN HOU LAX MIA NYC SFO SEA, or names lik… |
| `fuels` | body | array of string | no | regular, midgrade, premium, allGrades, diesel ('all' = every fuel). Empty = regular + diesel for latest, regular for history and trip. Diesel is published for US, PADD regions, CA and PADD5XCA. Examp… |
| `limit` | body | integer | no | Maximum rows returned (1-20000). Default 1000. Default: `20`. Example: `1000`. |
| `endDate` | body | string | no | history mode: last week, YYYY-MM-DD. Default latest. |
| `interval` | body | string | no | history mode: weekly survey values, or monthly / yearly averages of the weekly values. One of: weekly, monthly, yearly. Example: `weekly`. |
| `startDate` | body | string | no | history mode: first week, YYYY-MM-DD (or YYYY / YYYY-MM). Default one year ago. Gasoline from 1990/1994, diesel from 1994. |
| `distanceKm` | body | number | no | trip mode: trip distance in kilometers (used when distanceMiles is empty). |
| `distanceMiles` | body | number | no | trip mode: trip distance in miles (or use distanceKm). |
| `litersPer100km` | body | number | no | trip mode: fuel economy in L/100 km (used when mpg is empty). |

#### Quickstart

Get the latest U.S. gas prices for the default fuel and area settings with a single POST request.

```bash
curl -X POST "https://api.eu.apyhub.com/martin10291/us-gasoline-diesel-prices" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"latest"}'
```

#### What you'll get back

Returns a JSON object with `billed` and `count` integers, plus an `items` array of result objects.

Each item can include fields such as `area`, `fuel`, `unit`, `week`, `price`, and other price-change metadata depending on the mode.

```json
{
  "billed": 1,
  "count": 1,
  "items": [
    {
      "area": "US",
      "fuel": "regular",
      "unit": "USD/gallon",
      "week": "2026-11-16",
      "price": 3.49
    }
  ]
}
```

## About

## What it does

The US gasoline and diesel prices API returns fuel price data for US areas in one request. Send `mode` to choose latest prices, history, trip cost, or a covered areas list. You can also send `areas`, `fuels`, `limit`, `sort`, `startDate`, `endDate`, `interval`, `distanceKm`, `distanceMiles`, `mpg`, or `litersPer100km` when the mode needs them.

Use `latest` for the newest weekly price in each area and fuel. It can also sort by area, cheapest first, most expensive first, or biggest weekly rise. Use `history` for weekly data or monthly and yearly averages between your dates. Use `trip` to estimate fuel cost from distance and fuel economy.

The response gives a row count, billed units, and an item list. Each row can include the area name and type, fuel name, week, price in USD per gallon, 52-week high and low, weekly and yearly change, past prices, release dates, and a source link.

Teams use the US gasoline and diesel prices API to show live fuel prices in dashboards and compare states or cities. They also use it to estimate route cost before dispatch and to build fuel price charts for planning.

To convert fuel costs into other money units, use the [Currency Converter API](https://apyhub.com/apyhub/service/convert-currency-pair-for-date). To match prices with country data, use the [Country Information API](https://apyhub.com/apyhub/service/detailed-info-for-a-single-country).

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/martin10291/service/us-gasoline-diesel-prices
