U.S. Energy Information Administration logo

OPEN DATA

Committed to making energy data more accessible, understandable,
relevant, and responsive to your needs.

API

EIA Chart Widget

HTML for the embedded visualization

Copy and paste the following HTML into your web page:
<iframe id="eia_widget" style="width:100%;height:500px" src="//www.eia.gov/opendata/embed/iframe.php?series_id=PET.RBRTE.M" load="iframe_load"></iframe>

Note modify the width and height style to size the visualization on your web page.

Visualization preview

Modify visualization settings:

  1. Pie charts degrade to bar charts when data is missing or when relationship is not additive.
  2. Area charts degrade to line charts when data is missing or when relationship is not additive.
(semi-colon separated list)
Note: Defining an end date means the embedded visualization will be a snapshot and will not show new data when released by EIA.

Licenses and Source Code

The visualization makes use of an EIA visualization JavaScript library, several free open source JavaScript libraries, a commercial open source JavaScript library, and EIA's data service. When embedding a visualization via the above code (an IFRAME to an eia.gov hosted web page), your use of these libraries is covered by EIA's licenses.

The EIA visualization libary's source code is available on github.com/eiagov. Users are invited to fork the code and submit improvements and new features.