Skip to main content
GET
/
api
/
v1
/
aggregated-data
/
aggregated-prices
Aggregated electricity prices
curl --request GET \
  --url https://api.partner.cubee.cz/api/v1/aggregated-data/aggregated-prices \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.partner.cubee.cz/api/v1/aggregated-data/aggregated-prices"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.partner.cubee.cz/api/v1/aggregated-data/aggregated-prices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.partner.cubee.cz/api/v1/aggregated-data/aggregated-prices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.partner.cubee.cz/api/v1/aggregated-data/aggregated-prices"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.partner.cubee.cz/api/v1/aggregated-data/aggregated-prices")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.partner.cubee.cz/api/v1/aggregated-data/aggregated-prices")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "from": "2023-11-07T05:31:56Z",
  "to": "2023-11-07T05:31:56Z",
  "periods": [
    {
      "date": "2023-12-25",
      "totalBuyEnergyMWh": 123,
      "totalBuyFullPrice": 123,
      "totalBuyPowerPrice": 123,
      "totalSellEnergyMWh": 123,
      "totalSellFullPrice": 123,
      "totalSellPowerPrice": 123
    }
  ],
  "currency": "<string>"
}
"<string>"
"<string>"

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"

Query Parameters

from
string<date-time>
required

The start of the requested period for aggregated prices, including date and time in UTC.

to
string<date-time>
required

The end of the requested period for aggregated prices, including date and time in UTC.

cubeeSNs
string[]

List of serial numbers of Cubee devices to filter the results.

granularity
string
required

Aggregation level. Allowed values: daily, monthly, all.

Pattern: ^(daily|monthly|all)$

Response

OK

from
string<date-time>

The start of the requested period for aggregated prices, including date and time in UTC.

to
string<date-time>

The end of the requested period for aggregated prices, including date and time in UTC.

periods
object[] | null

List of aggregated price periods within the specified date range, based on the chosen granularity (e.g., daily, monthly).

currency
string | null

The currency in which the prices are expressed, following the ISO 4217 currency codes. Default is "CZK".