Client Initialization
The Python SDK provides both synchronous and asynchronous clients.Synchronous Client
Asynchronous Client
Network Data
Fetch network-level time series data for power, energy, emissions, and market value metrics.get_network_data
Market Data
Fetch market-related metrics including price, demand, and curtailment.get_market
Available Market Metrics
Price and Demand:MarketMetric.PRICE
- Electricity spot price ($/MWh)MarketMetric.DEMAND
- Electricity demand (MW)MarketMetric.DEMAND_ENERGY
- Electricity demand energy (MWh)
MarketMetric.CURTAILMENT
- Total curtailment across all renewablesMarketMetric.CURTAILMENT_SOLAR_UTILITY
- Utility solar generation curtailedMarketMetric.CURTAILMENT_WIND
- Wind generation curtailed
MarketMetric.CURTAILMENT_ENERGY
- Total curtailed energyMarketMetric.CURTAILMENT_SOLAR_UTILITY_ENERGY
- Utility solar energy curtailedMarketMetric.CURTAILMENT_WIND_ENERGY
- Wind energy curtailed
Examples
Fetch Real-time Curtailment (5-minute intervals):Facility Data
get_facility_data
Fetch facility-specific time series data.Facility Information
get_facilities
Get information about generation facilities and their units.Data Analysis
Converting to DataFrames
The SDK provides built-in support for converting responses to Pandas and Polars DataFrames.Pandas Integration
Polars Integration
Error Handling
The SDK provides comprehensive error handling with detailed error messages.Best Practices
-
Use environment variables for API credentials:
-
Use context managers to ensure proper resource cleanup:
-
Omit date_end to get the latest available data:
-
Choose appropriate intervals:
- Use
"5m"
for real-time power monitoring - Use
"1h"
for hourly aggregations - Use
"1d"
for daily energy totals - Use energy metrics (MWh) for longer periods
- Use
-
Handle large datasets efficiently: