Post Forecast
curl --request POST \
--url https://{your-service-host}/v1/forecasts \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"delivery_day": "2023-12-25",
"series": [
{
"values": [
123
],
"malo": "<string>"
}
],
"unit": "MW",
"malo_mapping": {}
}
'import requests
url = "https://{your-service-host}/v1/forecasts"
payload = {
"delivery_day": "2023-12-25",
"series": [
{
"values": [123],
"malo": "<string>"
}
],
"unit": "MW",
"malo_mapping": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
delivery_day: '2023-12-25',
series: [{values: [123], malo: '<string>'}],
unit: 'MW',
malo_mapping: {}
})
};
fetch('https://{your-service-host}/v1/forecasts', 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://{your-service-host}/v1/forecasts",
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([
'delivery_day' => '2023-12-25',
'series' => [
[
'values' => [
123
],
'malo' => '<string>'
]
],
'unit' => 'MW',
'malo_mapping' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://{your-service-host}/v1/forecasts"
payload := strings.NewReader("{\n \"delivery_day\": \"2023-12-25\",\n \"series\": [\n {\n \"values\": [\n 123\n ],\n \"malo\": \"<string>\"\n }\n ],\n \"unit\": \"MW\",\n \"malo_mapping\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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://{your-service-host}/v1/forecasts")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"delivery_day\": \"2023-12-25\",\n \"series\": [\n {\n \"values\": [\n 123\n ],\n \"malo\": \"<string>\"\n }\n ],\n \"unit\": \"MW\",\n \"malo_mapping\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-service-host}/v1/forecasts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"delivery_day\": \"2023-12-25\",\n \"series\": [\n {\n \"values\": [\n 123\n ],\n \"malo\": \"<string>\"\n }\n ],\n \"unit\": \"MW\",\n \"malo_mapping\": {}\n}"
response = http.request(request)
puts response.read_body{
"delivery_day": "2023-12-25",
"interval_count": 123,
"series_received": 123,
"total_production_mwh": 123,
"total_consumption_mwh": 123,
"input_hash": "<string>",
"status": "received"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}API Reference
Post Forecast
Submit the portfolio forecast for one delivery day.
The forecast is validated and acknowledged immediately. Re-submitting for the same delivery day replaces the previous submission.
POST
/
v1
/
forecasts
Post Forecast
curl --request POST \
--url https://{your-service-host}/v1/forecasts \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"delivery_day": "2023-12-25",
"series": [
{
"values": [
123
],
"malo": "<string>"
}
],
"unit": "MW",
"malo_mapping": {}
}
'import requests
url = "https://{your-service-host}/v1/forecasts"
payload = {
"delivery_day": "2023-12-25",
"series": [
{
"values": [123],
"malo": "<string>"
}
],
"unit": "MW",
"malo_mapping": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
delivery_day: '2023-12-25',
series: [{values: [123], malo: '<string>'}],
unit: 'MW',
malo_mapping: {}
})
};
fetch('https://{your-service-host}/v1/forecasts', 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://{your-service-host}/v1/forecasts",
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([
'delivery_day' => '2023-12-25',
'series' => [
[
'values' => [
123
],
'malo' => '<string>'
]
],
'unit' => 'MW',
'malo_mapping' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://{your-service-host}/v1/forecasts"
payload := strings.NewReader("{\n \"delivery_day\": \"2023-12-25\",\n \"series\": [\n {\n \"values\": [\n 123\n ],\n \"malo\": \"<string>\"\n }\n ],\n \"unit\": \"MW\",\n \"malo_mapping\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<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://{your-service-host}/v1/forecasts")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"delivery_day\": \"2023-12-25\",\n \"series\": [\n {\n \"values\": [\n 123\n ],\n \"malo\": \"<string>\"\n }\n ],\n \"unit\": \"MW\",\n \"malo_mapping\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-service-host}/v1/forecasts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"delivery_day\": \"2023-12-25\",\n \"series\": [\n {\n \"values\": [\n 123\n ],\n \"malo\": \"<string>\"\n }\n ],\n \"unit\": \"MW\",\n \"malo_mapping\": {}\n}"
response = http.request(request)
puts response.read_body{
"delivery_day": "2023-12-25",
"interval_count": 123,
"series_received": 123,
"total_production_mwh": 123,
"total_consumption_mwh": 123,
"input_hash": "<string>",
"status": "received"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Portfolio forecast for one delivery day: production and consumption time series per control area (or per market location).
Response
Successful Response
Acknowledgment of an accepted forecast submission, including the total daily volumes as received and a reference for the submission.
Total production energy submitted for the delivery day, in MWh
Total consumption energy submitted for the delivery day, in MWh
Content hash used for change detection
Allowed value:
"received"⌘I