Skip to content

EIA API: Get weekly fuel prices

Gets the latest weekly EIA retail gasoline and on-highway diesel prices for a U.S. area, with changes from the prior week and from 52 weeks earlier.

eia.gov (opens in a new tab)Version 1ReadNo sign-inVerified Nov 2, 2026

Unofficial. Not affiliated with or endorsed by EIA.

Inputs

Values from the run on Oct 23, 2026, shown under Output.

Area optionalarea

Reported U.S. area, such as US, Midwest, California, Texas, Chicago, or Denver. Example: Midwest

Chicago

Default US.

Weeks optionalweeks

Number of recent weeks, from 1 to 52. Example: 4

3

Whole number from 1 to 52. Default 1.

Output

From a run on Oct 23, 2026.
{  "area": "Chicago",  "history": [    {      "area": "Chicago",      "currency": "USD",      "eia_link": "https://www.eia.gov/dnav/pet/pet_pri_gnd_dcus_yord_w.htm",      "week_date": "2026-10-19",      "diesel_price_per_gallon": null,      "diesel_change_from_year_ago": null,      "diesel_change_from_last_week": null,      "premium_gasoline_price_per_gallon": 5.991,      "regular_gasoline_price_per_gallon": 4.705,      "midgrade_gasoline_price_per_gallon": 5.313,      "all_grades_gasoline_price_per_gallon": 4.895,      "premium_gasoline_change_from_year_ago": 1.698,      "regular_gasoline_change_from_year_ago": 1.524,      "midgrade_gasoline_change_from_year_ago": 1.5,      "premium_gasoline_change_from_last_week": 0.011,      "regular_gasoline_change_from_last_week": 0.01,      "midgrade_gasoline_change_from_last_week": 0.019,      "all_grades_gasoline_change_from_year_ago": 1.535,      "all_grades_gasoline_change_from_last_week": 0.011    },    {      "area": "Chicago",      "currency": "USD",      "eia_link": "https://www.eia.gov/dnav/pet/pet_pri_gnd_dcus_yord_w.htm",      "week_date": "2026-10-12",      "diesel_price_per_gallon": null,      "diesel_change_from_year_ago": null,      "diesel_change_from_last_week": null,      "premium_gasoline_price_per_gallon": 5.98,      "regular_gasoline_price_per_gallon": 4.695,      "midgrade_gasoline_price_per_gallon": 5.294,      "all_grades_gasoline_price_per_gallon": 4.884,      "premium_gasoline_change_from_year_ago": 1.624,      "regular_gasoline_change_from_year_ago": 1.452,      "midgrade_gasoline_change_from_year_ago": 1.413,      "premium_gasoline_change_from_last_week": 0.06,      "regular_gasoline_change_from_last_week": 0.062,      "midgrade_gasoline_change_from_last_week": 0.041,      "all_grades_gasoline_change_from_year_ago": 1.461,      "all_grades_gasoline_change_from_last_week": 0.06    },    {      "area": "Chicago",      "currency": "USD",      "eia_link": "https://www.eia.gov/dnav/pet/pet_pri_gnd_dcus_yord_w.htm",      "week_date": "2026-10-05",      "diesel_price_per_gallon": null,      "diesel_change_from_year_ago": null,      "diesel_change_from_last_week": null,      "premium_gasoline_price_per_gallon": 5.92,      "regular_gasoline_price_per_gallon": 4.633,      "midgrade_gasoline_price_per_gallon": 5.253,      "all_grades_gasoline_price_per_gallon": 4.824,      "premium_gasoline_change_from_year_ago": 1.415,      "regular_gasoline_change_from_year_ago": 1.224,      "midgrade_gasoline_change_from_year_ago": 1.206,      "premium_gasoline_change_from_last_week": -0.106,      "regular_gasoline_change_from_last_week": -0.126,      "midgrade_gasoline_change_from_last_week": -0.098,      "all_grades_gasoline_change_from_year_ago": 1.237,      "all_grades_gasoline_change_from_last_week": -0.122    }  ],  "currency": "USD",  "eia_link": "https://www.eia.gov/dnav/pet/pet_pri_gnd_dcus_yord_w.htm",  "week_date": "2026-10-19",  "diesel_price_per_gallon": null,  "diesel_change_from_year_ago": null,  "diesel_change_from_last_week": null,  "premium_gasoline_price_per_gallon": 5.991,  "regular_gasoline_price_per_gallon": 4.705,  "midgrade_gasoline_price_per_gallon": 5.313,  "all_grades_gasoline_price_per_gallon": 4.895,  "premium_gasoline_change_from_year_ago": 1.698,  "regular_gasoline_change_from_year_ago": 1.524,  "midgrade_gasoline_change_from_year_ago": 1.5,  "premium_gasoline_change_from_last_week": 0.011,  "regular_gasoline_change_from_last_week": 0.01,  "midgrade_gasoline_change_from_last_week": 0.019,  "all_grades_gasoline_change_from_year_ago": 1.535,  "all_grades_gasoline_change_from_last_week": 0.011}
Price
1 credit per completed run (1¢ with pay as you go); failed runs are free.
Method
eia.gov/get_fuel_prices
Returns
area, week date, regular/midgrade/premium/all-grades gasoline and diesel prices with changes, EIA link, history

