Skip to main content

The U.S. Energy Information Administration is committed to its free and open data by making it available through an Application Programming Interface (API) and its open data tools. See https://www.eia.gov/opendata/ for more information.

Project description

OpenBB EIA Provider Extension

This module integrates the EIA data provider into the OpenBB Platform.

Installation

PyPI

pip install openbb-us-eia

From Source

After cloning the main repository, navigate into this folder and enter:

pip install .

To install in editable mode:

pip install -e .

Authorization

Functions calling the EIA's API require free registration and an API key, obtained here.

OpenBB Hub

Add the key as "eia_api_key" in the OpenBB Hub Credentials page, here

user_settings.json

Add it to the credentials section of ~/.openbb_platform/user_settings.json

{
    "credentials": {
        "eia_api_key": "REPLACE_WITH_YOUR_KEY"
    }
}

Current Python Session

The credential can be added for the current session only, after importing the OpenBB package.

from openbb import obb

obb.user.credentials.eia_api_key = "REPLACE_WITH_YOUR_KEY"

Coverage

Endpoints

  • obb.commodity.petroleum_status_report (API key not required.)
  • obb.commodity.short_term_energy_outlook (API key required.)

Weekly Petroluem Status Report

The WPSR is comprised of thirteen (excludes discontinued series) high-level categories with each containing a subset of tables. Data is from the static Excel files published here, and each file represents a single category.

All data from a single category is returned by supplying "all" to the table parameter of the WPSR endpoint.

Tables from the WPSR are returned in a flat format in the same order as presented in the Excel files. The response is suitable for pivot tables and SQL storage.

Category choices are defined as:

balance_sheet
inputs_and_production
refiner_and_blender_net_production
crude_petroleum_stocks
gasoline_fuel_stocks
total_gasoline_by_sub_padd
distillate_fuel_oil_stocks
imports
imports_by_country
weekly_estimates
spot_prices_crude_gas_heating
spot_prices_diesel_jet_fuel_propane
retail_prices

Short Term Energy Outlook

The Short Term Energy Outlook (STEO) is curated by table, and relies on the EIA V2 API. Tables are defined by their alphanumeric code, and return in the same format as the WPSR tables.

01: US Energy Markets Summary
02: Nominal Energy Prices
03a: World Petroleum and Other Liquid Fuels Production, Consumption, and Inventories
03b: Non-OPEC Petroleum and Other Liquid Fuels Production
03c: World Petroleum and Other Liquid Fuels Production
03d: World Crude Oil Production
03e: World Petroleum and Other Liquid Fuels Consumption
04a: US Petroleum and Other Liquid Fuels Supply, Consumption, and Inventories
04b: US Hydrocarbon Gas Liquids (HGL) and Petroleum Refinery Balances
04c: US Regional Motor Gasoline Prices and Inventories
04d: US Biofuel Supply, Consumption, and Inventories
05a: US Natural Gas Supply, Consumption, and Inventories
05b: US Regional Natural Gas Prices
06: US Coal Supply, Consumption, and Inventories
07a: US Electricity Industry Overview
07b: US Regional Electricity Retail Sales
07c: US Regional Electricity Prices
07d1: US Regional Electricity Generation, Electric Power Sector
07d2: US Regional Electricity Generation, Electric Power Sector, continued
07e: US Electricity Generating Capacity
08: US Renewable Energy Consumption
09a: US Macroeconomic Indicators and CO2 Emissions
09b: US Regional Macroeconomic Data
09c: US Regional Weather Data
10a: Drilling Productivity Metrics
10b: Crude Oil and Natural Gas Production from Shale and Tight Formations

A "symbol" parameter allows lookup by individual series ID(s) within the dataset.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openbb_us_eia-1.2.1.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openbb_us_eia-1.2.1-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file openbb_us_eia-1.2.1.tar.gz.

File metadata

  • Download URL: openbb_us_eia-1.2.1.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Darwin/25.2.0

File hashes

Hashes for openbb_us_eia-1.2.1.tar.gz
Algorithm Hash digest
SHA256 8d4f2fbddbdde83c8397964452a3ce7bb57eab6d42ba0e9c2ee9f7b03060a306
MD5 686194b82854b4741c924e358452c488
BLAKE2b-256 b991186f0275de4388e69dea5ec96e9af2b16344a7980840d3a2f2dc8cf93015

See more details on using hashes here.

File details

Details for the file openbb_us_eia-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: openbb_us_eia-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Darwin/25.2.0

File hashes

Hashes for openbb_us_eia-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51313dad14cb4d2bcad12c50fbea0e83900f4a7784593c485ea5a6d516f41b36
MD5 b11952fac6e0bc5f4d7880667fec69e1
BLAKE2b-256 04cbabcc1f324a5f2ba173b2c757e8b42fd0283ad8de3e66425081d4a6ccd9ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page