Type Reference
TypeScript type definitions for the OpenElectricity client
Type Reference
The OpenElectricity client uses TypeScript to provide type safety and better developer experience. This page documents all the types used in the client.
Network Types
NetworkCode
Represents the supported electricity networks:
NEM
: National Electricity Market (Eastern and Southern Australia)WEM
: Western Australian Electricity MarketAU
: Australia-wide (defaults to NEM timezone)
DataInterval
Supported time intervals for data aggregation:
5m
: 5-minute intervals1h
: Hourly intervals1d
: Daily intervals7d
: Weekly intervals1M
: Monthly intervals3M
: Quarterly intervalsseason
: Seasonal intervalsanal1y
: Yearly intervalsfy
: Financial year intervals
Metric Types
DataMetric
Metrics available for network and facility data:
power
: Instantaneous power output (MW)energy
: Energy generated (MWh)emissions
: CO2 equivalent emissions (tCO2e)market_value
: Market value ($)
MarketMetric
Metrics available for market data:
price
: Market price ($/MWh)demand
: Instantaneous demand (MW)demand_energy
: Energy demand (MWh)
Grouping Types
DataPrimaryGrouping
Primary grouping options for data aggregation:
DataSecondaryGrouping
Secondary grouping options for data aggregation:
Parameter Types
INetworkTimeSeriesParams
Parameters for network data queries:
IFacilityTimeSeriesParams
Parameters for facility data queries:
IMarketTimeSeriesParams
Parameters for market data queries:
IFacilityParams
Parameters for facility queries:
Response Types
ITimeSeriesResponse
Standard response type for time series data:
INetworkTimeSeries
Network time series data structure:
IFacility
Facility information structure:
IFacilityDataRow
Structure for facility data rows:
Data Analysis Types
IDataTableRow
Structure for data table rows:
Error Types
OpenElectricityError
Custom error type for API errors:
NoDataFound
Error type for when no data matches the query (416 status):