EIA API
EIA (eia.gov) has 2 public methods: get electricity prices and get weekly fuel prices. Each costs 1 credit per completed run (1¢ with pay as you go); failed runs are free.
Unofficial. Not affiliated with or endorsed by EIA.
Methods
2Gets 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.
Returns state, customer type, latest month, price, price a year earlier, change percent, year-to-date average, US average, EIA link
Readeia.gov/get_electricity_pricesGets 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.
Returns area, week date, regular/midgrade/premium/all-grades gasoline and diesel prices with changes, EIA link, history
Readeia.gov/get_fuel_prices