curl --request POST \
--url https://api.engrate.io/cost-of-energy/v1/calculate \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"end_time": "2026-01-01T00:30:00+01:00",
"profiles": [
{
"name": "quarter-hourly-day-ahead-price-se1",
"profile_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
],
"start_time": "2026-01-01T00:00:00+01:00",
"tariff_id": "123e4567-e89b-12d3-a456-426614174000",
"time_series": [
{
"name": "quarter-hourly-energy-offtake",
"values": [
1.5,
1.2
]
}
]
}
'import requests
url = "https://api.engrate.io/cost-of-energy/v1/calculate"
payload = {
"end_time": "2026-01-01T00:30:00+01:00",
"profiles": [
{
"name": "quarter-hourly-day-ahead-price-se1",
"profile_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
],
"start_time": "2026-01-01T00:00:00+01:00",
"tariff_id": "123e4567-e89b-12d3-a456-426614174000",
"time_series": [
{
"name": "quarter-hourly-energy-offtake",
"values": [1.5, 1.2]
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
end_time: '2026-01-01T00:30:00+01:00',
profiles: [
{
name: 'quarter-hourly-day-ahead-price-se1',
profile_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
}
],
start_time: '2026-01-01T00:00:00+01:00',
tariff_id: '123e4567-e89b-12d3-a456-426614174000',
time_series: [{name: 'quarter-hourly-energy-offtake', values: [1.5, 1.2]}]
})
};
fetch('https://api.engrate.io/cost-of-energy/v1/calculate', 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.engrate.io/cost-of-energy/v1/calculate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'end_time' => '2026-01-01T00:30:00+01:00',
'profiles' => [
[
'name' => 'quarter-hourly-day-ahead-price-se1',
'profile_id' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
]
],
'start_time' => '2026-01-01T00:00:00+01:00',
'tariff_id' => '123e4567-e89b-12d3-a456-426614174000',
'time_series' => [
[
'name' => 'quarter-hourly-energy-offtake',
'values' => [
1.5,
1.2
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engrate.io/cost-of-energy/v1/calculate"
payload := strings.NewReader("{\n \"end_time\": \"2026-01-01T00:30:00+01:00\",\n \"profiles\": [\n {\n \"name\": \"quarter-hourly-day-ahead-price-se1\",\n \"profile_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n }\n ],\n \"start_time\": \"2026-01-01T00:00:00+01:00\",\n \"tariff_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"time_series\": [\n {\n \"name\": \"quarter-hourly-energy-offtake\",\n \"values\": [\n 1.5,\n 1.2\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engrate.io/cost-of-energy/v1/calculate")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"end_time\": \"2026-01-01T00:30:00+01:00\",\n \"profiles\": [\n {\n \"name\": \"quarter-hourly-day-ahead-price-se1\",\n \"profile_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n }\n ],\n \"start_time\": \"2026-01-01T00:00:00+01:00\",\n \"tariff_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"time_series\": [\n {\n \"name\": \"quarter-hourly-energy-offtake\",\n \"values\": [\n 1.5,\n 1.2\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engrate.io/cost-of-energy/v1/calculate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"end_time\": \"2026-01-01T00:30:00+01:00\",\n \"profiles\": [\n {\n \"name\": \"quarter-hourly-day-ahead-price-se1\",\n \"profile_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n }\n ],\n \"start_time\": \"2026-01-01T00:00:00+01:00\",\n \"tariff_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"time_series\": [\n {\n \"name\": \"quarter-hourly-energy-offtake\",\n \"values\": [\n 1.5,\n 1.2\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"components": [
{
"end_time": "2026-01-01T00:30:00+01:00",
"name": "Energiskatt",
"start_time": "2026-01-01T00:00:00+01:00",
"time_series": [
{
"name": "cost",
"resolution": "quarter_hourly",
"unit": "SEK",
"values": [
0.54,
0.432
]
}
]
}
]
}Calculate Tariff
Calculate costs for a Tariff.
Executes the calculation pipeline for each tariff component that is active within the requested period. The caller must supply data for every dataset required by the active components, either as inline time_series, persisted profiles, or a combination of both. Dataset names must not overlap between the two inputs.
curl --request POST \
--url https://api.engrate.io/cost-of-energy/v1/calculate \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"end_time": "2026-01-01T00:30:00+01:00",
"profiles": [
{
"name": "quarter-hourly-day-ahead-price-se1",
"profile_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
],
"start_time": "2026-01-01T00:00:00+01:00",
"tariff_id": "123e4567-e89b-12d3-a456-426614174000",
"time_series": [
{
"name": "quarter-hourly-energy-offtake",
"values": [
1.5,
1.2
]
}
]
}
'import requests
url = "https://api.engrate.io/cost-of-energy/v1/calculate"
payload = {
"end_time": "2026-01-01T00:30:00+01:00",
"profiles": [
{
"name": "quarter-hourly-day-ahead-price-se1",
"profile_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
],
"start_time": "2026-01-01T00:00:00+01:00",
"tariff_id": "123e4567-e89b-12d3-a456-426614174000",
"time_series": [
{
"name": "quarter-hourly-energy-offtake",
"values": [1.5, 1.2]
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
end_time: '2026-01-01T00:30:00+01:00',
profiles: [
{
name: 'quarter-hourly-day-ahead-price-se1',
profile_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
}
],
start_time: '2026-01-01T00:00:00+01:00',
tariff_id: '123e4567-e89b-12d3-a456-426614174000',
time_series: [{name: 'quarter-hourly-energy-offtake', values: [1.5, 1.2]}]
})
};
fetch('https://api.engrate.io/cost-of-energy/v1/calculate', 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.engrate.io/cost-of-energy/v1/calculate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'end_time' => '2026-01-01T00:30:00+01:00',
'profiles' => [
[
'name' => 'quarter-hourly-day-ahead-price-se1',
'profile_id' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
]
],
'start_time' => '2026-01-01T00:00:00+01:00',
'tariff_id' => '123e4567-e89b-12d3-a456-426614174000',
'time_series' => [
[
'name' => 'quarter-hourly-energy-offtake',
'values' => [
1.5,
1.2
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engrate.io/cost-of-energy/v1/calculate"
payload := strings.NewReader("{\n \"end_time\": \"2026-01-01T00:30:00+01:00\",\n \"profiles\": [\n {\n \"name\": \"quarter-hourly-day-ahead-price-se1\",\n \"profile_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n }\n ],\n \"start_time\": \"2026-01-01T00:00:00+01:00\",\n \"tariff_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"time_series\": [\n {\n \"name\": \"quarter-hourly-energy-offtake\",\n \"values\": [\n 1.5,\n 1.2\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engrate.io/cost-of-energy/v1/calculate")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"end_time\": \"2026-01-01T00:30:00+01:00\",\n \"profiles\": [\n {\n \"name\": \"quarter-hourly-day-ahead-price-se1\",\n \"profile_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n }\n ],\n \"start_time\": \"2026-01-01T00:00:00+01:00\",\n \"tariff_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"time_series\": [\n {\n \"name\": \"quarter-hourly-energy-offtake\",\n \"values\": [\n 1.5,\n 1.2\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engrate.io/cost-of-energy/v1/calculate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"end_time\": \"2026-01-01T00:30:00+01:00\",\n \"profiles\": [\n {\n \"name\": \"quarter-hourly-day-ahead-price-se1\",\n \"profile_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n }\n ],\n \"start_time\": \"2026-01-01T00:00:00+01:00\",\n \"tariff_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"time_series\": [\n {\n \"name\": \"quarter-hourly-energy-offtake\",\n \"values\": [\n 1.5,\n 1.2\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"components": [
{
"end_time": "2026-01-01T00:30:00+01:00",
"name": "Energiskatt",
"start_time": "2026-01-01T00:00:00+01:00",
"time_series": [
{
"name": "cost",
"resolution": "quarter_hourly",
"unit": "SEK",
"values": [
0.54,
0.432
]
}
]
}
]
}Authorizations
Query Parameters
When true, the response includes all intermediate pipeline time series (e.g. hourly-power-offtake, monthly-peak) in addition to the final cost. When false (default), only the cost time series is returned per component.
Body
End of the calculation period (exclusive). Must include timezone offset and be after start_time. For correct monthly/daily bucketing, align to local midnight in the tariff's timezone.
Start of the calculation period (inclusive). Must include timezone offset. For correct monthly/daily bucketing, align to local midnight in the tariff's timezone (e.g. 2026-01-01T00:00:00+01:00 for Europe/Stockholm).
ID of the tariff to calculate.
Profile references for datasets. Each entry maps a dataset to a persisted profile UUID. Can be combined with time_series.
Show child attributes
Show child attributes
Input time series data for each dataset required by the tariff's active components. Can be combined with profiles.
Show child attributes
Show child attributes
Response
Successful Response
Results per tariff component that is active within the requested period.
Show child attributes
Show child attributes
Was this page helpful?