Create a profile
curl --request POST \
--url https://api.engrate.io/cost-of-energy/v1/profiles \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Nord Pool day-ahead prices for SE3.",
"end_time": "2025-01-01T03:00:00+01:00",
"name": "Hourly spot price SE3 2025",
"resolution": "hourly",
"start_time": "2025-01-01T00:00:00+01:00",
"tags": [
"spot-price",
"SE3"
],
"unit": "SEK/kWh",
"values": [
0.45,
0.52,
0.38
]
}
'import requests
url = "https://api.engrate.io/cost-of-energy/v1/profiles"
payload = {
"description": "Nord Pool day-ahead prices for SE3.",
"end_time": "2025-01-01T03:00:00+01:00",
"name": "Hourly spot price SE3 2025",
"resolution": "hourly",
"start_time": "2025-01-01T00:00:00+01:00",
"tags": ["spot-price", "SE3"],
"unit": "SEK/kWh",
"values": [0.45, 0.52, 0.38]
}
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({
description: 'Nord Pool day-ahead prices for SE3.',
end_time: '2025-01-01T03:00:00+01:00',
name: 'Hourly spot price SE3 2025',
resolution: 'hourly',
start_time: '2025-01-01T00:00:00+01:00',
tags: ['spot-price', 'SE3'],
unit: 'SEK/kWh',
values: [0.45, 0.52, 0.38]
})
};
fetch('https://api.engrate.io/cost-of-energy/v1/profiles', 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/profiles",
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([
'description' => 'Nord Pool day-ahead prices for SE3.',
'end_time' => '2025-01-01T03:00:00+01:00',
'name' => 'Hourly spot price SE3 2025',
'resolution' => 'hourly',
'start_time' => '2025-01-01T00:00:00+01:00',
'tags' => [
'spot-price',
'SE3'
],
'unit' => 'SEK/kWh',
'values' => [
0.45,
0.52,
0.38
]
]),
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/profiles"
payload := strings.NewReader("{\n \"description\": \"Nord Pool day-ahead prices for SE3.\",\n \"end_time\": \"2025-01-01T03:00:00+01:00\",\n \"name\": \"Hourly spot price SE3 2025\",\n \"resolution\": \"hourly\",\n \"start_time\": \"2025-01-01T00:00:00+01:00\",\n \"tags\": [\n \"spot-price\",\n \"SE3\"\n ],\n \"unit\": \"SEK/kWh\",\n \"values\": [\n 0.45,\n 0.52,\n 0.38\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/profiles")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Nord Pool day-ahead prices for SE3.\",\n \"end_time\": \"2025-01-01T03:00:00+01:00\",\n \"name\": \"Hourly spot price SE3 2025\",\n \"resolution\": \"hourly\",\n \"start_time\": \"2025-01-01T00:00:00+01:00\",\n \"tags\": [\n \"spot-price\",\n \"SE3\"\n ],\n \"unit\": \"SEK/kWh\",\n \"values\": [\n 0.45,\n 0.52,\n 0.38\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engrate.io/cost-of-energy/v1/profiles")
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 \"description\": \"Nord Pool day-ahead prices for SE3.\",\n \"end_time\": \"2025-01-01T03:00:00+01:00\",\n \"name\": \"Hourly spot price SE3 2025\",\n \"resolution\": \"hourly\",\n \"start_time\": \"2025-01-01T00:00:00+01:00\",\n \"tags\": [\n \"spot-price\",\n \"SE3\"\n ],\n \"unit\": \"SEK/kWh\",\n \"values\": [\n 0.45,\n 0.52,\n 0.38\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2026-01-02T12:00:00Z",
"description": "Nord Pool day-ahead prices for SE3.",
"end_time": "2025-01-01T03:00:00+01:00",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Hourly spot price SE3 2025",
"resolution": "hourly",
"scope": "org",
"start_time": "2025-01-01T00:00:00+01:00",
"tags": [
"spot-price",
"SE3"
],
"unit": "SEK/kWh",
"values": [
0.45,
0.52,
0.38
]
}Tariffs
Create a profile
Create a new profile owned by the caller’s organization. The number of values must match the expected count for the given time range and resolution.
POST
/
cost-of-energy
/
v1
/
profiles
Create a profile
curl --request POST \
--url https://api.engrate.io/cost-of-energy/v1/profiles \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Nord Pool day-ahead prices for SE3.",
"end_time": "2025-01-01T03:00:00+01:00",
"name": "Hourly spot price SE3 2025",
"resolution": "hourly",
"start_time": "2025-01-01T00:00:00+01:00",
"tags": [
"spot-price",
"SE3"
],
"unit": "SEK/kWh",
"values": [
0.45,
0.52,
0.38
]
}
'import requests
url = "https://api.engrate.io/cost-of-energy/v1/profiles"
payload = {
"description": "Nord Pool day-ahead prices for SE3.",
"end_time": "2025-01-01T03:00:00+01:00",
"name": "Hourly spot price SE3 2025",
"resolution": "hourly",
"start_time": "2025-01-01T00:00:00+01:00",
"tags": ["spot-price", "SE3"],
"unit": "SEK/kWh",
"values": [0.45, 0.52, 0.38]
}
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({
description: 'Nord Pool day-ahead prices for SE3.',
end_time: '2025-01-01T03:00:00+01:00',
name: 'Hourly spot price SE3 2025',
resolution: 'hourly',
start_time: '2025-01-01T00:00:00+01:00',
tags: ['spot-price', 'SE3'],
unit: 'SEK/kWh',
values: [0.45, 0.52, 0.38]
})
};
fetch('https://api.engrate.io/cost-of-energy/v1/profiles', 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/profiles",
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([
'description' => 'Nord Pool day-ahead prices for SE3.',
'end_time' => '2025-01-01T03:00:00+01:00',
'name' => 'Hourly spot price SE3 2025',
'resolution' => 'hourly',
'start_time' => '2025-01-01T00:00:00+01:00',
'tags' => [
'spot-price',
'SE3'
],
'unit' => 'SEK/kWh',
'values' => [
0.45,
0.52,
0.38
]
]),
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/profiles"
payload := strings.NewReader("{\n \"description\": \"Nord Pool day-ahead prices for SE3.\",\n \"end_time\": \"2025-01-01T03:00:00+01:00\",\n \"name\": \"Hourly spot price SE3 2025\",\n \"resolution\": \"hourly\",\n \"start_time\": \"2025-01-01T00:00:00+01:00\",\n \"tags\": [\n \"spot-price\",\n \"SE3\"\n ],\n \"unit\": \"SEK/kWh\",\n \"values\": [\n 0.45,\n 0.52,\n 0.38\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/profiles")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Nord Pool day-ahead prices for SE3.\",\n \"end_time\": \"2025-01-01T03:00:00+01:00\",\n \"name\": \"Hourly spot price SE3 2025\",\n \"resolution\": \"hourly\",\n \"start_time\": \"2025-01-01T00:00:00+01:00\",\n \"tags\": [\n \"spot-price\",\n \"SE3\"\n ],\n \"unit\": \"SEK/kWh\",\n \"values\": [\n 0.45,\n 0.52,\n 0.38\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engrate.io/cost-of-energy/v1/profiles")
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 \"description\": \"Nord Pool day-ahead prices for SE3.\",\n \"end_time\": \"2025-01-01T03:00:00+01:00\",\n \"name\": \"Hourly spot price SE3 2025\",\n \"resolution\": \"hourly\",\n \"start_time\": \"2025-01-01T00:00:00+01:00\",\n \"tags\": [\n \"spot-price\",\n \"SE3\"\n ],\n \"unit\": \"SEK/kWh\",\n \"values\": [\n 0.45,\n 0.52,\n 0.38\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2026-01-02T12:00:00Z",
"description": "Nord Pool day-ahead prices for SE3.",
"end_time": "2025-01-01T03:00:00+01:00",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Hourly spot price SE3 2025",
"resolution": "hourly",
"scope": "org",
"start_time": "2025-01-01T00:00:00+01:00",
"tags": [
"spot-price",
"SE3"
],
"unit": "SEK/kWh",
"values": [
0.45,
0.52,
0.38
]
}Body
application/json
Request body for creating or updating a profile.
Response
Successful Response
Full profile including timeseries values.
Was this page helpful?