solarforecastarbiter.io.fetch.eia.get_eia_data¶
-
solarforecastarbiter.io.fetch.eia.
get_eia_data
(series_id, api_key, start, end)[source]¶ Retrieve data from the EIA Open Data API. [1]
Parameters: - series_id (string) – The series ID in the EIA API.
- api_key (string) – The API key for accessing the EIA API.
- start (pd.Timestamp) – The start timestamp in UTC.
- end (pd.Timestamp) – The end timestamp in UTC.
Returns: pandas.DataFrame – The data from start to end for series_id.
References
[1] https://www.eia.gov/opendata/ Examples
>>> series_id = "EBA.CISO-ALL.D.H" # CAISO demand [MW] >>> start = pd.Timestamp("20200601T0800Z") >>> end = pd.Timestamp("20200602T0800Z") >>> api_key = "yourapikeygoeshere" >>> get_eia_data(series_id, api_key, start, end) timestamp value 2020-06-01 08:00:00+00:00 22028 2020-06-01 09:00:00+00:00 21141 2020-06-01 10:00:00+00:00 20573 ...