Gas Prices API
Official 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.
Example request
curl -X POST https://radarbg.com/v1/us-gas-prices-api \
-H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
-d '{"mode": "latest", "areas": ["US", "CA", "TX", "NYC"], "fuels": ["regular", "diesel"], "sort": "area"}'
Answer: {"ok": true, "count": N, "items": [...], "usage": {...}}. Failed calls are not counted.
Inputs
| Field | Type | Description |
|---|---|---|
mode | string | 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 |
areas | array | 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 | array | 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. |
sort | string | latest mode: area order (default), cheapest first, most expensive first, or biggest weekly rise first. |
startDate | string | history mode: first week, YYYY-MM-DD (or YYYY / YYYY-MM). Default one year ago. Gasoline from 1990/1994, diesel from 1994. |
endDate | string | history mode: last week, YYYY-MM-DD. Default latest. |
interval | string | history mode: weekly survey values, or monthly / yearly averages of the weekly values. |
distanceMiles | number | trip mode: trip distance in miles (or use distanceKm). |
distanceKm | number | trip mode: trip distance in kilometers (used when distanceMiles is empty). |
mpg | number | trip mode: vehicle fuel economy in US mpg. Default 25 when litersPer100km is also empty. |
litersPer100km | number | trip mode: fuel economy in L/100 km (used when mpg is empty). |
limit | integer | Maximum rows returned (1-20000). Default 1000. |
onlyNew | boolean | Return only rows not returned before for this Monitor ID, e.g. schedule weekly to get each new EIA release once. |
monitorId | string | Name of the monitor state used by onlyNew. Different IDs keep separate memories. |
Price
Included in every plan: 100 calls a month free, then from €9 a month for 3,000 calls across all APIs.