What is Grid Status?#

gridstatus logo

Tests PyPI Version

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-12-15 00:00:00-08:00 -48 1209 928 306 211 166 2 2245 13694 1396 -157 5588 0
1 2022-12-15 00:05:00-08:00 -48 1196 928 304 212 163 3 2245 14317 1302 143 4761 0
2 2022-12-15 00:10:00-08:00 -48 1173 928 304 212 167 2 2246 14824 1236 185 4216 0
3 2022-12-15 00:15:00-08:00 -48 1147 928 306 212 170 2 2247 15182 1230 145 3873 0
4 2022-12-15 00:20:00-08:00 -48 1128 928 306 212 171 3 2247 15123 1260 111 3829 0
... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
147 2022-12-15 12:15:00-08:00 9128 1555 923 317 210 165 3 2251 12816 895 -1625 -72 0
148 2022-12-15 12:20:00-08:00 9041 1561 923 321 210 164 4 2251 12851 947 -1632 -98 0
149 2022-12-15 12:25:00-08:00 8988 1569 924 323 210 167 3 2251 12594 979 -1487 -122 0
150 2022-12-15 12:30:00-08:00 8824 1548 925 325 213 167 3 2251 12182 993 -1205 -150 0
151 2022-12-15 12:35:00-08:00 8679 1530 924 326 215 168 3 2250 11722 1128 -1085 -233 0

152 rows × 14 columns

Load#

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

caiso.get_load("today")
Time Load
0 2022-12-15 00:00:00-08:00 24071.0
1 2022-12-15 00:05:00-08:00 24052.0
2 2022-12-15 00:10:00-08:00 23962.0
3 2022-12-15 00:15:00-08:00 23845.0
4 2022-12-15 00:20:00-08:00 23784.0
... ... ...
147 2022-12-15 12:15:00-08:00 22635.0
148 2022-12-15 12:20:00-08:00 22565.0
149 2022-12-15 12:25:00-08:00 22568.0
150 2022-12-15 12:30:00-08:00 22428.0
151 2022-12-15 12:35:00-08:00 22307.0

152 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-12-15 00:00:00-05:00 2022-12-15 00:00:00-05:00 15840
1 2022-12-15 00:00:00-05:00 2022-12-15 01:00:00-05:00 15362
2 2022-12-15 00:00:00-05:00 2022-12-15 02:00:00-05:00 15075
3 2022-12-15 00:00:00-05:00 2022-12-15 03:00:00-05:00 14994
4 2022-12-15 00:00:00-05:00 2022-12-15 04:00:00-05:00 15184
... ... ... ...
139 2022-12-15 00:00:00-05:00 2022-12-20 19:00:00-05:00 20013
140 2022-12-15 00:00:00-05:00 2022-12-20 20:00:00-05:00 19509
141 2022-12-15 00:00:00-05:00 2022-12-20 21:00:00-05:00 18764
142 2022-12-15 00:00:00-05:00 2022-12-20 22:00:00-05:00 17633
143 2022-12-15 00:00:00-05:00 2022-12-20 23:00:00-05:00 16558

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!