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. Here is how we can get the fuel mix

caiso.get_latest_fuel_mix()
ISO: California ISO
Total Production: 23095 MW 
Time: 2022-10-26 12:30:00-07:00 
+-------------+-------+-----------+
| Fuel        |    MW |   Percent |
|-------------+-------+-----------|
| Solar       | 10116 |      43.8 |
| Natural Gas |  5886 |      25.5 |
| Wind        |  2973 |      12.9 |
| Imports     |  1908 |       8.3 |
| Nuclear     |  1127 |       4.9 |
| Geothermal  |   909 |       3.9 |
| Large Hydro |   545 |       2.4 |
| Biomass     |   216 |       0.9 |
| Biogas      |   198 |       0.9 |
| Small Hydro |    97 |       0.4 |
| Coal        |     3 |       0   |
| Other       |     0 |       0   |
| Batteries   |  -883 |      -3.8 |
+-------------+-------+-----------+

Load#

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

caiso.get_load_today()
Time Load
0 2022-10-26 00:00:00-07:00 22175.0
1 2022-10-26 00:05:00-07:00 22225.0
2 2022-10-26 00:10:00-07:00 22225.0
3 2022-10-26 00:15:00-07:00 22169.0
4 2022-10-26 00:20:00-07:00 22143.0
... ... ...
146 2022-10-26 12:10:00-07:00 20765.0
147 2022-10-26 12:15:00-07:00 20819.0
148 2022-10-26 12:20:00-07:00 20776.0
149 2022-10-26 12:25:00-07:00 20696.0
150 2022-10-26 12:30:00-07:00 20669.0

151 rows × 2 columns

Supply#

we can get today’s supply in the same way

caiso.get_supply_today()
Time Supply
0 2022-10-26 00:00:00-07:00 23594
1 2022-10-26 00:05:00-07:00 23618
2 2022-10-26 00:10:00-07:00 23564
3 2022-10-26 00:15:00-07:00 23565
4 2022-10-26 00:20:00-07:00 23592
... ... ...
146 2022-10-26 12:10:00-07:00 23548
147 2022-10-26 12:15:00-07:00 23331
148 2022-10-26 12:20:00-07:00 23267
149 2022-10-26 12:25:00-07:00 23115
150 2022-10-26 12:30:00-07:00 23095

151 rows × 2 columns

Load Forecast#

Another dataset we can query is the load forecast

nyiso = gridstatus.NYISO()
nyiso.get_forecast_today()
Forecast Time Time Load Forecast
0 2022-10-26 00:00:00-04:00 2022-10-26 00:00:00-04:00 13321
1 2022-10-26 00:00:00-04:00 2022-10-26 01:00:00-04:00 12905
2 2022-10-26 00:00:00-04:00 2022-10-26 02:00:00-04:00 12626
3 2022-10-26 00:00:00-04:00 2022-10-26 03:00:00-04:00 12518
4 2022-10-26 00:00:00-04:00 2022-10-26 04:00:00-04:00 12682
... ... ... ...
139 2022-10-26 00:00:00-04:00 2022-10-31 19:00:00-04:00 16590
140 2022-10-26 00:00:00-04:00 2022-10-31 20:00:00-04:00 16100
141 2022-10-26 00:00:00-04:00 2022-10-31 21:00:00-04:00 15437
142 2022-10-26 00:00:00-04:00 2022-10-31 22:00:00-04:00 14534
143 2022-10-26 00:00:00-04:00 2022-10-31 23:00:00-04:00 13682

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_historical_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_historical_* method

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
... ... ...
8923 2020-01-31 23:35:00-08:00 21905
8924 2020-01-31 23:40:00-08:00 21773
8925 2020-01-31 23:45:00-08:00 21674
8926 2020-01-31 23:50:00-08:00 21540
8927 2020-01-31 23:55:00-08:00 21425

8928 rows × 2 columns

Next Steps#

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