curl --request POST \
--url https://api.suntropy.ai/v2/forecasts/power-curve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"curve": {
"days": [
{
"date": "2026-11-01",
"valuesList": {
"9": 1.2,
"10": 2.3,
"11": 3.1
}
}
]
},
"series": [
[
"2026-11-01",
29
],
[
"2026-11-02",
32.9
]
],
"mode": "forecast",
"granularity": "day",
"horizon": 123,
"latitude": 123,
"longitude": 123,
"confidenceLevel": 0.8,
"refresh": false
}
'import requests
url = "https://api.suntropy.ai/v2/forecasts/power-curve"
payload = {
"curve": { "days": [
{
"date": "2026-11-01",
"valuesList": {
"9": 1.2,
"10": 2.3,
"11": 3.1
}
}
] },
"series": [["2026-11-01", 29], ["2026-11-02", 32.9]],
"mode": "forecast",
"granularity": "day",
"horizon": 123,
"latitude": 123,
"longitude": 123,
"confidenceLevel": 0.8,
"refresh": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
curve: {days: [{date: '2026-11-01', valuesList: {'9': 1.2, '10': 2.3, '11': 3.1}}]},
series: [['2026-11-01', 29], ['2026-11-02', 32.9]],
mode: 'forecast',
granularity: 'day',
horizon: 123,
latitude: 123,
longitude: 123,
confidenceLevel: 0.8,
refresh: false
})
};
fetch('https://api.suntropy.ai/v2/forecasts/power-curve', 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.suntropy.ai/v2/forecasts/power-curve",
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([
'curve' => [
'days' => [
[
'date' => '2026-11-01',
'valuesList' => [
'9' => 1.2,
'10' => 2.3,
'11' => 3.1
]
]
]
],
'series' => [
[
'2026-11-01',
29
],
[
'2026-11-02',
32.9
]
],
'mode' => 'forecast',
'granularity' => 'day',
'horizon' => 123,
'latitude' => 123,
'longitude' => 123,
'confidenceLevel' => 0.8,
'refresh' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.suntropy.ai/v2/forecasts/power-curve"
payload := strings.NewReader("{\n \"curve\": {\n \"days\": [\n {\n \"date\": \"2026-11-01\",\n \"valuesList\": {\n \"9\": 1.2,\n \"10\": 2.3,\n \"11\": 3.1\n }\n }\n ]\n },\n \"series\": [\n [\n \"2026-11-01\",\n 29\n ],\n [\n \"2026-11-02\",\n 32.9\n ]\n ],\n \"mode\": \"forecast\",\n \"granularity\": \"day\",\n \"horizon\": 123,\n \"latitude\": 123,\n \"longitude\": 123,\n \"confidenceLevel\": 0.8,\n \"refresh\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.suntropy.ai/v2/forecasts/power-curve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"curve\": {\n \"days\": [\n {\n \"date\": \"2026-11-01\",\n \"valuesList\": {\n \"9\": 1.2,\n \"10\": 2.3,\n \"11\": 3.1\n }\n }\n ]\n },\n \"series\": [\n [\n \"2026-11-01\",\n 29\n ],\n [\n \"2026-11-02\",\n 32.9\n ]\n ],\n \"mode\": \"forecast\",\n \"granularity\": \"day\",\n \"horizon\": 123,\n \"latitude\": 123,\n \"longitude\": 123,\n \"confidenceLevel\": 0.8,\n \"refresh\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.suntropy.ai/v2/forecasts/power-curve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"curve\": {\n \"days\": [\n {\n \"date\": \"2026-11-01\",\n \"valuesList\": {\n \"9\": 1.2,\n \"10\": 2.3,\n \"11\": 3.1\n }\n }\n ]\n },\n \"series\": [\n [\n \"2026-11-01\",\n 29\n ],\n [\n \"2026-11-02\",\n 32.9\n ]\n ],\n \"mode\": \"forecast\",\n \"granularity\": \"day\",\n \"horizon\": 123,\n \"latitude\": 123,\n \"longitude\": 123,\n \"confidenceLevel\": 0.8,\n \"refresh\": false\n}"
response = http.request(request)
puts response.read_body{
"data": "<unknown>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warning": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Forecast a power curve
Required permission: calculations:write.
Predicts the next days or hours of a curve (production, consumption…) with a p10-p90 band, or backtests its last points. For production curves, pass latitude/longitude to use the solar irradiance as covariate. Results are kept 7 days.
curl --request POST \
--url https://api.suntropy.ai/v2/forecasts/power-curve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"curve": {
"days": [
{
"date": "2026-11-01",
"valuesList": {
"9": 1.2,
"10": 2.3,
"11": 3.1
}
}
]
},
"series": [
[
"2026-11-01",
29
],
[
"2026-11-02",
32.9
]
],
"mode": "forecast",
"granularity": "day",
"horizon": 123,
"latitude": 123,
"longitude": 123,
"confidenceLevel": 0.8,
"refresh": false
}
'import requests
url = "https://api.suntropy.ai/v2/forecasts/power-curve"
payload = {
"curve": { "days": [
{
"date": "2026-11-01",
"valuesList": {
"9": 1.2,
"10": 2.3,
"11": 3.1
}
}
] },
"series": [["2026-11-01", 29], ["2026-11-02", 32.9]],
"mode": "forecast",
"granularity": "day",
"horizon": 123,
"latitude": 123,
"longitude": 123,
"confidenceLevel": 0.8,
"refresh": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
curve: {days: [{date: '2026-11-01', valuesList: {'9': 1.2, '10': 2.3, '11': 3.1}}]},
series: [['2026-11-01', 29], ['2026-11-02', 32.9]],
mode: 'forecast',
granularity: 'day',
horizon: 123,
latitude: 123,
longitude: 123,
confidenceLevel: 0.8,
refresh: false
})
};
fetch('https://api.suntropy.ai/v2/forecasts/power-curve', 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.suntropy.ai/v2/forecasts/power-curve",
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([
'curve' => [
'days' => [
[
'date' => '2026-11-01',
'valuesList' => [
'9' => 1.2,
'10' => 2.3,
'11' => 3.1
]
]
]
],
'series' => [
[
'2026-11-01',
29
],
[
'2026-11-02',
32.9
]
],
'mode' => 'forecast',
'granularity' => 'day',
'horizon' => 123,
'latitude' => 123,
'longitude' => 123,
'confidenceLevel' => 0.8,
'refresh' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.suntropy.ai/v2/forecasts/power-curve"
payload := strings.NewReader("{\n \"curve\": {\n \"days\": [\n {\n \"date\": \"2026-11-01\",\n \"valuesList\": {\n \"9\": 1.2,\n \"10\": 2.3,\n \"11\": 3.1\n }\n }\n ]\n },\n \"series\": [\n [\n \"2026-11-01\",\n 29\n ],\n [\n \"2026-11-02\",\n 32.9\n ]\n ],\n \"mode\": \"forecast\",\n \"granularity\": \"day\",\n \"horizon\": 123,\n \"latitude\": 123,\n \"longitude\": 123,\n \"confidenceLevel\": 0.8,\n \"refresh\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.suntropy.ai/v2/forecasts/power-curve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"curve\": {\n \"days\": [\n {\n \"date\": \"2026-11-01\",\n \"valuesList\": {\n \"9\": 1.2,\n \"10\": 2.3,\n \"11\": 3.1\n }\n }\n ]\n },\n \"series\": [\n [\n \"2026-11-01\",\n 29\n ],\n [\n \"2026-11-02\",\n 32.9\n ]\n ],\n \"mode\": \"forecast\",\n \"granularity\": \"day\",\n \"horizon\": 123,\n \"latitude\": 123,\n \"longitude\": 123,\n \"confidenceLevel\": 0.8,\n \"refresh\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.suntropy.ai/v2/forecasts/power-curve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"curve\": {\n \"days\": [\n {\n \"date\": \"2026-11-01\",\n \"valuesList\": {\n \"9\": 1.2,\n \"10\": 2.3,\n \"11\": 3.1\n }\n }\n ]\n },\n \"series\": [\n [\n \"2026-11-01\",\n 29\n ],\n [\n \"2026-11-02\",\n 32.9\n ]\n ],\n \"mode\": \"forecast\",\n \"granularity\": \"day\",\n \"horizon\": 123,\n \"latitude\": 123,\n \"longitude\": 123,\n \"confidenceLevel\": 0.8,\n \"refresh\": false\n}"
response = http.request(request)
puts response.read_body{
"data": "<unknown>",
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warning": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"requestId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The curve to forecast (send this or series): a PowerCurve { days: [{ date: "YYYY-MM-DD", valuesList: { "1": kWh, …, "24": kWh } }] } or just the list of days. Hour i is the one from i-1 to i. Any curve works: production, consumption…
{
"days": [
{
"date": "2026-11-01",
"valuesList": { "9": 1.2, "10": 2.3, "11": 3.1 }
}
]
}
Instead of curve: a series of [period, value] pairs, as returned by the Suntropy Connect energy endpoints (get_plant_energy, suntropy connect energy). Periods YYYY-MM-DD (daily) or YYYY-MM-DDTHH:00 (hourly, start of the hour); the granularity follows from them.
[["2026-11-01", 29], ["2026-11-02", 32.9]]
forecast: predict what comes after the end of the curve. backtest: hide the last horizon points, predict them and compare with the real values (error, band coverage, possible anomalies).
forecast, backtest Daily totals or hourly values.
day, hour Points to predict. Days: 1-120 (default 7). Hours: 1-720 (default 48). With the irradiance covariate in forecast mode, 16 days at most (the weather forecast).
irradiance (for production curves): real and forecast solar irradiance at latitude/longitude from Open-Meteo. Default: irradiance when coordinates are given, none otherwise.
none, irradiance Plant latitude (needed for the irradiance covariate).
Plant longitude (needed for the irradiance covariate).
Width of the prediction band (0.8 = p10-p90).
0.5 <= x <= 0.98Recalculate instead of returning the stored result (kept 7 days).