About this endpoint
What it does
Returns US gasoline and diesel price data by area in a JSON object. Depending on mode, the response can contain the latest weekly prices, historical price series, trip cost calculations, or the list of covered areas.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| mpg | Number | No | Trip mode: vehicle fuel economy in US mpg. Default 25 when litersPer100km is also empty. |
| mode | ENUM | No | Allowed values: latest, history, trip, areas. 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 cost of a trip from distance and fuel economy at the current local price.areas = list of covered. |
| sort | ENUM | No | Allowed values: area, priceAsc, priceDesc, changeWeek. latest mode only: area order (default), cheapest first, most expensive first, or biggest weekly rise first. |
| areas | String Array | 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 like California / New York City. all = every area. Max 100 items. |
| fuels | String Array | 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. Max 100 items. |
| limit | Integer | No | Maximum rows returned. Default 1000. Allowed range: 1-20000. |
| endDate | String | No | history mode: last week, YYYY-MM-DD. Default latest. |
| interval | ENUM | No | Allowed values: weekly, monthly, yearly. history mode: weekly survey values, or monthly / yearly averages of the weekly values. |
| startDate | 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 | Number | No | trip mode: trip distance in kilometers (used when distanceMiles is empty). |
| distanceMiles | Number | No | trip mode: trip distance in miles (or use distanceKm). |
| litersPer100km | Number | No | trip mode: fuel economy in L/100 km (used when mpg is empty). |
Response
Returns a JSON object with billed as an integer, count as an integer, and items as an array of result objects. Each item can include area and fuel identifiers plus pricing, change, history, and trip-related fields depending on the selected mode.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| billed | Integer | Yes | Units charged for this call: result rows only; not-found / unavailable / invalid rows are free. |
| count | Integer | Yes | Number of rows in items. |
| items | Object Array | Yes | Result rows. Each object may include the following fields. |
| items[].area | String | No | US, PADD1..PADD5, PADD1A/1B/1C, PADD5XCA, state (CA, TX...) or city (NYC, LAX...). |
| items[].fuel | String | No | regular, midgrade, premium, allGrades or diesel. |
| items[].unit | String | No | Unit used in the row. |
| items[].week | String | No | EIA survey Monday, YYYY-MM-DD. |
| items[].price | Number | No | USD per gallon, retail incl. taxes. |
| items[].state | String | No | Nullable string. |
| items[].low52w | Number | No | 52-week low price. |
| items[].source | String | No | Data source. |
| items[].high52w | Number | No | 52-week high price. |
| items[].areaName | String | No | Area name. |
| items[].areaType | String | No | national, region, state or city. |
| items[].fuelName | String | No | Fuel name. |
| items[].sourceUrl | String | No | Source URL. |
| items[].changeWeek | Number | No | Week-over-week change. |
| items[].changeYear | Number | No | Year-over-year change. |
| items[].vsNational | Number | No | Nullable comparison against the national price. |
| items[].historyFrom | String | No | History start reference. |
| items[].releaseDate | String | No | Release date. |
| items[].tripCostUsd | Number | No | Trip mode only. |
| items[].yearAgoPrice | Number | No | Price from one year ago. |
| items[].changeWeekPct | Number | No | Week-over-week percentage change. |
| items[].changeYearPct | Number | No | Year-over-year percentage change. |
| items[].nextReleaseDate | String | No | Next scheduled release date. |
| items[].previousWeekPrice | Number | No | Price from the previous week. |