Use it from your agent

Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method eia.gov/get_fuel_prices with the inputs above.

Ask your agent

  • What is the latest weekly retail gasoline price for the US, including regular, midgrade, and premium, and how much did it change from last week?
  • Show me the on-highway diesel price for the Midwest this week compared with the same week last year.
  • Give me the past 4 weeks of regular gasoline prices for California from eia.gov.
  • I need the current all-grades gasoline average for Chicago along with the weekly change and a link to the EIA source.
  • How have diesel prices in Denver moved over the last 12 weeks, with week-over-week and year-over-year changes?
  • Gets a state's latest monthly electricity price for a customer type from EIA. It also returns the year-over-year change, the year-to-date average and the matching US average.

    eia.gov/get_electricity_prices
  • Gets AAA average gasoline and diesel prices for the US, a state, or a metro area listed on its state page, with yesterday, week, month and year-ago comparisons and record highs, as of the date AAA shows.

    gasprices.aaa.com/get_gas_prices
  • Gets GasBuddy's latest reported average regular gas price, its changes and the diesel benchmark for a US state or a listed metro area. Midgrade, premium and area low/high prices are not published with these averages; updates may lag the current day.

    gasbuddy.com/get_average_gas_prices
  • Returns official MPG or MPGe, range, annual fuel cost, five-year savings and emissions for every matching version of a vehicle. Costs use current fuel prices and 15,000 miles per year; plug-in hybrid costs include gasoline and electricity.

    fueleconomy.gov/get_fuel_economy
  • Finds nearby GasBuddy stations for a US or Canadian city, address or postal code and lists their reported prices for a fuel grade, lowest listed price first.

    gasbuddy.com/list_cheapest_gas_stations
  • Gets current commodity prices and price movements from the Trading Economics commodities page, in the page's group order; filter by a commodity name, slug, symbol or group (e.g. copper, energy), or leave blank for all groups including Electricity.

    tradingeconomics.com/get_commodity_prices
  • Gets the latest U.S. Consumer Price Index inflation for a spending category, with up to 24 recent months of history. Monthly changes are seasonally adjusted; 12-month changes are not.

    bls.gov/get_inflation_rate
  • Gets decades of yearly commodity or stock-index price history from Macrotrends: yearly average, open, high, low, close, annual change and inflation-adjusted value for gold, silver, crude oil, natural gas, copper, Dow Jones, S&P 500 and Nasdaq. The current year may be incomplete.

    macrotrends.net/get_long_term_price_history