Introduction
Welcome to Rebase Forecast API!
This documentation will show you how to create sites, upload production data, upload localized weather measurements and access forecasts for your sites.
Authentication
How to include API key in your requests
import requests
# this is just an example request showing how to include the API key
url = 'https://api.rebase.energy/platform/v1/<endpoint>'
headers = {
'GL-API-KEY': your_api_key
}
response = requests.get(url, headers=headers)
const request = require('request');
// this is just an example request showing how to include the API key
const options = {
url: 'https://api.rebase.energy/platform/v1/<endpoint>',
headers: {
'GL-API-KEY': your_api_key
}
};
request(options);
Make sure to replace
your_api_key
with your API key.
Each request to the Platform API must be authenticated with an API key. You can create a new API key in your user profile .
The API key must be included in the header for every request like this:
GL-API-KEY: your_api_key
Base url
All endpoints in this documentation are relative to this base url:
https://api.rebase.energy/platform/v1
For instance, requesting endpoint /site/forecast/latest/<site_id>
should be done to the complete url:
https://api.rebase.energy/platform/v1/site/forecast/latest/<site_id>
Endpoints
Site
Get sites
import requests
url = 'https://api.rebase.energy/platform/v1/sites'
headers = {
'GL-API-KEY': your_api_key
}
response = requests.get(url, headers=headers)
result = response.json()
const request = require('request');
const options = {
url: 'https://api.rebase.energy/platform/v1/sites',
headers: {
'GL-API-KEY': your_api_key
}
};
request(options, (error, response, body) => {
if (response.statusCode === 200){
// do something with data in body
}
})
The request above returns JSON structured like this:
[
{
"site_id": "c7c6c33c-f873-43e5-9012-da12de68b475",
"type": "solar",
"name": "my_site_1",
"latitude": 55.35,
"longitude": 12.13,
"tilt": 10.0,
"azimuth": 172.9,
"capacity": [
{"value": 723.3, "dateEnd": null}
]
}
{
"site_id": "bbaff2b9-7818-4abb-997e-60760cb3160e",
"type": "solar",
"name": "my_site_2",
"latitude": 55.33,
"longitude": 12.12,
"tilt": 11.1,
"azimuth": 175.0,
"capacity": [
{"value": 600.0, "dateEnd": null}
]
}
]
This endpoint retrieves a list of all your sites.
The site ids returned from this endpoint should be used to query other endpoints which require <site_id>
.
HTTP Request
GET /sites
Query Parameters
None
Response
JSON array containing one JSON object per site. Each JSON object has the following attributes:
Attribute | Description |
---|---|
site_id | The id of the site which can be used to request other endpoints. (string) |
name | The name of the site. (string) |
type | Type of site: solar / wind / localized. (string) |
latitude | The latitude value of the site's geographical position. (float) |
longitude | The longitude value of the site's geographical position. (float) |
Solar sites have the following additional attributes:
Attribute | Description |
---|---|
azimuth | Orientation of solar panels in degrees. N = 0, E = 90, S = 180, W = 270. (float) |
tilt | Tilt of solar panels in degrees. 0 to 90. (float) |
capacity | Capacity of the site in kW. dateEnd is the date when the capacity value is no longer valid, null means that the value is currently valid. (JSON array) |
Wind sites have the following additional attributes:
Attribute | Description |
---|---|
capacity | Capacity of the site in kW. dateEnd is the date when the capacity value is no longer valid, null means that the value is currently valid. (JSON array) |
turbines | The wind turbines used by the site (JSON array) |
Localized weather sites have the following additional attributes:
Attribute | Description |
---|---|
measurements | The measurement types for the site (JSON array) |
Status codes
Code | Meaning |
---|---|
200 | Ok |
401 | Unauthorized -- Your API key is wrong. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily not able to handle your request. Try again later. |
Create solar site
import requests
import json
url = 'https://api.rebase.energy/platform/v1/site/create'
headers = {
'GL-API-KEY': your_api_key,
'Content-Type': 'application/json'
}
data = {
'type': 'solar',
'name': 'My solar site',
'latitude': 53.41,
'longitude': 5.94,
'azimuth': 171.3, # 0 = North, 90 = East, 180 = South, 270 = West
'tilt': 10.3,
'capacity': [
{'value': 750.5, 'validFrom': '2019-10-10T00:00:00Z'}, # capacity of site changed to 750.5 kW at this date
{'value': 500.3, 'validFrom': '2019-04-03T00:00:00Z'}, # site was installed at this date
],
}
response = requests.post(url, headers=headers, data=json.dumps(data))
data = response.json()
const request = require('request');
const data = {
type: 'solar',
name: 'My solar site',
latitude: 53.41,
longitude: 5.94,
azimuth: 171.3, // 0 = North, 90 = East, 180 = South, 270 = West
tilt: 10.3,
capacity: [
{value: 750.5, validFrom: '2019-10-10T00:00:00Z'}, // capacity of site changed to 750.5 kW at this date
{value: 500.3, validFrom: '2019-04-03T00:00:00Z'}, // site was installed at this date
],
};
const options = {
url: 'https://api.rebase.energy/platform/v1/site/create',
headers: {
'GL-API-KEY': your_api_key,
'Content-Type': 'application/json'
},
json: data
};
request.post(options, (error, response, body) => {
if (response.statusCode === 200){
// do something with data in body
}
})
The request above returns JSON structured like this:
{
"site_id": "04a24f77-60a0-41da-a844-ec0d7b6b904f"
}
Create a new solar site.
HTTP Request
GET /site/create
Query Parameters
None
Body
The body of the POST request must be a JSON object containing the following:
Attribute | Description |
---|---|
type | solar |
name | Name to give to site |
latitude | latitude of site (-90 to 90) |
longitude | longitude of site (-180 to 180) |
azimuth | orientation of solar panels (0 N, 90 E, 180 S, 270 W) degrees |
tilt | tilt of solar panels (0 to 90) degrees |
capacity | Capacity of site - array of JSON objects. Each JSON object should contain the capacity value in kW and the date (ISO 8601) from which the value is valid from. |
Response
JSON object containing site_id of the created site
Attribute | Description |
---|---|
site_id | id of the created site |
Status codes
Code | Meaning |
---|---|
200 | Ok |
400 | Bad request -- POST data is missing or incorrectly formatted. |
401 | Unauthorized -- Your API key is wrong. |
404 | Not Found -- The site does not exist. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily not able to handle your request. Try again later. |
Create wind site
import requests
import json
url = 'https://api.rebase.energy/platform/v1/site/create'
headers = {
'GL-API-KEY': your_api_key,
'Content-Type': 'application/json'
}
data = {
'type': 'wind',
'name': 'My wind site',
'latitude': 53.41,
'longitude': 5.94,
'capacity': [
{'value': 4000, 'validFrom': '2019-10-10T00:00:00Z'}, # capacity of site changed to 4000 kW at this date
{'value': 2000, 'validFrom': '2019-04-03T00:00:00Z'}, # site was installed at this date
],
}
response = requests.post(url, headers=headers, data=json.dumps(data))
data = response.json()
const request = require('request');
const data = {
type: 'wind',
name: 'My wind site',
latitude: 53.41,
longitude: 5.94,
capacity: [
{value: 4000, validFrom: '2019-10-10T00:00:00Z'}, // capacity of site changed to 4000 kW at this date
{value: 2000, validFrom: '2019-04-03T00:00:00Z'}, // site was installed at this date
],
};
const options = {
url: 'https://api.rebase.energy/platform/v1/site/create',
headers: {
'GL-API-KEY': your_api_key,
'Content-Type': 'application/json'
},
json: data
};
request.post(options, (error, response, body) => {
if (response.statusCode === 200){
// do something with data in body
}
})
The request above returns JSON structured like this:
{
"site_id": "04a24f77-60a0-41da-a844-ec0d7b6b904f"
}
Create a new wind site.
HTTP Request
GET /site/create
Query Parameters
None
Body
The body of the POST request must be a JSON object containing the following:
Attribute | Description |
---|---|
type | wind |
name | Name to give to site |
latitude | latitude of site (-90 to 90) |
longitude | longitude of site (-180 to 180) |
capacity | Capacity of site - array of JSON objects. Each JSON object should contain the capacity value in kW and the date (ISO 8601) from which the value is valid from. |
Response
JSON object containing site_id of the created site
Attribute | Description |
---|---|
site_id | id of the created site |
Status codes
Code | Meaning |
---|---|
200 | Ok |
400 | Bad request -- POST data is missing or incorrectly formatted. |
401 | Unauthorized -- Your API key is wrong. |
404 | Not Found -- The site does not exist. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily not able to handle your request. Try again later. |
Create localized weather site
import requests
import json
url = 'https://api.rebase.energy/platform/v1/site/create'
headers = {
'GL-API-KEY': your_api_key,
'Content-Type': 'application/json'
}
data = {
'type': 'localized',
'name': 'My localized site',
'latitude': 53.41,
'longitude': 5.94,
'measurement': 'WindSpeed'
}
response = requests.post(url, headers=headers, data=json.dumps(data))
data = response.json()
const request = require('request');
const data = {
type: 'localized',
name: 'My localized site',
latitude: 53.41,
longitude: 5.94,
measurement: 'WindSpeed'
};
const options = {
url: 'https://api.rebase.energy/platform/v1/site/create',
headers: {
'GL-API-KEY': your_api_key,
'Content-Type': 'application/json'
},
json: data
};
request.post(options, (error, response, body) => {
if (response.statusCode === 200){
// do something with data in body
}
})
The request above returns JSON structured like this:
{
"site_id": "04a24f77-60a0-41da-a844-ec0d7b6b904f"
}
Create a new localized weather site.
Only supports AI forecasts. First create a site as described below with one of the following supported measurement types:
measurement | unit |
---|---|
WindSpeed | m/s |
Temperature | °C |
CloudCover | % |
Then to create the AI forecast, upload data for the same measurement type as described in Upload data & train model > Measurement
HTTP Request
GET /site/create
Query Parameters
None
Body
The body of the POST request must be a JSON object containing the following:
Attribute | Description |
---|---|
type | localized |
name | Name to give to site |
latitude | latitude of site (-90 to 90) |
longitude | longitude of site (-180 to 180) |
measurement | WindSpeed / Temperature / CloudCover |
Response
JSON object containing site_id of the created site
Attribute | Description |
---|---|
site_id | id of the created site |
Status codes
Code | Meaning |
---|---|
200 | Ok |
400 | Bad request -- POST data is missing or incorrectly formatted. |
401 | Unauthorized -- Your API key is wrong. |
404 | Not Found -- The site does not exist. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily not able to handle your request. Try again later. |
Create load site
import requests
import json
url = 'https://api.rebase.energy/platform/v1/site/create'
headers = {
'GL-API-KEY': your_api_key,
'Content-Type': 'application/json'
}
data = {
'type': 'load',
'name': 'My load site',
'latitude': 53.41,
'longitude': 5.94,
'nwps': ['DWD_ICON-EU', 'NCEP_GFS'],
'variables': [
{'name': 'Temperature', 'lag': [-4, -3, -2, -1, 1, 2, 3, 4]},
{'name': 'SolarDownwardRadiation'},
],
'calendar': ['holidays', 'hourOfDay'],
}
response = requests.post(url, headers=headers, data=json.dumps(data))
data = response.json()
const request = require('request');
const data = {
type: 'load',
name: 'My load site',
latitude: 53.41,
longitude: 5.94,
nwps: ['DWD_ICON-EU', 'NCEP_GFS'],
variables: [
{name: 'Temperature', lag: [-4, -3, -2, -1, 1, 2, 3, 4]},
{name: 'SolarDownwardRadiation'},
],
calendar: ['holidays', 'hourOfDay'],
};
const options = {
url: 'https://api.rebase.energy/platform/v1/site/create',
headers: {
'GL-API-KEY': your_api_key,
'Content-Type': 'application/json'
},
json: data
};
request.post(options, (error, response, body) => {
if (response.statusCode === 200){
// do something with data in body
}
})
The request above returns JSON structured like this:
{
"site_id": "04a24f77-60a0-41da-a844-ec0d7b6b904f"
}
Create a new load site.
Only supports AI forecasts. First create a site as described below. Then to create the AI forecast, upload data to train as described in Upload data & train model > Measurement
HTTP Request
GET /site/create
Query Parameters
None
Body
The body of the POST request must be a JSON object containing the following:
Attribute | Description |
---|---|
type | load |
name | Name to give to site |
latitude | latitude of site (-90 to 90) |
longitude | longitude of site (-180 to 180) |
nwps | array of one or more NWPS to train. Available NWPS:
['DWD_ICON-EU', 'NCEP_GFS'] |
variables | array of JSON objects, containing NWP variables and lags. Available variables:
Example: [ {'name': 'Temperature', 'lag': [-4, -3, -2, -1, 1, 2, 3, 4]}, {'name': 'SolarDownwardRadiation'} ] |
calendar | array of calendar features that should be included in model training. Available features:
['holidays', 'hourOfDay'] |
Response
JSON object containing site_id of the created site
Attribute | Description |
---|---|
site_id | id of the created site |
Status codes
Code | Meaning |
---|---|
200 | Ok |
400 | Bad request -- POST data is missing or incorrectly formatted. |
401 | Unauthorized -- Your API key is wrong. |
404 | Not Found -- The site does not exist. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily not able to handle your request. Try again later. |
Forecast
Latest forecast
import requests
# replace <site_id> here with an actual id for a site
url = 'https://api.rebase.energy/platform/v1/site/forecast/latest/<site_id>'
headers = {
'GL-API-KEY': your_api_key
}
params = {
'type': 'ai',
'additional': "['clearsky']"
}
response = requests.get(url, headers=headers, params=params)
result = response.json()
const request = require('request');
const options = {
// replace <site_id> here with an actual id for a site
url: 'https://api.rebase.energy/platform/v1/site/forecast/latest/<site_id>',
headers: {
'GL-API-KEY': your_api_key
}
};
request(options, (error, response, body) => {
if (response.statusCode === 200){
// do something with data in body
}
})
The above command returns JSON structured like this:
{
"ref_time": "2020-01-05T00:00Z",
"valid_time": [
"2020-01-05T00:00Z",
"2020-01-05T00:15Z",
"2020-01-05T00:30Z",
"2020-01-05T00:45Z",
"2020-01-05T01:00Z",
...,
"2020-01-10T00:00Z"
],
"forecast": [
634.5,
637.1,
711.9,
729.6,
800.5,
...,
958.3
],
"type": "ai",
"additional": {
"clearsky": {
"forecast": [...],
"valid_time": [...]
}
}
}
This endpoint retrieves the latest forecast for a specified site.
To get an AI forecast you must first have uploaded power production data and trained a model. See Upload data & train model > Measurement
HTTP Request
GET /site/forecast/latest/<site_id>
Query Parameters
Parameter | Required | Values | Default | Description |
---|---|---|---|---|
type | No | prioritized, ai, physical | prioritized | Type of forecast to return. 'prioritized' returns the best forecast at the time |
normalize | No | True, False | False | If set to True, will return forecast normalized by site capacity. This is only available for capacity limited sites. |
additional | No | ['clearsky'] | None | A string representing a list of strings of additional forecast data to return. Clearsky option is only available for solar sites. |
Response
JSON object containing two arrays of equal length, one with valid times and the other with forecast values.
Attribute | Description |
---|---|
ref_time | Reference time the forecast was calculated for. |
valid_time | Array of timestamps which the forecast values are valid for (UTC timezone). (array of ISO 8601 formatted strings) |
forecast | Array of forecast values in kilowatts (kW). (array of floats) |
type | Type of forecast. Same as query parameter. |
additional | JSON object containing additional forecast data. Contains clear sky forecast for solar sites if 'clearsky' supplied in additional query parameter. |
Status codes
Code | Meaning |
---|---|
200 | Ok |
401 | Unauthorized -- Your API key is wrong. |
404 | Not Found -- The site does not exist. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily not able to handle your request. Try again later. |
Upload data & train model
Measurement
import requests
import json
# replace <site_id> here with an actual id for a site
url = 'https://api.rebase.energy/platform/v1/site/measurement/upload/<site_id>'
headers = {
'GL-API-KEY': your_api_key,
'Content-Type': 'application/json'
}
data = {
'valid_time': [
'2020-01-01T00:00:00Z',
'2020-01-01T00:10:00Z',
'2020-01-01T00:20:00Z',
'2020-01-01T00:30:00Z',
'2020-01-01T00:40:00Z'
],
'measurement': [
5.6,
5.9,
6.7,
6.6,
7.2,
6.8
],
'type': '<measurement type>'
}
response = requests.post(url, headers=headers, data=json.dumps(data))
const request = require('request');
const data = {
valid_time: [
'2020-01-01T00:00:00Z',
'2020-01-01T00:10:00Z',
'2020-01-01T00:20:00Z',
'2020-01-01T00:30:00Z',
'2020-01-01T00:40:00Z'
],
measurement: [
5.6,
5.9,
6.7,
6.6,
7.2,
6.8
],
type: '<measurement type>'
}
const options = {
// replace <site_id> here with an actual id for a site
url: 'https://api.rebase.energy/platform/v1/site/measurement/upload/<site_id>',
headers: {
'GL-API-KEY': your_api_key,
'Content-Type': 'application/json'
},
json: data
};
request.post(options);
This endpoints uploads measurements for a specific site. Once successfully uploaded, AI models will be trained on the new data. New AI forecasts should become available a few minutes later.
HTTP Request
GET /site/measurement/upload/<site_id>
Query Parameters
None
Body
The body in the POST data must be a JSON object containing the following:
Attribute | Value |
---|---|
valid_time | Array of timestamps (ISO 8601 formatted) [t1, t2, ..., tn] |
measurement | Array of measurement values [v1, v2, ..., vn] |
type | Type of measurement. This type must match the measurement type the site was created with. Available measurements:
|
Response
'Ok', confirmation message that data was successfully uploaded
Status codes
Code | Meaning |
---|---|
200 | Ok |
400 | Bad request -- POST data is missing or incorrectly formatted. |
401 | Unauthorized -- Your API key is wrong. |
404 | Not Found -- The site does not exist. |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily not able to handle your request. Try again later. |