The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Clarigrid listing page.
Unified Python SDK for European and U.S. energy market data.
Clarigrid provides a single, stable Python interface to access and normalise European and U.S. energy market data from multiple sources. All data comes back as timezone-aware pandas DataFrames with consistent column names and units.
Built-in free providers (no API key required) include Energy-Charts (Europe), Energinet (DK1/DK2), SMARD (DE), Elia (BE), NESO (GB), Elexon/BMRS (GB), and ENTSOG (EU gas). Fingrid (FI), GIE AGSI/ALSI (European gas), and TenneT (NL) are also built in and use free API keys. For the United States, CAISO OASIS and NYISO provide no-auth market and system data. EIA-930 provides nationwide hourly balancing-authority load, forecasts, fuel generation, and physical interchange with a free EIA key. Global historical meteorology and solar data are available from NASA POWER without an API key; official U.S. hourly forecasts are available from NOAA/NWS. ENTSO-E and other key-protected sources can be configured as described in API key setup below.
For the interactive setup wizard and CLI tools:
Some providers (ENTSO-E, TenneT) require a personal API key issued by the upstream data source. Clarigrid supports two ways to supply these keys.
Store all your provider keys in one place at clarigrid.energy/saved. The SDK then fetches them automatically using a single ClarigGrid API key.
First-time setup (interactive):
Or use the CLI:
Headless / CI environments: set one environment variable and no browser is ever needed:
The SDK uses CLARIGRID_API_KEY to fetch all your stored provider keys
from clarigrid.energy on the first connect() call of each session.
How to get a CLARIGRID_API_KEY:
cg.connect("entsoe") once in an interactive terminal — the browser
flow logs you in and stores your CLARIGRID_API_KEY locally.If you prefer not to use a clarigrid.energy account, set provider keys
directly. Keys are stored in ~/.config/clarigrid/.env (permissions: 600).
Environment variable (recommended for CI):
Config file — add to ~/.config/clarigrid/.env:
Each call to cg.connect() registers a provider and its capability-specific
zone coverage in
an internal router. When you call get_prices("DE"), the router picks the
best connected provider for that zone and dataset automatically.
Multiple connect() calls accumulate coverage. If two providers both cover
the same zone/dataset pair, the later connect() call wins.
If no connected provider covers the requested zone/dataset, a helpful error is raised:
To bypass routing and force a specific provider:
All functions return a pandas.DataFrame with:
| Property | Value |
|---|---|
| Index | DatetimeIndex named utc_time, tz-aware |
| Timezone | UTC by default; change with cg.set_timezone() |
| Price column | price_mwh |
| Load column | load_mw |
| Generation columns | fuel-type specific, e.g. solar_mw, wind_onshore_mw, nuclear_mw |
| Gas flow column | flow_kwh_d |
| Gas storage | inventory in *_mwh; daily rates in *_mwh_d |
| LNG inventory | *_thousand_m3; send-out in *_mwh_d |
| Cross-border columns | signed MW; imports positive, exports negative |
| Installed capacity | *_capacity_mw; storage energy uses *_energy_mwh |
| Frequency | frequency_hz |
| Renewable shares | *_pct |
Price currency is stored in df.attrs["currency"] (for example "EUR",
"GBP", or "USD"):
European zone codes follow the ENTSO-E bidding zone convention (BE, DE_LU,
FR ...). U.S. electricity uses EIA/NERC balancing-authority codes (CISO,
ERCO, PJM, NYIS) and explicit market hubs (CISO_NP15). Common aliases
(DE → DE_LU, CAISO → CISO, ERCOT → ERCO) resolve automatically.
Data is always fetched and cached as UTC. Timezone conversion is applied at the output boundary only.
Responses are cached locally at ~/.clarigrid/cache/ as Parquet files
(requires pip install clarigrid[cache]), keyed by provider + dataset +
zone + date range. Historical data is cached indefinitely; live data
expires after 1 hour by default.
Disable caching per call:
Requires pip install clarigrid[auth].
| Function | Description |
|---|---|
cg.connect(provider) | Connect provider; handles auth for key-guarded sources |
cg.set_timezone(tz) | Set output timezone (IANA string, default "UTC") |
cg.get_prices(zone, start, end, market="day_ahead", node=None) | Electricity prices → price_mwh; optional node for nodal markets |
cg.get_load(zone, start, end) | Actual total load → load_mw |
cg.get_generation(zone, start, end) | Generation per fuel type → *_mw columns |
cg.get_generation_forecast(zone, start, end) | Wind/solar generation forecast → *_forecast_mw |
cg.get_load_forecast(zone, start, end) | Load forecast → load_forecast_mw |
cg.get_physical_flows(zone, start, end) | Signed cross-border physical flows in MW |
cg.get_commercial_schedule(zone, start, end) | Signed commercial exchanges in MW |
cg.get_installed_capacity(zone, start, end) | Installed power by technology in MW |
cg.get_frequency(zone, start, end) | System frequency → frequency_hz |
cg.get_renewable_share(zone, start, end) | Renewable share in percent |
cg.get_co2_intensity(zone, start, end) | Electricity carbon intensity in gCO2/kWh |
cg.get_co2_forecast(zone, start, end) | Forecast carbon intensity in gCO2/kWh |
cg.get_gas_flows(zone, start, end) | Gas physical flows → flow_kwh_d |
cg.get_capacity(zone, start, end) | Firm technical gas capacity → capacity_kwh_d |
cg.get_gas_storage(zone, start, end) | Gas inventory, capacity, injection and withdrawal |
cg.get_lng_inventory(zone, start, end) | LNG tank inventory and terminal send-out |
cg.get_weather(zone, start, end) | Weather observations / forecasts |
cg.status() | Print connected providers, zones, capabilities |
cg.set_api_key(provider, key) | Store a provider key locally |
cg.list_providers() | List all registered provider names |
cg.register_provider(name, instance) | Register an external provider |
All data functions accept:
source="name" — override the router for this call onlyuse_cache=False — bypass the local cache| Name | Data | Zones | Auth |
|---|---|---|---|
energycharts | prices, load, generation, forecasts, capacity, cross-border flows, frequency, renewable share | European countries and openly licensed price zones | None |
energinet | prices, load, generation, forecasts, physical flows, actual/forecast CO2 | DK1, DK2 | None |
redata | five-minute load/forecast; daily-average generation, shares and physical flows; installed capacity | ES | None |
rte | load, generation, load forecasts, physical/commercial exchanges, generation shares and CO2 | FR | None |
fingrid | load, generation, forecasts, flows, NTC, capacity, frequency, CO2, imbalance and balancing | FI | Free API key |
gie | daily underground gas storage and LNG terminal inventory | Europe, countries, facilities | Free API key |
eia | hourly load, forecast, fuel generation, physical interchange and generation shares | U.S. balancing authorities and regions | Free API key |
caiso | day-ahead LMP at NP15, SP15, ZP26 or an explicit node | California ISO | None |
nyiso | day-ahead zonal LBMP, actual/forecast load, fuel mix and shares | New York ISO and NYISO load zones | None |
nasapower | daily/hourly meteorology, precipitation, wind and solar radiation | Global point locations (lat,lon) | None |
nws | hourly temperature, humidity, wind, cloud and precipitation-probability forecasts | U.S., territories and adjacent waters (lat,lon) | None |
smard | prices, load, generation | DE, AT, LU + TSO sub-zones | None |
elia | load, generation | BE | None |
neso | load, embedded generation, actual/forecast CO2, generation shares | GB | None |
elexon | prices, generation mix | GB | None |
entsog | gas flows, capacity | All ENTSOG operators | None |
entsoe | prices, load, generation | All ENTSO-E bidding zones | ENTSOE_API_KEY |
tennet | (data fetching coming soon) | NL | TENNET_API_KEY |
Keys for entsoe and tennet are issued by the respective upstream provider.
Store them via a clarigrid.energy account or
set them manually as described in API key setup.
External providers subclass DataProvider, declare their zones() and
capabilities(), and self-register on import. Providers whose capabilities
have different geographical coverage can additionally override
capability_zones():
After cg.connect("nordpool"), calls to cg.get_prices("NO1", …) route
to this provider automatically.
Apache 2.0 — see LICENSE.
Copyright (c) 2026 Alexander Hoogsteyn.