gridstatus Homepage#

gridstatus logo

Tests PyPI Version

What is gridstatus?#

gridstatus is a standardized Python API to electricity supply, demand, and pricing data for the major Independent System Operators (ISOs) in the United States.

Currently gridstatus supports CAISO, SPP, ISONE, MISO, Ercot, NYISO, and PJM.

We’d love to answer any usage or data access questions! Please let us know by posting a GitHub issue.

5 Minute Overview#

First, we can see all of the ISOs that are supported

import gridstatus
gridstatus.list_isos()
Name Id Class
0 Midcontinent ISO miso MISO
1 California ISO caiso CAISO
2 PJM pjm PJM
3 Electric Reliability Council of Texas ercot Ercot
4 Southwest Power Pool spp SPP
5 New York ISO nyiso NYISO
6 ISO New England isone ISONE

Next, we can select an ISO we want to use

caiso = gridstatus.CAISO()

Fuel Mix#

All ISOs have the same API to methods like get_fuel_mix, get_load, and get_status, etc. Here is how we can get the fuel mix

caiso.get_fuel_mix("today")
Time Solar Wind Geothermal Biomass Biogas Small Hydro Coal Nuclear Natural Gas Large Hydro Batteries Imports Other
0 2022-10-28 00:00:00-07:00 -46 1080 917 277 210 119 5 1128 11879 890 66 6288 0
1 2022-10-28 00:05:00-07:00 -46 1058 917 282 210 116 5 1127 11871 854 204 6253 0
2 2022-10-28 00:10:00-07:00 -46 1059 912 282 210 113 4 1128 11885 850 257 6129 0
3 2022-10-28 00:15:00-07:00 -46 1075 913 282 209 113 4 1127 11935 818 206 6144 0
4 2022-10-28 00:20:00-07:00 -46 1101 914 281 210 113 4 1127 11952 809 323 6023 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
121 2022-10-28 10:05:00-07:00 11937 1255 912 285 213 103 2 1121 7918 364 -1394 3310 0
122 2022-10-28 10:10:00-07:00 11968 1230 912 286 212 103 1 1121 8034 366 -1515 3333 0
123 2022-10-28 10:15:00-07:00 11990 1201 912 284 213 103 1 1122 7997 435 -1468 3114 0
124 2022-10-28 10:20:00-07:00 12013 1159 911 283 213 103 1 1122 7945 436 -1465 2993 0
125 2022-10-28 10:25:00-07:00 12047 1135 912 283 213 103 1 1121 7909 287 -1470 3002 0

126 rows × 14 columns

Load#

or the energy demand throughout the current day as a Pandas DataFrame

caiso.get_load("today")
Time Load
0 2022-10-28 00:00:00-07:00 22130.0
1 2022-10-28 00:05:00-07:00 22157.0
2 2022-10-28 00:10:00-07:00 22176.0
3 2022-10-28 00:15:00-07:00 22109.0
4 2022-10-28 00:20:00-07:00 22095.0
... ... ...
121 2022-10-28 10:05:00-07:00 22622.0
122 2022-10-28 10:10:00-07:00 22517.0
123 2022-10-28 10:15:00-07:00 22412.0
124 2022-10-28 10:20:00-07:00 22311.0
125 2022-10-28 10:25:00-07:00 22222.0

126 rows × 2 columns

Load Forecast#

Another dataset we can query is the load forecast

nyiso = gridstatus.NYISO()
nyiso.get_load_forecast("today")
Forecast Time Time Load Forecast
0 2022-10-28 00:00:00-04:00 2022-10-28 00:00:00-04:00 13219
1 2022-10-28 00:00:00-04:00 2022-10-28 01:00:00-04:00 12739
2 2022-10-28 00:00:00-04:00 2022-10-28 02:00:00-04:00 12503
3 2022-10-28 00:00:00-04:00 2022-10-28 03:00:00-04:00 12458
4 2022-10-28 00:00:00-04:00 2022-10-28 04:00:00-04:00 12658
... ... ... ...
139 2022-10-28 00:00:00-04:00 2022-11-02 19:00:00-04:00 16930
140 2022-10-28 00:00:00-04:00 2022-11-02 20:00:00-04:00 16443
141 2022-10-28 00:00:00-04:00 2022-11-02 21:00:00-04:00 15679
142 2022-10-28 00:00:00-04:00 2022-11-02 22:00:00-04:00 14617
143 2022-10-28 00:00:00-04:00 2022-11-02 23:00:00-04:00 13684

144 rows × 3 columns

Historical Data#

When supported, you can use the historical method calls to get data for a specific day in the past. For example,

caiso.get_load("Jan 1, 2020")
Time Load
0 2020-01-01 00:00:00-08:00 21533
1 2020-01-01 00:05:00-08:00 21429
2 2020-01-01 00:10:00-08:00 21320
3 2020-01-01 00:15:00-08:00 21272
4 2020-01-01 00:20:00-08:00 21193
... ... ...
283 2020-01-01 23:35:00-08:00 20494
284 2020-01-01 23:40:00-08:00 20383
285 2020-01-01 23:45:00-08:00 20297
286 2020-01-01 23:50:00-08:00 20242
287 2020-01-01 23:55:00-08:00 20128

288 rows × 2 columns

Frequently, we want to get data across multiple days. We can do that by providing a start and end parameter to any iso.get_* method

caiso_load = caiso.get_load(start="Jan 1, 2021", end="Feb 1, 2021")
caiso_load
Time Load
0 2021-01-01 00:00:00-08:00 21937.0
1 2021-01-01 00:05:00-08:00 21858.0
2 2021-01-01 00:10:00-08:00 21827.0
3 2021-01-01 00:15:00-08:00 21757.0
4 2021-01-01 00:20:00-08:00 21664.0
... ... ...
8923 2021-01-31 23:35:00-08:00 20054.0
8924 2021-01-31 23:40:00-08:00 19952.0
8925 2021-01-31 23:45:00-08:00 19859.0
8926 2021-01-31 23:50:00-08:00 19763.0
8927 2021-01-31 23:55:00-08:00 19650.0

8928 rows × 2 columns

We can now see there is data for all of January 2021

import plotly.express as px

fig = px.line(caiso_load, x="Time", y="Load", title="CAISO Load - Jan '21")
fig

Next Steps#

The best part is these APIs work in the same way across all the supported ISOs!