Skip to content

Commit eada670

Browse files
committed
add power tariff to price api docs
1 parent e6f66d0 commit eada670

File tree

1 file changed

+133
-1
lines changed

1 file changed

+133
-1
lines changed

docs/developer/price-api.md

Lines changed: 133 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,24 @@ pagination_prev: null
66

77
# Price API Developer Guide
88

9-
## Overview
9+
* [Price API Developer Guide](#price-api-developer-guide)
10+
* [Overview](#overview)
11+
* [Base URL](#base-url)
12+
* [Endpoints](#endpoints)
13+
* [Get Electricity Prices](#get-electricity-prices)
14+
* [Default Provider](#default-provider)
15+
* [Specific Provider](#specific-provider)
16+
* [List Supported Areas](#list-supported-areas)
17+
* [List Available Providers](#list-available-providers)
18+
* [Power Tariffs](#power-tariffs)
19+
* [List Power Tariff Providers](#list-power-tariff-providers)
20+
* [Get Tariff Information](#get-tariff-information)
21+
* [Get Pricing Rules](#get-pricing-rules)
22+
* [Calculate Power Price](#calculate-power-price)
23+
* [Health Check](#health-check)
24+
* [Supported Areas](#supported-areas)
25+
* [Error Responses](#error-responses)
26+
* [Data Availability](#data-availability)
1027

1128
REST API for accessing electricity prices from multiple providers. Returns today's prices and day-ahead prices (available after 11:00 UTC) in either raw XML format or unified JSON format.
1229

@@ -121,6 +138,121 @@ GET /price/providers
121138
}
122139
```
123140

141+
### Power Tariffs
142+
143+
#### List Power Tariff Providers
144+
145+
```http
146+
GET /price/power-tariff/providers
147+
```
148+
149+
**Response:**
150+
151+
```json
152+
{
153+
"supported_providers": [
154+
{
155+
"provider": "ellevio",
156+
"provider_display_name": "Ellevio"
157+
},
158+
{
159+
"provider": "goteborg_energi",
160+
"provider_display_name": "Göteborg Energi"
161+
}
162+
],
163+
"total_count": 2
164+
}
165+
```
166+
167+
#### Get Tariff Information
168+
169+
```http
170+
GET /price/power-tariff/{provider}
171+
```
172+
173+
**Parameters:**
174+
175+
- `provider` (required): Provider identifier (e.g., `ellevio`, `goteborg_energi`)
176+
177+
#### Get Pricing Rules
178+
179+
```http
180+
GET /price/power-tariff/{provider}/rules
181+
```
182+
183+
Returns detailed pricing rules including time-based pricing and peak calculations.
184+
185+
**Response:**
186+
187+
```json
188+
{
189+
"provider": "Göteborg Energi",
190+
"country": "Sweden",
191+
"currency": "SEK",
192+
"fuse_sizes": ["16A", "20A", "25A", "35A", "50A", "63A"],
193+
"pricing_rules": {
194+
"winter_high": {
195+
"description": "High price during winter weekdays",
196+
"season": {"start_month": 11, "end_month": 3},
197+
"time_range": {"start": "07:00", "end": "20:00"},
198+
"days": "weekdays_non_holidays",
199+
"price_per_kw": 132
200+
},
201+
"summer_all": {
202+
"description": "Low price all day during summer",
203+
"season": {"start_month": 4, "end_month": 10},
204+
"time_range": {"start": "00:00", "end": "23:59"},
205+
"days": "all_days",
206+
"price_per_kw": 0
207+
}
208+
},
209+
"num_peaks": 3,
210+
"holidays": ["2025-01-01", "2025-01-06", "..."],
211+
"note": "Price varies by time of day and season. Uses winter time (CET) all year. Cost based on average of three highest peaks."
212+
}
213+
```
214+
215+
#### Calculate Power Price
216+
217+
```http
218+
GET /price/power-tariff/{provider}/calculate?timestamp={iso_datetime}&fuse_size={size}
219+
```
220+
221+
Calculate power price for a specific timestamp and fuse size.
222+
223+
**Parameters:**
224+
225+
- `provider` (required): Provider identifier
226+
- `timestamp` (required): ISO datetime (e.g., `2025-01-15T10:30:00`)
227+
- `fuse_size` (optional): Fuse size (e.g., `16A`, `20A`)
228+
229+
**Example:**
230+
231+
```bash
232+
curl "https://mainnet.srcful.dev/price/power-tariff/goteborg_energi/calculate?timestamp=2025-04-30T23:30:00&fuse_size=16A"
233+
```
234+
235+
**Response:**
236+
237+
```json
238+
{
239+
"provider": "Göteborg Energi",
240+
"timestamp": "2025-04-30T23:30:00",
241+
"currency": "SEK",
242+
"fuse_size": "16A",
243+
"applied_rules": [
244+
{
245+
"rule": "summer_all",
246+
"description": "Low price all day during summer",
247+
"price": 0
248+
}
249+
],
250+
"base_price_per_kw": 132,
251+
"final_price_per_kw": 0,
252+
"multiplier": 0
253+
}
254+
```
255+
124256
### Health Check
125257

126258
```http

0 commit comments

Comments
 (0)