# EIA Open Data API

Category: [Energy and environment](https://free-web-services.com/web-services/open-data/energy/)  
Page: https://free-web-services.com/web-services/open-data/energy/eia-open-data-api.html  
Documentation: https://www.eia.gov/opendata/

The EIA Open Data API from the US Energy Information Administration gives energy statistics: electricity generation and prices, oil and gas production and prices, coal, renewables and forecasts, for example to chart US petrol prices. Browse routes such as /v2/electricity/retail-sales and get JSON. Free with a free API key.

- API key: Needed, free
- Pricing: Free with a free API key.
- From the browser: Yes (CORS)
- Formats: JSON
- Interface: REST, HTTP-GET
- Provider: eia.gov
- Last checked: Working on November 7th, 2026

Example request:

```sh
curl 'https://api.eia.gov/v2/electricity/retail-sales/data/?api_key=YOUR_API_KEY&frequency=monthly&data[0]=price&length=5'
```

Replace YOUR_API_KEY with your own key. The JavaScript works in a web page as well as in Node.js 18 or newer.

