> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.isoview.io/llms.txt.
> For full documentation content, see https://docs.isoview.io/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.isoview.io/_mcp/server.

# Python Client

The official Python client provides a convenient wrapper around the ISOview REST API with automatic pandas DataFrame conversion, request chunking, and dynamic method generation. Methods are built dynamically from the API's OpenAPI spec at init time, so the client stays in sync with the API automatically.

## Getting started

```bash
pip install isoview-client
```

Requires Python 3.10+. Dependencies: `requests`, `pandas`.

```python
from isoview import Client

client = Client("your-api-key")

# Get the latest ERCOT demand forecast as a DataFrame
df = client.get_regional_forecast("ercot", "demand", as_df=True)
print(df.head())
```

```
                           ercot
2026-03-17 07:00:00+00:00  45230.5
2026-03-17 08:00:00+00:00  44892.1
2026-03-17 09:00:00+00:00  44105.3
2026-03-17 10:00:00+00:00  43521.8
2026-03-17 11:00:00+00:00  43198.2
```

Use `dir(client)` to see all available methods, or `help(client.get_regional_forecast)` for detailed usage on any method.

## Examples

```python
# List available regions
regions = client.list_regions("pjm", "demand")

# Get forecast for a specific region
df = client.get_regional_forecast("pjm", "demand", id="pjm_total", as_df=True)

# Compare with ISO's own forecast
df_iso = client.get_regional_forecast("pjm", "demand", id="pjm_total", model="iso", as_df=True)

# Day-ahead backcast for model evaluation
df = client.get_region_day_ahead_backcast("pjm", "demand", as_df=True)

# Get all metrics for an ISO in one call
summary = client.get_iso_summary("pjm")
```

```python
# What did the 10 AM day-ahead forecast predict for each hour?
df = client.get_region_continuous_forecast(
    "miso", "wind",
    start="2026-01-01T00:00:00Z",
    end="2026-02-01T00:00:00Z",
    latest_hour=10,
    days_ahead=1,
    as_df=True,
)
```

```python
data = client.get_ensemble_forecast(
    "pjm", "demand",
    id="pjm_total",
    model="euro_ens",
)
```

```python
# List wind plants in ERCOT
plants = client.list_plants("ercot", "wind")
print(plants[0]["name"], plants[0]["capacity_mw"], "MW")

# Get a specific plant's generation forecast
df = client.get_plant_forecast(
    "ercot", "wind",
    id=str(plants[0]["id"]),
    as_df=True,
)
```

```python
# List H3 cells for an ISO (resolution defaults to 3; metric defaults to demand)
cells = client.list_cells("isone")

# Cell-level forecast — demand, wind, or solar
df = client.get_cell_forecast("isone", "demand", id=cells[0]["id"], as_df=True)
df_wind = client.get_cell_forecast("isone", "wind", id=cells[0]["id"], as_df=True)
```

```python
# Gas price forecasts
hubs = client.list_gas_hubs()
df = client.get_gas_price_forecast(id=hubs[0]["id"], as_df=True)

# Day-ahead LMP (rtlmp is also available)
nodes = client.list_lmp_nodes("pjm", "dalmp")
df = client.get_lmp_forecast("pjm", "dalmp", id=nodes[0]["id"], as_df=True)
```

## Automatic chunking

Requests spanning more than 365 days are automatically split into yearly chunks and merged:

```python
df = client.get_region_day_ahead_backcast(
    "pjm", "demand",
    start="2023-01-01T00:00:00Z",
    end="2025-06-01T00:00:00Z",
    as_df=True,
)
```

## Error handling

```python
import requests

try:
    data = client.get_regional_forecast("pjm", "demand")
except requests.HTTPError as e:
    print(e.response.status_code, e.response.text)
```

## Links

Install and version history

Source code and issues