Gas Prices API - US Gasoline & Diesel by State, Weekly History
us_gas_prices_apiOfficial US gas prices as JSON, no API key: weekly retail regular, midgrade, premium gasoline and diesel prices (USD/gallon) for the US, 10 PADD regions, 9 states and 10 cities from the EIA survey, with week-over-week and year-over-year change, 52-week high/low, history since 1990 (weekly, monthly or yearly averages) and a trip fuel cost calculator. Monitor mode returns only new weeks. Usable from AI agents via MCP. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.02/call via x402 at https://radarbg.com/x402/us-gas-prices-api.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"mode": "latest",
"sort": "area",
"areas": [
"US",
"CA",
"TX",
"NYC"
],
"fuels": [
"regular",
"diesel"
]
},
"name": "us_gas_prices_api"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mpg | No | trip mode: vehicle fuel economy in US mpg. Default 25 when litersPer100km is also empty. | |
| mode | 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 cost of a trip from distance and fuel econ | |
| sort | No | latest mode: area order (default), cheapest first, most expensive first, or biggest weekly rise first. | |
| areas | 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' = | |
| fuels | 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. | |
| limit | No | Maximum rows returned (1-20000). Default 1000. | |
| endDate | No | history mode: last week, YYYY-MM-DD. Default latest. | |
| interval | No | history mode: weekly survey values, or monthly / yearly averages of the weekly values. | |
| startDate | No | history mode: first week, YYYY-MM-DD (or YYYY / YYYY-MM). Default one year ago. Gasoline from 1990/1994, diesel from 1994. | |
| distanceKm | No | trip mode: trip distance in kilometers (used when distanceMiles is empty). | |
| distanceMiles | No | trip mode: trip distance in miles (or use distanceKm). | |
| litersPer100km | No | trip mode: fuel economy in L/100 km (used when mpg is empty). |