# Authorization
Source: https://docs.rebase.energy/api-guides/authorization
HTTP authentication via API key
We use HTTP authentication. You will need to provide your API key in the `requests` headers.
```python theme={null}
headers = {
"Authorization": "Your API Key",
"Content-Type": "application/json"
}
requests.get(url, headers=headers)
```
### How to get an API key
To generate an API key, log in to the [Rebase Platform](https://dashboard.rebase.energy).
In the top right corner of the dashboard, click on the user profile image and select **Account**.
On the left sidebar, click **API**. Under the **API Keys** section, you can view, generate, or delete your API keys.
# How to create a load site
Source: https://docs.rebase.energy/api-guides/create-site-load
Create a new electricity demand site to forecast in the Rebase Platform.
## What data do I need to create a new site
You will need to provide some data about the site, its assets and some settings about the forecasting models.
**Type of the site** `type`
Specify the type of the site. For a load site it should be: `load`.
**Name of the site** `name`
Specify a name for the site. It is used to easily recognize the site. It is a string.
Example: `My load site`
**Latitude of the site location** `latitude`
Specify the latitude of the site location. It takes a value between -90 and 90.
Example: `52.5`
**Longitude of the site location** `longitude`
Specify the longitude of the site location. It takes a value between -180 and 180.
Example: `13.4`
**Settings** `settings`
* **Model resolution** `model_resolution`
Specify how frequently the forecasts will be updated. It can be every 15 minutes, 30 minutes, 1 hour or daily.
It takes one of the following values: `15min`, `30min`, `1h` or `1d`.
* **Forecast max value** `forecast_max_value`
Specify an upper limit for the forecasts in kilowatts (kW). It is a positive number. If null no cap is applied.
* **Train long-term models** `trainLongTermModels`
Specify if a model based on typical meteorological year should be trained for long-term forecasting. It takes one of the following values: `true` or `false`
* **Train near-term models** `trainNearTermModels`
Specify if a model based on recent power observations should be trained for short-term forecasting. Power observations should be available in real time in this case. It takes one of the following values: `true` or `false`
* **Additional locations** `additional_points`
Add more locations to be considered for the weather inputs of the forecasting models. This is useful when creating a model to predict the load in a wider area. The additional points are provided by their longitude and latitude.
### Create load sites examples
```python Create load site theme={null}
import requests
api_key = "Your API key" # Set your API key
payload = {
"type": "load",
"name": "My load site",
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "1h",
"additional_points": [
{
"name": "Extra location 1",
"latitude": 53.5,
"longitude": 14.4
},
{
"name": "Extra location 2",
"latitude": 51.5,
"longitude": 12.4
}
],
"trainNearTermModels": False,
"trainLongTermModels": False
}
}
url = "https://api.rebase.energy/platform/v2/sites"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
response = response.json()
```
The API response contains the ID of the new site.
```python Response example theme={null}
{
"site_id": "a923653c-26f1-1b29-955d-ffde5d182276"
}
```
# How to create a solar site
Source: https://docs.rebase.energy/api-guides/create-site-solar
Create a new solar site to forecast in the Rebase Platform.
## What data do I need to create a new site
You will need to provide some data about the site and some settings about the forecasting models.
**Type of the site** `type`
Specify the type of the site. For a solar site it should be: `solar`.
**Name of the site** `name`
Specify a name for the site. It is used to easily recognize the site. It is a string.
Example: `My solar site`
**Latitude of the site location** `latitude`
Specify the latitude of the site location. It takes a value between -90 and 90.
Example: `52.5`
**Longitude of the site location** `longitude`
Specify the longitude of the site location. It takes a value between -180 and 180.
Example: `13.4`
**Assets** `assets`
* **Mount type** `mount`
Specify the mount type. This parameter accepts one of the following values: `fixed`, `single_axis_tracking`, or `dual_axis_tracking`, representing fixed, single-axis tracking, and dual-axis tracking mounting configurations that determine how the panels are oriented and whether they follow the sun’s movement.
Default value: `fixed`
* **Solar park capacity** `capacity`
Specify the DC capacity of the solar park in kilowatts (kW). It is a positive number.
Example: `1000`
* **Solar panels orientation** `azimuth`
Specify the orientation (azimuth) of the PV panels in degrees. It is a positive number between 0 and 360 (0 N, 90 E, 180 S, 270 W). This parameter applies only to the Fixed mount type.
Example: `180`
* **Solar panels inclination** `tilt`
Specify the inclination (tilt) of the PV panels in degrees. It is a positive number between 0 and 90. This parameter applies only to the Fixed mount type.
Example: `180`
* **Installation date** `install_date`
Specify the date when the system was installed. It is a string with format: "YYYY-MM-DD".
Example: `2020-01-01`
The following parameters are applicable only to the **single-axis tracking** mount type.
* **Axis tilt** `axis_tilt`
Specify the axis inclination (tilt). It is a positive number between 0 and 90. 0 means that the rotation axis is horizontal.
Example: `0`
* **Axis azimuth** `axis_azimuth`
Specify the axis orientation (azimuth). It is a positive number between 0 and 180 degrees and defines the plane about which the panels rotate to follow the sun. An azimuth of 0 or 180 indicates a north–south axis, where panels track the sun from east to west throughout the day. An azimuth of 90 indicates an east–west axis, where panels track from north to south.
Example: `180`
* **Axis maximum rotation angle** `max_angle`
Specify the maximum rotation angle of the single-axis tracking system. It is a positive number between 0 and 90 degrees and defines the maximum tilt from the horizontal that the tracker can reach. The system will not rotate beyond this limit in either direction.
Example: `45`
* **Backtrack** `backtrack`
Controls whether the tracker has the capability to backtrack to avoid row-to-row shading. `false` denotes no backtrack capability. `true` denotes backtrack capability.
Example: `true`
* **Ground coverage ratio** `gcr`
Specify the ground coverage ratio. It is a decimal number between 0 and 1 and defines the ratio between the PV array surface area to the total ground area.
Default value: `0.2857`
**Settings** `settings`
* **Model resolution** `model_resolution`
Specify how frequently the forecasts will be updated. It can be every 15 minutes, 30 minutes, 1 hour or daily.
It takes one of the following values: `15min`, `30min`, `1h` or `1d`.
* **Forecast max value** `forecast_max_value`
Specify an upper limit for the forecasts in kilowatts (kW). This setting is useful when the inverter’s rated output power is lower than the DC capacity of the solar panels, or when a grid export limit restricts how much power can be delivered. It is a positive number. If null no cap is applied.
* **Train long-term models** `trainLongTermModels`
Specify if a model based on typical meteorological year should be trained for long-term forecasting. It takes one of the following values: `true` or `false`
* **Train near-term models** `trainNearTermModels`
Specify if a model based on recent power observations should be trained for short-term forecasting. Power observations should be available in real time in this case. It takes one of the following values: `true` or `false`
* **Use physical models** `usePhysicalModels`
Specify if physical models should be enabled. No training data are required for physical models to work. It takes one of the following values: `true` or `false`
### Create solar sites examples
```python Single-asset solar site theme={null}
import requests
api_key = "Your API key" # Set your API key
payload = {
"type": "solar",
"name": "My solar site",
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "15min",
"forecast_max_value": 800, # e.g. inverter rated power or grid export limit
"usePhysicalModels": True,
"trainNearTermModels": False,
"trainLongTermModels": False
},
"assets": [
{
"azimuth": 180,
"tilt": 30,
"capacity": 1000, # DC capacity
"install_date": "2020-01-01"
}
]
}
url = "https://api.rebase.energy/platform/v2/sites"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
response = response.json()
```
```python Multi-asset solar site theme={null}
import requests
api_key = "Your API key" # Set your API key
payload = {
"type": "solar",
"name": "My solar site",
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "15min",
"usePhysicalModels": True,
"trainNearTermModels": False,
"trainLongTermModels": False
},
"assets": [
{
"azimuth": 180,
"tilt": 30,
"capacity": 10, # DC capacity
"install_date": "2020-01-01"
},
{
"azimuth": 90,
"tilt": 25,
"capacity": 5, # DC capacity
"install_date": "2020-01-01"
}
]
}
url = "https://api.rebase.energy/platform/v2/sites"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
response = response.json()
```
```python Single-axis tracking theme={null}
import requests
api_key = "Your API key" # Set your API key
payload = {
"type": "solar",
"name": "My solar site",
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "15min",
"usePhysicalModels": True,
"trainNearTermModels": False,
"trainLongTermModels": False
},
"assets": [
{
"mount": "single_axis_tracking",
"axis_tilt": 0,
"axis_azimuth": 180,
"max_angle": 45,
"backtrack": true,
"gcr": 0.2857,
"capacity": 1000, # DC capacity
"install_date": "2020-01-01"
}
]
}
url = "https://api.rebase.energy/platform/v2/sites"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
response = response.json()
```
```python Dual-axis tracking theme={null}
import requests
api_key = "Your API key" # Set your API key
payload = {
"type": "solar",
"name": "My solar site",
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "15min",
"usePhysicalModels": True,
"trainNearTermModels": False,
"trainLongTermModels": False
},
"assets": [
{
"mount": "dual_axis_tracking",
"capacity": 1000, # DC capacity
"install_date": "2020-01-01"
}
]
}
url = "https://api.rebase.energy/platform/v2/sites"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
response = response.json()
```
The API response contains the ID of the new site.
```python Response example theme={null}
{
"site_id": "a923653c-26f1-1b29-955d-ffde5d182276"
}
```
# How to create a wind site
Source: https://docs.rebase.energy/api-guides/create-site-wind
Create a new wind site to forecast in the Rebase Platform.
## What data do I need to create a new site
You will need to provide some data about the site, its assets and some settings about the forecasting models.
**Type of the site** `type`
Specify the type of the site. For a wind site it should be: `wind`.
**Name of the site** `name`
Specify a name for the site. It is used to easily recognize the site. It is a string.
Example: `My wind site`
**Latitude of the site location** `latitude`
Specify the latitude of the site location. It takes a value between -90 and 90.
Example: `52.5`
**Longitude of the site location** `longitude`
Specify the longitude of the site location. It takes a value between -180 and 180.
Example: `13.4`
**Assets** `assets`
* **Wind turbine model** `turbine_type`
Specify the wind turbine model. It is a string.
A list of the available wind turbine models is provided in the [API Reference](/api-reference/site/create-site) under the `Body` section and `WindSiteItem` tab.
If the model is not in the list, then set `generic` as turbine model or pick a wind turbine model with similar characteristics (nominal power, rotor diameter).
Example: `V126/3000`
* **Number of wind turbines** `nr_units`
Specify the number of the wind turbines in the site. It is a positive integer number.
Example: `3`
* **Wind turbine hub height** `hub_height`
Specify the wind turbine hub height in meters (m). It is a positive number.
Example: `119`
* **Installation date** `install_date`
Specify the date when the system was installed. It is a string with format: "YYYY-MM-DD".
Example: `2020-01-01`
If the turbine model is `generic`, then the following asset parameters should also be provided:
* **Wind turbine nominal power** `nominal_power`
Specify the nominal power of the wind turbine in kilowatts (kW). It is a positive number.
Example: `3000`
* **Wind turbine rotor diameter** `rotor_diameter`
Specify the wind turbine rotor diameter in meters (m). It is a positive number.
Example: `126`
**Settings** `settings`
* **Model resolution** `model_resolution`
Specify how frequently the forecasts will be updated. It can be every 15 minutes, 30 minutes, 1 hour or daily.
It takes one of the following values: `15min`, `30min`, `1h` or `1d`.
* **Forecast max value** `forecast_max_value`
Specify an upper limit for the forecasts in kilowatts (kW). This setting is useful when a grid export limit restricts how much power can be delivered. It is a positive number. If null no cap is applied.
* **Train long-term models** `trainLongTermModels`
Specify if a model based on typical meteorological year should be trained for long-term forecasting. It takes one of the following values: `true` or `false`
* **Train near-term models** `trainNearTermModels`
Specify if a model based on recent power observations should be trained for short-term forecasting. Power observations should be available in real time in this case. It takes one of the following values: `true` or `false`
* **Use physical models** `usePhysicalModels`
Specify if physical models should be enabled. No training data are required for physical models to work. It takes one of the following values: `true` or `false`
### Create wind sites examples
```python Specific wind turbine model theme={null}
import requests
api_key = "Your API key" # Set your API key
payload = {
"type": "wind",
"name": "My wind site",
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "1h",
"usePhysicalModels": True,
"trainNearTermModels": False,
"trainLongTermModels": False
},
"assets": [
{
"turbine_type": "V126/3000",
"nr_units": 3,
"hub_height": 119,
"install_date": "2020-01-01"
}
]
}
url = "https://api.rebase.energy/platform/v2/sites"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
response = response.json()
```
```python Generic wind turbine model theme={null}
import requests
api_key = "Your API key" # Set your API key
payload = {
"type": "wind",
"name": "My wind site",
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "1h",
"usePhysicalModels": True,
"trainNearTermModels": False,
"trainLongTermModels": False
},
"assets": [
{
"turbine_type": "generic",
"nominal_power": 3000,
"nr_units": 3,
"hub_height": 119,
"rotor_diameter": 126,
"install_date": "2022-01-01"
}
]
}
url = "https://api.rebase.energy/platform/v2/sites"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
response = response.json()
```
```python Multiple wind turbine models theme={null}
import requests
api_key = "Your API key" # Set your API key
payload = {
"type": "wind",
"name": "My wind site",
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "1h",
"usePhysicalModels": True,
"trainNearTermModels": False,
"trainLongTermModels": False
},
"assets": [
{
"turbine_type": "V126/3000",
"nr_units": 2,
"hub_height": 119,
"install_date": "2020-01-01"
},
{
"turbine_type": "V112/3300",
"nr_units": 2,
"hub_height": 140,
"install_date": "2020-01-01"
}
]
}
url = "https://api.rebase.energy/platform/v2/sites"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
response = response.json()
```
The API response contains the ID of the new site.
```python Multiple wind turbine models theme={null}
{
"site_id": "dfd365tc-2644-3627-905a-ghjjd182u78"
}
```
# How to delete a site
Source: https://docs.rebase.energy/api-guides/delete-site
Delete a site from the Rebase Platform.
To delete a site you will need to provide its ID. See [here](/api-guides/get-site-info) how to get the sites IDs.
```python Delete site theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
url = "https://api.rebase.energy/platform/v2/sites/{site_id}"
headers = {'Authorization': api_key, 'Content-Type': 'application/json'}
response = requests.delete(url, headers=headers)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
{
"message": "Site deleted successfully"
}
```
# How to get historical forecasts
Source: https://docs.rebase.energy/api-guides/get-forecast-historical
Get archived past forecasts for a site
## What are historical forecasts
When a forecast is generated it is stored in a data base and can be retrieved at a later time. The issue/update time of the forecast is also stored.
Therefore, it is possible to do ex-post forecast error analysis when the actual generation or demand data become available.
## How to query historical forecasts
To query historical forecasts you will need to provide the following requests parameters.
**Start date** `start_date`
Specify the starting target period of the forecast.
Example: `"2024-10-18 00:00"`
**End date** `end_date`
Specify the ending target period of the forecast.
Example: `"2024-10-18 23:00"`
**Reference time** `as_of`
Specify the reference time. The API will return the most recent forecasts which were available at the reference time and cover the period between `start_date` and `end_date`.
If not provided, then by default the request time is considered as reference time.
Example: `"2024-10-17 12:00"`
**Time zone** `tz`
Specify the time zone. The default time zone is `UTC`.
Example: `"CET"`
In the example below we want to query the forecasts for solar site with ID `a923653c-26f1-1b29-955d-ffde5d182276` for the period between `2024-06-28 00:00` and `2024-06-28 01:00` which
were available at 11:00 in the morning the previous day. All times are in UTC.
```python Get historical forecast theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
start_date = "2024-06-28 00:00" # Set the start date
end_date = "2024-06-28 01:00" # Set the end date
as_of = "2024-06-27 11:00" # Set the reference time
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/forecast"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
params={
'start_date': start_date,
'end_date': end_date,
'as_of': as_of
}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
{
"valid_time": [
"2024-06-28T00:00:00Z",
"2024-06-28T00:15:00Z",
"2024-06-28T00:30:00Z",
"2024-06-28T00:45:00Z",
"2024-06-28T01:00:00Z"
],
"forecast": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"model_name": [
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical"
],
"model_version": [
1,
1,
1,
1,
1
],
"update_time": [
"2024-06-27T06:00:00Z",
"2024-06-27T06:00:00Z",
"2024-06-27T06:00:00Z",
"2024-06-27T06:00:00Z",
"2024-06-27T06:00:00Z"
]
}
```
The response is a serialized table with the following columns:
`valid_time`: It contains the target times, i.e. the periods which are forecasted.
`forecast`: It contains the forecast values.
`model_name`: It contains the names of the models which create the forecasts.
`model_version`: It contains the versions of the models which create the forecasts.
`update_time`: It contains the issue/update time, i.e. the time when the forecasts were updated.
As it can be seen from the response, the update time for the specific forecasts is `2024-06-27 06:00` UTC.
This is the latest available forecast for the specific target periods issued before `2024-06-27 11:00` UTC.
If the reference time is omitted, the request time is considered as reference time.
In this case the API returns the most recent forecast update which was issued at `2024-06-28 00:00` UTC.
```python Response example theme={null}
{
"valid_time": [
"2024-06-28T00:00:00Z",
"2024-06-28T00:15:00Z",
"2024-06-28T00:30:00Z",
"2024-06-28T00:45:00Z",
"2024-06-28T01:00:00Z"
],
"forecast": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"model_name": [
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical"
],
"model_version": [
1,
1,
1,
1,
1
],
"update_time": [
"2024-06-28T00:00:00Z",
"2024-06-28T00:00:00Z",
"2024-06-28T00:00:00Z",
"2024-06-28T00:00:00Z",
"2024-06-28T00:00:00Z"
]
}
```
## How to query the update times
To query the update times you need to provide the ID of the site.
The API will return all the update times of the forecasts that were generated for the specific site.
```python Get update times theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/forecast/updates"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.get(url, headers=headers)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
['2024-06-27T00:00:00Z',
'2024-06-27T06:00:00Z',
'2024-06-27T12:00:00Z',
'2024-06-27T18:00:00Z',
'2024-06-28T00:00:00Z',
'2024-06-28T06:00:00Z',
'2024-06-28T12:00:00Z',
'2024-06-28T18:00:00Z',
'2024-06-29T00:00:00Z',
'2024-06-29T06:00:00Z',
'2024-06-29T12:00:00Z']
```
# How to get the latest forecast
Source: https://docs.rebase.energy/api-guides/get-forecast-latest
Get the most recently updated forecast for a site
## How the site forecasts are constructed
There are usually multiple forecasting models running for every site. These can use different weather models, they can be ML or physical models, they can use lagged measured values as input (autoregressive models), etc.
A site's forecast is constructed by using the individual model outputs (forecasts) for different time horizons based on some priority scheme we apply.
For example, in the dashboard screenshot below, there are four physical models running with different weather models as input.
The forecast we deliver for the specific site is made of the green model forecasts for the first leading period, the blue model forecasts for the period after that, and the red model forecasts for the rest of the forecasting horizon.
If a model fails to generate any forecasts, the next model(s) in the priority list will be used to deliver the missing forecasts.
See how to get a specific [model output](/api-guides/get-model-output).
## How to query the latest forecast
To query the most recently updated forecast you need to provide the ID of the site.
```python Get latest forecast theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/forecast"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.get(url, headers=headers)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
{
"valid_time": [
"2024-10-22T00:00:00Z",
"2024-10-22T00:15:00Z",
"2024-10-22T00:30:00Z",
"2024-10-22T00:45:00Z",
"2024-10-22T01:00:00Z"
],
"forecast": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"model_name": [
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical"
],
"model_version": [
1,
1,
1,
1,
1
],
"update_time": [
"2024-10-22T06:15:00Z",
"2024-10-22T06:15:00Z",
"2024-10-22T06:15:00Z",
"2024-10-22T06:15:00Z",
"2024-10-22T06:15:00Z"
]
}
```
The response is a serialized table with the following columns:
`valid_time`: It contains the target times, i.e. the periods which are forecasted.
`forecast`: It contains the forecast values.
`model_name`: It contains the names of the models which create the forecasts.
`model_version`: It contains the versions of the models which create the forecasts.
`update_time`: It contains the issue/update time, i.e. the time when the forecasts were updated.
## Change time zone
The default time zone is `UTC`. You can specify a different time zone in the requests parameters.
```python Get latest forecast in different time zone theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
tz = "CET" # Set a new time zone
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/forecast"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
params={"tz": tz}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
{
"valid_time": [
"2024-10-22T00:00:00+02:00",
"2024-10-22T00:15:00+02:00",
"2024-10-22T00:30:00+02:00",
"2024-10-22T00:45:00+02:00",
"2024-10-22T01:00:00+02:00"
],
"forecast": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"model_name": [
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical",
"Solar_MetOfficeGlobalHiRes_Physical"
],
"model_version": [
1,
1,
1,
1,
1
],
"update_time": [
"2024-10-22T02:00:00+02:00",
"2024-10-22T02:00:00+02:00",
"2024-10-22T02:00:00+02:00",
"2024-10-22T02:00:00+02:00",
"2024-10-22T02:00:00+02:00"
]
}
```
# How to get model inputs
Source: https://docs.rebase.energy/api-guides/get-model-input
Get the weather input data of a model's latest run
## What are model inputs
Every forecasting model is driven by input data, mainly weather variables coming from numerical weather prediction models.
A single forecasting model can combine several weather sources at the same time, so that it does not depend on one weather provider alone.
The [Get Model Input](/api-reference/model/get-model-input) endpoint returns the input data of the model's latest run.
It is useful when you want to inspect the weather that a forecast was based on, for example when investigating a large forecast error.
To get the output which the model produced from these inputs, see [how to get model output](/api-guides/get-model-output).
## How to query the model inputs
The only parameter you need to provide is the model ID, which you can retrieve with the [List Site Models](/api-reference/site/list-site-models) endpoint, as described in [Step 1 of the model output guide](/api-guides/get-model-output).
The endpoint takes no further request parameters. It always returns the inputs of the most recent model run, with the target times in `UTC`.
```python Get model inputs theme={null}
import requests
api_key = "Your API key" # Set your API key
model_id = "1d567fa0-e356-467a-cd9f-5f78b901c345" # Set the model ID
url = f"https://api.rebase.energy/platform/v2/models/{model_id}/input"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.get(url, headers=headers)
response.raise_for_status()
response = response.json()
```
In the response example below the arrays are truncated to five time steps.
```python Response example theme={null}
{
"dataframe": {
"DWDOM_SolarDownwardRadiation": [
23.0,
54.0,
93.0,
153.0,
249.0
],
"ECHRESOM_SolarDownwardRadiation": [
6.0,
51.0,
136.0,
224.0,
262.0
],
"GFSOM_SolarDownwardRadiation": [
10.0,
105.0,
223.0,
314.0,
424.0
],
"HIRESMEPSOM_SolarDownwardRadiation": [
32.0,
58.0,
97.0,
156.0,
211.0
],
"valid_time": [
"2025-10-01T05:00Z",
"2025-10-01T06:00Z",
"2025-10-01T07:00Z",
"2025-10-01T08:00Z",
"2025-10-01T09:00Z"
]
},
"metadata": {
"DWDOM_SolarDownwardRadiation": {
"type": "numeric"
},
"ECHRESOM_SolarDownwardRadiation": {
"type": "numeric"
},
"GFSOM_SolarDownwardRadiation": {
"type": "numeric"
},
"HIRESMEPSOM_SolarDownwardRadiation": {
"type": "numeric"
}
}
}
```
The response contains the following fields:
`dataframe`: A serialized table with one column per input feature, plus a `valid_time` column which contains the target times, i.e. the periods which are forecasted.
`metadata`: The data type of every input feature, for example `numeric` for the weather variables.
Each input feature is named after the weather source it comes from and the weather variable it holds, separated by an underscore.
In the example above the model is driven by `SolarDownwardRadiation` from four different weather sources, `DWDOM`, `ECHRESOM`, `GFSOM` and `HIRESMEPSOM`.
## Load the inputs into a DataFrame
The `dataframe` field is column oriented, so it can be handed straight to pandas.
```python Load model inputs into a DataFrame theme={null}
import pandas as pd
df = pd.DataFrame(response["dataframe"])
df["valid_time"] = pd.to_datetime(df["valid_time"])
df = df.set_index("valid_time")
```
# How to get model output
Source: https://docs.rebase.energy/api-guides/get-model-output
Get the forecast of a specific model for a site
The [Get Site Forecast](/api-reference/site/get-site-forecast) endpoint returns the optimal forecast, constructed from multiple model outputs based on a priority scheme, as described [here](/api-guides/get-forecast-latest#how-the-site-forecasts-are-constructed).
If you need the raw output of a specific model, use the [Get Model Output](/api-reference/model/get-model-output) endpoint instead.
## Step 1: Get the model IDs
Before querying a model's output you need its unique identifier, the model ID. Retrieve it using the [List Site Models](/api-reference/site/list-site-models) endpoint.
You can filter the results to only ML or physical models by setting the `model_type` parameter to `ai` or `physical`, respectively.
```python Get model IDs theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/models"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.get(url, headers=headers)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
[
{
'id': '0c456ecb-d245-4569-bc8e-4e67a566dcd72',
'name': 'SolarForecast_Ensemble_QuantReg',
'label': 'ML-Acc-Medium',
'version': 1,
'display_name': 'ML-Acc-Medium',
'priority': 3,
'output_types': [],
'state': [{'state': 'training', 'timestamp_utc': '2025-09-15T00:32:48.391452Z'}]},
{
'id': '1d567fa0-e356-467a-cd9f-5f78b901c345',
'name': 'SolarForecast_Ensemble_QuantReg',
'label': 'ML-Acc-Short',
'version': 2,
'display_name': 'ML-Acc-Short',
'priority': 2,
'output_types': [],
'state': [{'state': 'training', 'timestamp_utc': '2025-09-15T00:41:51.224815Z'}]}
]
```
The response is a list of models configured for the site, with the following fields:
`id`: The unique model identifier. Use this as `model_id` in Step 2.
`name`: The name of the forecasting model.
`label`: A short label for the model.
`version`: The version number of the model.
`display_name`: The name shown for the model in the platform.
`priority`: The model's priority rank within the site's forecast combination.
`output_types`: The output types the model produces.
`state`: The model's training state history.
## Step 2: Get the latest model output
Using the model ID from Step 1, query the latest output for that model with the [Get Model Output](/api-reference/model/get-model-output) endpoint.
If no `start_date` is provided, the output is returned from today 00:00 UTC onwards.
```python Get latest model output theme={null}
import requests
api_key = "Your API key" # Set your API key
model_id = "1d567fa0-e356-467a-cd9f-5f78b901c345" # Set the model ID
url = f"https://api.rebase.energy/platform/v2/models/{model_id}/output"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.get(url, headers=headers)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
{
"model_id": "1d567fa0-e356-467a-cd9f-5f78b901c345",
"model_version": 2,
"model_name": "SolarForecast_Ensemble_QuantReg",
"model_label": "ML-Acc-Short",
"priority": 2,
"as_of": "2025-10-01T09:40:52.800337Z",
"forecast": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"valid_time": [
"2025-10-01T00:00:00Z",
"2025-10-01T00:15:00Z",
"2025-10-01T00:30:00Z",
"2025-10-01T00:45:00Z",
"2025-10-01T01:00:00Z"
],
"capacity": [
76000.0,
76000.0,
76000.0,
76000.0,
76000.0
]
}
```
The response is a JSON object with the following fields:
`model_id`: The unique identifier of the model.
`model_version`: The version number of the model.
`model_name`: The name of the forecasting model.
`model_label`: The label of the model, i.e. the `label` field from Step 1.
`priority`: The model's priority rank within the site's forecast combination.
`as_of`: The reference time, i.e. the forecasts returned are the most recent ones that were available at this time.
`forecast`: It contains the forecast values.
`valid_time`: It contains the target times, i.e. the periods which are forecasted.
`capacity`: It contains the site capacity in kilowatts \[kW] for each target period.
## Query historical model output
Every model run is archived, so you can retrieve a model's output as it was issued at an earlier point in time.
This is the model level equivalent of the [historical site forecast](/api-guides/get-forecast-historical).
You can provide the following request parameters.
**Start date** `start_date`
Specify the starting target period of the forecast. If not provided, it defaults to today 00:00 UTC.
Example: `"2025-08-02 15:00"`
**End date** `end_date`
Specify the ending target period of the forecast.
Example: `"2025-08-02 16:00"`
**Reference time** `as_of`
Specify the reference time. The API will return the most recent model output which was available at the reference time and covers the period between `start_date` and `end_date`.
If not provided, then by default the request time is considered as reference time.
Example: `"2025-08-01 11:00"`
**Time zone** `tz`
Specify the time zone. The default time zone is `UTC`.
Example: `"CET"`
**Output type** `output_type`
Specify which output of the model to return. The default is `"forecast"`. `"clearky"` can be used for the physical models clearsky output.
**Normalization handling** `normalization_handling`
Specify if the output is returned in absolute values `"auto"` or normalized by the capacity `"disabled"`. The default is `"auto"`.
In the example below we want to query the output of the model with ID `1d567fa0-e356-467a-cd9f-5f78b901c345` for the period between `2025-08-02 15:00` and `2025-08-02 16:00` which
was available at 11:00 in the morning the previous day, i.e. the day-ahead forecast. All times are in UTC.
```python Get historical model output theme={null}
import requests
api_key = "Your API key" # Set your API key
model_id = "1d567fa0-e356-467a-cd9f-5f78b901c345" # Set the model ID
start_date = "2025-08-02 15:00" # Set the start date
end_date = "2025-08-02 16:00" # Set the end date
as_of = "2025-08-01 11:00" # Set the reference time
url = f"https://api.rebase.energy/platform/v2/models/{model_id}/output"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
params = {
"start_date": start_date,
"end_date": end_date,
"as_of": as_of
}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
{
"model_id": "1d567fa0-e356-467a-cd9f-5f78b901c345",
"model_version": 2,
"model_name": "SolarForecast_Ensemble_QuantReg",
"model_label": "ML-Acc-Short",
"priority": 2,
"as_of": "2025-08-01T11:00:00Z",
"forecast": [
49076.07965239071,
46358.204584880375,
43007.28450049107,
38891.100735672335,
33866.317940143104
],
"valid_time": [
"2025-08-02T15:00:00Z",
"2025-08-02T15:15:00Z",
"2025-08-02T15:30:00Z",
"2025-08-02T15:45:00Z",
"2025-08-02T16:00:00Z"
],
"capacity": [
76000.0,
76000.0,
76000.0,
76000.0,
76000.0
]
}
```
# How to get site meta data
Source: https://docs.rebase.energy/api-guides/get-site-info
Retrieve the IDs of the sites and other meta data
## Get a list of meta data for all sites
In order to do actions like getting a site's forecast, uploading data to a site and others, you will need to provide the site ID when querying the relevant endpoints.
The example below shows how to get a list of meta data for all of your sites. The meta data include IDs of the sites among other parameter values.
```python Get meta list theme={null}
import requests
api_key = "Your API key" # Set your API key
url = "https://api.rebase.energy/platform/v2/sites"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.get(url=url, headers=headers)
response.raise_for_status()
response = response.json()
```
```python Response Example theme={null}
[
{
"id": "3b511f66-5c99-47ff-b656-f504f60ab668",
"name": "My solar site",
"latitude": 52.5,
"longitude": 13.4,
"capacity_kw_array": [
{
"value": 1000.0,
"dateEnd": null
}
],
"creation_timestamp_utc": "2024-09-13T13:49:14.448761Z",
"settings": {
"model_resolution": "1h",
"additional_points": [
],
"trainLongTermModels": false,
"trainNearTermModels": false,
"usePhysicalModels": true,
"weather_models": [
],
"create_params": {
}
},
"type": "solar",
"assets": [
{
"azimuth": 180.0,
"tilt": 30.0,
"capacity": 1000.0,
"install_date": "2015-01-01"
}
]
},
{
"id": "77a5845a-9f6d-456e-8507-3f8ce032f27d",
"name": "My wind site",
"latitude": 52.5,
"longitude": 13.4,
"capacity_kw_array": [
{
"value": 10000.0,
"dateEnd": null
}
],
"creation_timestamp_utc": "2024-09-13T11:47:55.844700Z",
"settings": {
"model_resolution": "1h",
"additional_points": [
],
"trainLongTermModels": false,
"trainNearTermModels": false,
"usePhysicalModels": true,
"weather_models": [
],
"create_params": {
}
},
"type": "wind",
"assets": [
{
"nominal_power": 1000.0,
"turbine_type": "V90/3000",
"hub_height": 80.0,
"rotor_diameter": 90.0,
"nr_units": 10,
"install_date": "2015-01-01"
}
]
}
]
```
## Get meta data for a specific site
To get meta data for a specific site use the ID of that site.
```python Get site meta theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.get(url, headers=headers)
response.raise_for_status()
response = response.json()
```
# Tutorial to Get Started with Rebase API
Source: https://docs.rebase.energy/api-guides/quickstart
Get started with Rebase API in a few simple steps:
Explore different [site options](/api-guides/set-up-sites).
See also how to upload [capacity changes](/api-guides/upload-capacity).
See what [training settings](/api-guides/train-site-models) are available.
Find out how to query [historical forecasts](/api-guides/get-forecast-historical).
## Step 1. Create a new site
Create a solar site to forecast. You will need to provide some site parameters like location, capacity, etc. More information
about the parameters for every type of site are provided in the [site set-up guides](/api-guides/set-up-sites) and in the [API Reference](/api-reference/site/create-site).
```python Create new site theme={null}
import requests
api_key = "Your API key" # Set your API key
payload = {
"type": "solar",
"name": "New solar site",
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "1h",
"usePhysicalModels": True,
"trainNearTermModels": False,
"trainLongTermModels": False
},
"assets": [
{
"azimuth": 180,
"tilt": 30,
"capacity": 1000,
"install_date": "2024-01-01"
}
]
}
url = "https://api.rebase.energy/platform/v2/sites"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
response = response.json()
```
As response you get the ID of the newly created site.
```python Response example theme={null}
{
"site_id": "a923653c-26f1-1b29-955d-ffde5d182276"
}
```
## Step 2. Upload generation data
To train an ML model you need to upload measured power generation data from the site. A good practice for better performance of the ML model is that the data
cover a period of one year at least with hourly or more frequent resolution.
```python Upload data theme={null}
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # This is the ID of the new site
payload = {"data": [
{
"valid_time": "2024-01-01T12:00:00Z",
"value": 300.5
},
{
"valid_time": "2024-01-01T13:00:00Z",
"value": 320.2
}
]
}
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/actual"
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
response = response.json()
```
When the data have been uploaded successfully, you get a response message.
```python Response example theme={null}
{
"message": "Actuals uploaded successfully"
}
```
## Step 3. Train ML model
To start the [training](/api-guides/train-site-models) of the ML models you will need to provide the site IDs and the training set splits.
```python Train model theme={null}
url = "https://api.rebase.energy/platform/v2/sites/models/train"
payload = {
"site_ids": ["a923653c-26f1-1b29-955d-ffde5d182276"],
"splits": [
{
"end_date": "2023-08-01T00:00Z",
"start_date": "2023-01-01T00:00Z"
},
{
"end_date": "2024-01-01T00:00Z",
"start_date": "2023-10-01T00:00Z"
}
]
}
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
response = response.json()
```
The response message informs that the training process has started.
```python Response example theme={null}
{
"message": "Training started"
}
```
## Step 4. Query forecast
When training is done, you can query the latest available forecast.
```python theme={null}
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/forecast"
response = requests.get(url, headers=headers)
response.raise_for_status()
response = response.json()
```
The response is a serialized table with the following columns:
`valid_time`: It contains the target times, i.e. the periods which are forecasted.
`forecast`: It contains the forecast values.
`model_name`: It contains the names of the models which create the forecasts.
`model_version`: It contains the versions of the models which create the forecasts.
`update_time`: It contains the issue/update time, i.e. the time when the forecasts were updated.
```python Response example theme={null}
{
"valid_time": [
"2024-01-01T00:00:00Z",
"2024-01-01T01:00:00Z",
"2024-01-01T02:00:00Z",
"2024-01-01T03:00:00Z",
"2024-01-01T04:00:00Z",
"2024-01-01T05:00:00Z",
"2024-01-01T06:00:00Z",
"2024-01-01T07:00:00Z",
"2024-01-01T08:00:00Z",
"2024-01-01T09:00:00Z"
],
"forecast": [
6000,
6000,
6000,
6000,
6000,
6000,
6000,
6000,
6000,
6000
],
"model_name": [
"My model",
"My model",
"My model",
"My model",
"My model",
"My model",
"My model",
"My model",
"My model",
"My model"
],
"model_version": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
"update_time": [
"2024-01-01T00:00:00Z",
"2024-01-01T00:00:00Z",
"2024-01-01T00:00:00Z",
"2024-01-01T00:00:00Z",
"2024-01-01T00:00:00Z",
"2024-01-01T00:00:00Z",
"2024-01-01T00:00:00Z",
"2024-01-01T00:00:00Z",
"2024-01-01T00:00:00Z",
"2024-01-01T00:00:00Z"
]
}
```
# Supported sites
Source: https://docs.rebase.energy/api-guides/set-up-sites
Create, update or delete forecast sites in the Rebase Platform.
## What sites are supported
We currently support the following types of sites:
1. `wind` for [wind power](/api-guides/create-site-wind) forecast.
2. `solar` for [solar (PV) power](/api-guides/create-site-solar) forecast.
3. `load` for [electricity demand](/api-guides/create-site-load) forecast.
# How to train ML models
Source: https://docs.rebase.energy/api-guides/train-site-models
Trigger the training of a site's ML forecast models
When you [upload](/api-guides/upload-power) the generation or consumption data to a site, a set of preconfigured machine learning (ML) models is created.
To start the training procedure of these models, you will need to provide a number of training parameters.
Currently the following parameters are supported.
**Site IDs** `site_ids`
Specify a list of site IDs for which ML models will be trained.
Example: `["8fa9ef1d-4s89-4waf-8g52-b1aww743by47"]`
**Training set splits** `splits`
Specify the starting and ending dates for the training data set splits. The ML model is trained only on the specific periods.
By making use of this parameter it is possible to exclude periods with low quality training data, e.g. curtailment or maintenance periods, outliers, etc.
If `splits` is omitted, then the whole training data set is used for training.
* **Starting period** `start_date`
Specify the starting timestamp.
Example: `"2022-01-01T00:00Z"`
* **Ending period** `end_date`
Specify the ending timestamp.
Example: `"2022-12-31T23:00Z"`
```python Train models theme={null}
import requests
api_key = "Your API key" # Set your API key
payload = {
"site_ids": ["8fa9ef1d-4s89-4waf-8g52-b1aww743by47"], # Set the sites IDs
"splits": [
{
"start_date": "2022-01-01T00:00Z",
"end_date": "2022-12-31T23:00Z"
},
{
"start_date": "2024-01-01T00:00Z",
"end_date": "2024-06-30T23:00Z"
}
]
}
url = "https://api.rebase.energy/platform/v2/sites/models/train"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
response = response.json()
```
The response message informs that the training process has started. This can take some time depending on the number of the sites, and the size of the training sets.
```python Response example theme={null}
{
"message": "Training started"
}
```
# How to update a site
Source: https://docs.rebase.energy/api-guides/update-site
Update site meta-data and settings.
To update the meta data of an existing site you will need to provide the new parameter values in a similar way as when creating a new site.
Below is an example of how to change the name of the site that was created with the solar [example](/api-guides/create-site-solar).
To retrieve the meta data of an existing site see [here](/api-guides/get-site-info).
```python Update site theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
payload = {
"type": "wind",
"name": "My new solar site", # The new site name
"latitude": 52.5,
"longitude": 13.4,
"settings": {
"model_resolution": "1h",
"usePhysicalModels": True,
"trainNearTermModels": False,
"trainLongTermModels": False
},
"assets": [
{
"azimuth": 180,
"tilt": 30,
"capacity": 1000,
"install_date": "2020-01-01"
}
]
}
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.put(url, headers=headers, json=payload)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
{
"message": "Site updated successfully"
}
```
# How to upload the capacity
Source: https://docs.rebase.energy/api-guides/upload-capacity
Upload the site capacity changes over the time
A site's installed capacity can change over time due to factors such as the addition or decommissioning of wind turbines or solar panels.
Additionally, available capacity may fluctuate due to technical issues or maintenance periods when some capacity is temporarily unavailable.
These capacity changes can be reflected by uploading the periods of change along with the updated capacity values.
Ensure that the capacity values are provided in **kilowatts \[kW]**.
```python theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
payload = {
"data": [
{
"valid_time": "2022-01-01T00:00:00Z",
"value": 2780.0
},
{
"valid_time": "2023-05-16T16:00:00Z",
"value": 3100.0
}
]
}
url = f'https://api.rebase.energy/platform/v2/sites/{site_id}/capacity'
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
{
"message": "Capacity uploaded successfully"
}
```
# How to integrate the power measurements
Source: https://docs.rebase.energy/api-guides/upload-power
Upload, download or delete the power generation or consumption data
## Upload power
[ML forecasting models](/home/how-it-works) require training with measured/observed power data, such as power generation for wind or solar sites or power consumption for load sites.
To upload the power data use the [Upload Site Actuals](/api-reference/site/upload-site-actuals) endpoint.
Ensure that all power values are provided in **kilowatts \[kW]** and that each timestamp refers to the **start** of the corresponding period.
```python Upload power data theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
payload = {
"data": [
{
"valid_time": "2022-05-16T13:00:00Z",
"value": 140.0 # Average power in kW between 13:00:00Z and 13:15:00Z
},
{
"valid_time": "2022-05-16T13:15:00Z",
"value": 156.6
},
{
"valid_time": "2022-05-16T13:30:00Z",
"value": 220.5
},
{
"valid_time": "2022-05-16T13:45:00Z",
"value": 310.7
},
{
"valid_time": "2022-05-16T14:00:00Z",
"value": 324.2
}
]
}
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/actual"
headers = {
'Authorization': api_key,
'Content-Type': 'application/json'
}
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
{
"message": "Actuals uploaded successfully"
}
```
## Download power
It is possible to fetch the uploaded power time series from the Rebase Platform using the [Get Site Actuals](/api-reference/site/get-site-actuals) endpoint. The API response contains the power values in **kW** and their corresponding timestamps.
The timestamps are returned in the provided timezone and refer to the **start** of the corresponding period. If no timezone is provided, the timestamps are returned in UTC.
The following paramaters can be specified in the request:
**Start date** `start_date`
Specify the start date for the time series to fetch. It is a string in ISO 8601 format.
Example: `2024-08-01T00:00:00Z`
**End date** `end_date`
Specify the end date for the time series to fetch. It is a string in ISO 8601 format.
Example: `2024-08-01T04:00:00Z`
**Timezone** `tz`
Specify the timezone for the timestamps. It is a string.
Example: `UTC`
```python Download power data theme={null}
import requests
import pandas as pd
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
url = f'https://api.rebase.energy/platform/v2/sites/{site_id}/actual'
headers = {
'Authorization': api_key,
'Content-Type': 'application/json'
}
start_date = pd.to_datetime('2024-08-01T00:00').strftime('%Y-%m-%d %H:%M')
end_date = pd.to_datetime('2024-08-01T04:00').strftime('%Y-%m-%d %H:%M')
tz = 'UTC'
params={
'start_date': start_date,
'end_date': end_date,
'tz': tz
}
response = requests.get(url=url, headers=headers, params=params)
response.raise_for_status()
response = response.json()
```
```python Response Example theme={null}
{
"valid_time": [
"2024-08-01T00:00:00+0000",
"2024-08-01T01:00:00+0000",
"2024-08-01T02:00:00+0000",
"2024-08-01T03:00:00+0000",
"2024-08-01T04:00:00+0000"
],
"values": [
50.6,
52.9,
64.7,
66.6,
70.2
]
}
```
## Delete power
To delete the uploaded power time series from the Rebase Platform use the [Delete Site Actuals](/api-reference/site/delete-site-actuals) endpoint. The API response contains a success message.
The following paramaters can be specified in the request:
**Start date** `start_date`
Specify the start date for the time series to delete. It is a string in ISO 8601 format.
Example: `2024-08-01T00:00:00Z`
**End date** `end_date`
Specify the end date for the time series to delete. It is a string in ISO 8601 format.
Example: `2024-08-01T04:00:00Z`
**Timezone** `tz`
Specify the timezone for the timestamps. It is a string.
Example: `UTC`
```python Delete power data theme={null}
import requests
import pandas as pd
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
url = f'https://api.rebase.energy/platform/v2/sites/{site_id}/actual'
headers = {
'Authorization': api_key,
'Content-Type': 'application/json'
}
start_date = pd.to_datetime('2024-08-01T00:00').strftime('%Y-%m-%d %H:%M')
end_date = pd.to_datetime('2024-08-01T04:00').strftime('%Y-%m-%d %H:%M')
tz = 'UTC'
params={
'start_date': start_date,
'end_date': end_date,
'tz': tz
}
response = requests.delete(url=url, headers=headers, params=params)
response.raise_for_status()
response = response.json()
```
The API response contains a success message.
```python Response example theme={null}
{
"message": "Actuals deleted successfully"
}
```
# How to upload other measured data
Source: https://docs.rebase.energy/api-guides/upload-ts
Upload weather and other time series to a site
Weather data and other type of time series can be uploaded to a site using the `type` parameter as tag.
The default value for `type` is `power` which corresponds to [measured generation or consumption data](/api-guides/upload-power).
Below is an example of how to upload the measured temperature values at the site's location.
```python Upload other time series theme={null}
import requests
api_key = "Your API key" # Set your API key
site_id = "a923653c-26f1-1b29-955d-ffde5d182276" # Set the site ID
tag = "temperature" # Set a tag for the time series you upload
payload = {
"type": tag,
"data": [
{
"valid_time": "2022-05-16T13:00:00Z",
"value": 16.5
},
{
"valid_time": "2022-05-16T14:00:00Z",
"value": 16.7
},
{
"valid_time": "2022-05-16T15:00:00Z",
"value": 17.2
}
]
}
url = f"https://api.rebase.energy/platform/v2/sites/{site_id}/actual"
headers = {"Authorization": api_key, "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
response = response.json()
```
```python Response example theme={null}
{
"message": "Actuals uploaded successfully"
}
```
# Get Model Input
Source: https://docs.rebase.energy/api-reference/model/get-model-input
get /platform/v2/models/{model_id}/input
Get the latest input data for a model
# Get Model Output
Source: https://docs.rebase.energy/api-reference/model/get-model-output
get /platform/v2/models/{model_id}/output
Get the output produced by a model, as_of can be specified
to get the output as it was at a specific point in time
If no start_date is provided, the start_date will be today 00:00 UTC
# Update Model
Source: https://docs.rebase.energy/api-reference/model/update-model
put /platform/v2/models/{model_id}
Update a model's settings.
You can update the following settings:
- serving_active
- serving_priority
# Create Site
Source: https://docs.rebase.energy/api-reference/site/create-site
post /platform/v2/sites
Create a new site
You can create a site with the following types:
- solar
- wind
- load
# Delete Site
Source: https://docs.rebase.energy/api-reference/site/delete-site
delete /platform/v2/sites/{site_id}
Delete a site and remove all of its data
# Delete Site Actuals
Source: https://docs.rebase.energy/api-reference/site/delete-site-actuals
delete /platform/v2/sites/{site_id}/actual
Delete the actuals of a site for a given date range
# Delete Site Capacity
Source: https://docs.rebase.energy/api-reference/site/delete-site-capacity
delete /platform/v2/sites/{site_id}/capacity
Delete the capacity of a site for a given date range
# Get Site
Source: https://docs.rebase.energy/api-reference/site/get-site
get /platform/v2/sites/{site_id}
Get a site by its id
# Get Site Actual Types
Source: https://docs.rebase.energy/api-reference/site/get-site-actual-types
get /platform/v2/sites/{site_id}/actual/types
Get the types of actuals available for a site
# Get Site Actuals
Source: https://docs.rebase.energy/api-reference/site/get-site-actuals
get /platform/v2/sites/{site_id}/actual
Get the actuals of a site for a given date range
# Get Site Capacity
Source: https://docs.rebase.energy/api-reference/site/get-site-capacity
get /platform/v2/sites/{site_id}/capacity
Get the capacity of a site for a given date range
# Get Site Forecast
Source: https://docs.rebase.energy/api-reference/site/get-site-forecast
get /platform/v2/sites/{site_id}/forecast
Get the forecast of a site for a given date range.
If no start_date is provided, 00:00 UTC of the current day is used.
# Get Site Forecast Updates
Source: https://docs.rebase.energy/api-reference/site/get-site-forecast-updates
get /platform/v2/sites/{site_id}/forecast/updates
Returns the timestamps of the forecast updates for a site
# List Site Models
Source: https://docs.rebase.energy/api-reference/site/list-site-models
get /platform/v2/sites/{site_id}/models
List the models of a site. Returns meta data about the models as well as training status.
# List Sites
Source: https://docs.rebase.energy/api-reference/site/list-sites
get /platform/v2/sites
List all of your sites. Returns meta data about the sites. The site ids can be used in other endpoints to query the forecast, actuals, and models etc.
# Train Site Models
Source: https://docs.rebase.energy/api-reference/site/train-site-models
post /platform/v2/sites/models/train
Train the models for one or more sites, specified by their site_id
# Update Site
Source: https://docs.rebase.energy/api-reference/site/update-site
put /platform/v2/sites/{site_id}
Update the information of a site, e.g. name, assets
# Upload Site Actuals
Source: https://docs.rebase.energy/api-reference/site/upload-site-actuals
post /platform/v2/sites/{site_id}/actual
Upload the actuals (energy production/energy consumption) for a site.
This is used for training the ML models and evaluating the forecast accuracy.
# Upload Site Capacity
Source: https://docs.rebase.energy/api-reference/site/upload-site-capacity
post /platform/v2/sites/{site_id}/capacity
Update the available capacity of a site. Upload the timestamps that the capacity changes,
the capacity will be forward filled from every timestamp.
# How to create new sites
Source: https://docs.rebase.energy/dashboard/create-site-ui
Create a new site to forecast in the Rebase Platform.
### Step 1. Add a new site
To create a site, start by clicking **Add site** in the top left corner of the screen.
### Step 2. Choose the type of the site
In the following page, choose the type of the new site. Currently, three (3) site types are supported: **Solar Power**, **Wind Power** and **Electricity Demand**.
### Step 3. Configure the site
Depending on your choice of the site type, the configuration will be different.
Choose the site type you want to configure in the tabs below.
#### Set name and location
To create a PV power forecast, select **Solar Power** in the drop-down list. Continue by adding a name to the site and setting the location.
This is done by adding the latitude and longitude of the location. You can use the map to check if the location is correct.
#### Set PV system parameters
You need to specify the values of the following PV system parameters.
* **Azimuth**: the orientation of the PV panels. It should be in degree values between 0 and 360 (0-North, 90-East, 180-South, 270-West).
* **Tilt**: the inclination of the PV panels. It should be in degree values between 0 and 90 (0-parallel, 90-perpendicular to ground).
* **Capacity**: the capacity of the solar park in kilowatts (kW).
* **Install date**: the date when the system was installed.
It is possible to add more PV systems by choosing **Add another system**.
In that case, the power forecast will be corresponding to the total power generation of all the PV systems.
This is useful for PV systems with multi-orientation or multi-inclination panels. For such PV systems, a new system with the corresponding capacity should be added for every inclination or orientation.
Finally, you need to select the temporal resolution of the forecasts. There are four (4) options: **15 min**, **30 min**, **1 hour** and **1 Day**.
#### Advanced settings
You can choose to enable or disable special forecasting models.
* **Train Autoregressive Forecasting models**: If checked, a model based on recent power observations will be trained for short-term forecasting. Power observations should be available in real time.
* **Train Long-Term Forecasting models**: If checked, a model based on typical meteorological year will be trained for long-term forecasting.
* **Train Weather-Agnostic/Offline Forecasting models**: If checked, a model that does not include any weather features will be trained.
* **Use physical models**: If checked, physical forecasting models will be deployed. No training data are required for physical models to work.
**Add additional weather points**: By choosing **Add weather point** you can assign additional locations. This is useful for solar power forecasting in a greater area.
#### Set name and location
To create a wind power forecast, select **Wind Power** in the drop-down list. Continue by adding a name to the site and setting the location.
This is done by adding the latitude and longitude of the location. You can use the map to check if the location is correct.
#### Set wind power system parameters
You need to specify the values of the following wind power system parameters.
* **Turbine model**: the model of the wind power turbines. There is drop-down list with all available models. If your model is not in the list, you can either choose a model with similar characteristics or pick **generic**.
If there are multiple wind turbine models use the **Add another turbine model** button to add them.
* **Hub height**: the height of the turbine hub in meters (m).
* **Quantity**: the number of the turbines.
* **Install date**: the date when the system was installed.
The following parameters are only needed for the **generic** turbine model:
* **Capacity**: the capacity of the wind turbine in kilowatts (kW).
* **Rotor diameter**: the diameter of the turbine rotor in meters (m).
Finally, you need to select the temporal resolution of the forecasts. There are four (4) options: **15 min**, **30 min**, **1 hour** and **1 Day**.
#### Advanced settings
You can choose to enable or disable special forecasting models.
* **Train Autoregressive Forecasting models**: If checked, a model based on recent power observations will be trained for short-term forecasting. Power observations should be available in real time.
* **Train Long-Term Forecasting models**: If checked, a model based on typical meteorological year will be trained for long-term forecasting.
* **Train Weather-Agnostic/Offline Forecasting models**: If checked, a model that does not include any weather features will be trained.
* **Use physical models**: If checked, physical forecasting models will be deployed. No training data are required for physical models to work.
**Add additional weather points**: By choosing **Add weather point** you can assign additional locations. This is useful for wind power forecasting in a greater area.
#### Set name and location
To create an electricity demand (load) forecast, select **Electricity Demand** in the drop-down list. Continue by adding a name to the site and setting the location.
This is done by adding the latitude and longitude of the location. You can use the map to check if the location is correct.
#### Set temporal resolution
You need to select the temporal resolution of the forecasts. There are four (4) options: **15 min**, **30 min**, **1 hour** and **1 Day**.
#### Advanced settings
You can choose to enable or disable special forecasting models.
* **Train Autoregressive Forecasting models**: If checked, a model based on recent electricity demand observations will be trained for short-term forecasting. Electricity demand observations should be available in real time.
* **Train Long-Term Forecasting models**: If checked, a model based on typical meteorological year will be trained for long-term forecasting.
* **Train Weather-Agnostic/Offline Forecasting models**: If checked, a model that does not include any weather features will be trained.
**Add additional weather points**: By choosing **Add weather point** you can assign additional locations. This is useful for electricity demand forecasting in a greater area. For example, you can set the coordinates of the major cities in the area.
### Step 4. Upload power measurements
Upload historical generation or demand data to train ML models. For wind or solar sites this is an optional step. If no power generation data are uploaded, then only physical models can be deployed.
For better performance of the ML models, the power measurements are recommended to have hourly or sub-hourly resolution. The platform accepts csv or xlsx files. [Find templates](https://drive.google.com/drive/folders/1T_Mgs3sGqxwmAy0kmFFtHQI_wJ9rVPmt).
# Edit forecast
Source: https://docs.rebase.energy/dashboard/edit-forecast
Edit forecast input and output data
It is possible to manually override both forecast model input and output data. This is done through
the "edit mode". When in the full screen forecast view for a specific site, click on the "edit mode"
botton to the top right.
You can change the forecasted output values by overriding them in the table to the right of the forecast.
If you want to change forecast model input values, then first select the model which model you want to
use in the top left.
The an edit table will appear below the forecast that you can
When you are done updating input values, click "rerun" in the lower right corner to rerun the model.
# Visualize the forecast
Source: https://docs.rebase.energy/dashboard/visualize-forecast
Visualizing energy forecast data
To visualize the forecast of a site in full screen mode, click the site name in the site overview.
The forecast for the site will be displayed in full screen mode.
# Data APIs
Source: https://docs.rebase.energy/home/data-apis
APIs for accessing energy-relevant data sources in one place.
The documentation on this page is focusing on interaction with the Rebase Platform.
If you are looking for our data APIs then you'll find them following the links below.
Weather forecast from world's leading meteorological institutes.
# How it works
Source: https://docs.rebase.energy/home/how-it-works
How energy forecasting works
## General approach
Energy forecasting is about creating mathematical models to predict future
energy supply and demand.
The idea behind forecasting, in general, is to use what we know today to predict what might happen tomorrow.
This knowledge may be based on theoretical understanding (such as calculating the amount of solar radiation incident on a tilted plane)
or on empirical analysis (such as identifying trends and seasonality in data). In practice, forecasting typically involves a combination of these approaches.
For energy forecasting specifically, one of the main sources of uncertainty is often the weather, making weather forecasting highly important.
In other cases, such as behaviour-driven or industrial electricity demand, the best predictor is often the time series itself.
It contains valuable information about how behaviour correlates with specific times of the day, days of the week, or days of the year.
## Input data sources
The input data sources used in the energy forecasting models are:
* Target time series itself
* Weather forecasts
* Other exogenous information
Other exogenous information typically consist of day types (as mentioned previously),
but can also be production plans, planned maintenance and even historical weather measurements.
Find more information about our data APIs [here](/home/data-apis).
## Approaches and frameworks
Any Python framework or code can be used in the Rebase Platform to develop energy forecasting models. Several commonly used frameworks already have pre-implemented energy forecasting models.
Below is a list of frameworks that include an implemented model:
| Model | Developer | Model type | Code and docs |
| - | - | - | - |
| `sklearn.LinearRegression` | Scikit-learn | Linear regression | [Code](https://github.com/scikit-learn/scikit-learn), [Docs](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html) |
| `statsmodels.ARIMA` | Statsmodels | ARIMA | [Code](https://github.com/statsmodels/statsmodels), [Docs](https://www.statsmodels.org/stable/generated/statsmodels.tsa.arima.model.ARIMA.html) |
| `sklearn.RandomForestRegressor` | Scikit-learn | Random forest regression | [Code](https://github.com/scikit-learn/scikit-learn), [Docs](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html) |
| `sklearn.RandomForestRegressor` | Scikit-learn | Random forest regression | [Code](https://github.com/scikit-learn/scikit-learn), [Docs](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html) |
| `LightGBM` | Microsoft | Gradient boosting decision trees | [Code](https://github.com/microsoft/LightGBM), [Docs](https://github.com/microsoft/LightGBM) |
| `XGBoost` | DMLC | Gradient boosting decision trees | [Code](https://github.com/microsoft/LightGBM), [Docs](https://github.com/microsoft/LightGBM) |
| `tensorflow` | Google | Neural networks | [Code](https://github.com/tensorflow/tensorflow), [Docs](https://www.tensorflow.org/guide) |
# Rebase Platform Documentation
Source: https://docs.rebase.energy/home/introduction
The Python-first energy forecasting platform
Rebase Platform is a cloud service that enables energy engineers and data scientists to
create, deploy and monitor fully customisable energy forecasting models at scale. The
platform supports creation of solar power, wind power and electricity demand forecasts
using state-of-the-art machine learning methods, including gradient boosting decision
trees and neural networks.