Tariff
The tariff module serves energy prices, in EUR/MWh, as a time series. Use it for the day-ahead market price, or for your own tariff.
Install: pip install "cofy-api[tariff]", plus the extra of the source you use.
Settings
Section titled “Settings”| Field | What it is |
|---|---|
source |
Where the prices come from. Required. |
formats |
The formats to offer: json, csv and kiwatt. JSON and CSV if left out. |
And the settings every module has.
Sources
Section titled “Sources”| Source | Prices |
|---|---|
entsoe_day_ahead |
The day-ahead market price of a bidding zone |
energy_cost |
Your own tariff, fixed or following an index |
demo_price |
Generated prices, to try things out |
Asking for prices
Section titled “Asking for prices”GET /tariff/{name}/v1, with the usual time series parameters. Unlike the other modules, a tariff looks ahead: without parameters you get the next three days, from the current quarter-hour, in steps of 15 minutes.
The Kiwatt format
Section titled “The Kiwatt format”The kiwatt format serves prices in the shape Kiwatt expects:
{ "generatedAtUTC": "…", "periodStartUTC": "…", "periodEndUTC": "…", "source": "Cofy-API-Demo", "unit": "EUR/MWh", "resolution": "PT15M", "prices": [{ "startUTC": "…", "value": 92.4 }]}Its one setting, source, is the name written into the answer.
Example
Section titled “Example”Belgian day-ahead prices in the Kiwatt format, at /tariff/kiwatt/v1:
type: tariffname: kiwattsource: type: entsoe_day_ahead country_code: BE api_key: { type: secret, name: entsoe_key }formats: - type: kiwattTo serve the same prices in JSON from a second module, without fetching them twice, make the source a shared resource.