How the 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, etc. The forecast is constructed by using the individual model forecasts for different time horizons based on some prioritization 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 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.

How to query the latest forecast

To query the most recently updated forecast, you need to provide the ID of the site.

Get latest forecast
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()
Response example
{
    "valid_time": [
        "2024-06-28T06:15:00+0000",
        "2024-06-28T06:30:00+0000",
        "2024-06-28T06:45:00+0000",
        "2024-06-28T07:00:00+0000",
        "2024-06-28T07:15:00+0000"
    ],
    "forecast": [
        0.11206686960981,
        0.140317812698395,
        0.162892523432014,
        0.185522487912443,
        0.225405469535368
    ],
    "model_name": [
        "Solar_MetOfficeGlobalHiRes_Physical",
        "Solar_MetOfficeGlobalHiRes_Physical",
        "Solar_MetOfficeGlobalHiRes_Physical",
        "Solar_MetOfficeGlobalHiRes_Physical",
        "Solar_MetOfficeGlobalHiRes_Physical"
    ],
    "model_version": [
        1.0,
        1.0,
        1.0,
        1.0,
        1.0
    ],
    "update_time": [
        "2024-06-28T00:00:00+0000",
        "2024-06-28T00:00:00+0000",
        "2024-06-28T00:00:00+0000",
        "2024-06-28T00:00:00+0000",
        "2024-06-28T00:00:00+0000"
    ]
}

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 for update_time and valid_time is UTC. You can specify a different time zone in the requests parameters.

Get latest forecast in different time zone
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()