Train Site Models
import requests
url = "https://api.rebase.energy/platform/v2/sites/models/train"
payload = { "site_ids": ["48302759-0371-4d54-9ba1-506708b576fe", "f02918ab-736b-409f-8f86-cbbeec1d6700"] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.rebase.energy/platform/v2/sites/models/train \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"site_ids": [
"48302759-0371-4d54-9ba1-506708b576fe",
"f02918ab-736b-409f-8f86-cbbeec1d6700"
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
site_ids: ['48302759-0371-4d54-9ba1-506708b576fe', 'f02918ab-736b-409f-8f86-cbbeec1d6700']
})
};
fetch('https://api.rebase.energy/platform/v2/sites/models/train', 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.rebase.energy/platform/v2/sites/models/train",
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([
'site_ids' => [
'48302759-0371-4d54-9ba1-506708b576fe',
'f02918ab-736b-409f-8f86-cbbeec1d6700'
]
]),
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.rebase.energy/platform/v2/sites/models/train"
payload := strings.NewReader("{\n \"site_ids\": [\n \"48302759-0371-4d54-9ba1-506708b576fe\",\n \"f02918ab-736b-409f-8f86-cbbeec1d6700\"\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.rebase.energy/platform/v2/sites/models/train")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"site_ids\": [\n \"48302759-0371-4d54-9ba1-506708b576fe\",\n \"f02918ab-736b-409f-8f86-cbbeec1d6700\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rebase.energy/platform/v2/sites/models/train")
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 \"site_ids\": [\n \"48302759-0371-4d54-9ba1-506708b576fe\",\n \"f02918ab-736b-409f-8f86-cbbeec1d6700\"\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}Site
Train Site Models
Train the models for one or more sites, specified by their site_id
POST
/
platform
/
v2
/
sites
/
models
/
train
Train Site Models
import requests
url = "https://api.rebase.energy/platform/v2/sites/models/train"
payload = { "site_ids": ["48302759-0371-4d54-9ba1-506708b576fe", "f02918ab-736b-409f-8f86-cbbeec1d6700"] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.rebase.energy/platform/v2/sites/models/train \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"site_ids": [
"48302759-0371-4d54-9ba1-506708b576fe",
"f02918ab-736b-409f-8f86-cbbeec1d6700"
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
site_ids: ['48302759-0371-4d54-9ba1-506708b576fe', 'f02918ab-736b-409f-8f86-cbbeec1d6700']
})
};
fetch('https://api.rebase.energy/platform/v2/sites/models/train', 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.rebase.energy/platform/v2/sites/models/train",
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([
'site_ids' => [
'48302759-0371-4d54-9ba1-506708b576fe',
'f02918ab-736b-409f-8f86-cbbeec1d6700'
]
]),
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.rebase.energy/platform/v2/sites/models/train"
payload := strings.NewReader("{\n \"site_ids\": [\n \"48302759-0371-4d54-9ba1-506708b576fe\",\n \"f02918ab-736b-409f-8f86-cbbeec1d6700\"\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.rebase.energy/platform/v2/sites/models/train")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"site_ids\": [\n \"48302759-0371-4d54-9ba1-506708b576fe\",\n \"f02918ab-736b-409f-8f86-cbbeec1d6700\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rebase.energy/platform/v2/sites/models/train")
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 \"site_ids\": [\n \"48302759-0371-4d54-9ba1-506708b576fe\",\n \"f02918ab-736b-409f-8f86-cbbeec1d6700\"\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"errors": [
{
"field": "<string>",
"message": "<string>"
}
]
}Authorizations
Your API key. This is required to access our API programatically. You can view your API key in the Rebase dashboard.
Body
application/json
Example:
[
"48302759-0371-4d54-9ba1-506708b576fe",
"f02918ab-736b-409f-8f86-cbbeec1d6700"
]If true, backtest forecasts will be generated for the period of the training data
Example:
false
Show child attributes
Show child attributes
Example:
[
{
"end_date": "2023-08-01T00:00Z",
"start_date": "2023-01-01T00:00Z"
},
{
"end_date": "2024-01-01T00:00Z",
"start_date": "2023-10-01T00:00Z"
}
]If true, the request will wait until the training is completed before returning
Response
Successful Response
The response is of type Response Train Site Models Platform V2 Sites Models Train Post · object.
⌘I