Skip to main content
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
  ]
}

Authorizations

Authorization
string
header
required

Body

application/json

Request body for creating or updating a profile.

end_time
string<date-time>
required

End of the timeseries period (exclusive).

name
string
required

Human-readable name.

resolution
enum<string>
required

Temporal resolution of the values.

Available options:
quarter_hourly,
hourly,
daily,
weekly,
monthly,
yearly
start_time
string<date-time>
required

Start of the timeseries period (inclusive).

unit
enum<string>
required

Unit of measurement for the values.

Available options:
A,
kV,
kW,
kWh,
hours,
SEK,
NOK,
EUR,
SEK_per_kWh,
SEK_per_kW,
NOK_per_kWh,
NOK_per_kW,
EUR_per_kWh,
EUR_per_kW,
%
values
(number | null)[]
required

Timeseries values aligned to the resolution and time range. Length must match the expected number of intervals. null entries represent missing data points.

Maximum array length: 35136
description
string | null

Optional description.

tags
string[]

Tags for categorizing and filtering profiles.

Response

Successful Response

Full profile including timeseries values.

created_at
string<date-time>
required

Timestamp when the profile was created.

end_time
string<date-time>
required

End of the timeseries period (exclusive).

id
string<uuid>
required

Unique identifier for the profile.

name
string
required

Human-readable name.

resolution
enum<string>
required

Temporal resolution of the values. May differ from native resolution if downsampled.

Available options:
quarter_hourly,
hourly,
daily,
weekly,
monthly,
yearly
scope
enum<string>
required

Whether this is a global profile or owned by an organization.

Available options:
global,
org
start_time
string<date-time>
required

Start of the timeseries period (inclusive).

tags
string[]
required

Tags for categorizing and filtering profiles.

unit
enum<string>
required

Unit of measurement for the values.

Available options:
A,
kV,
kW,
kWh,
hours,
SEK,
NOK,
EUR,
SEK_per_kWh,
SEK_per_kW,
NOK_per_kWh,
NOK_per_kW,
EUR_per_kWh,
EUR_per_kW,
%
values
(number | null)[]
required

Timeseries values aligned to the resolution and time range. null entries represent missing data points.

description
string | null

Optional description.