Skip to main content

Latest Forecasts

You should use this tutorial if you're looking for the most recent vintage of our best forecasts for your saved price nodes. It returns the data in a simple response structure and can be hooked up to your BI tools for traders and analysts.

The latest forecasts API returns the most recent forecasts for your saved price nodes. It will only return forecasts from the most recent vintage for a given timestamp, from our best model.

Confirm Access

  1. Log into the application at https://app.enertel.ai/app/grid
  2. Search for and select a price node and series in which you're interested
  3. Save the selection

You have just added a favourite forecast to your saved dashboard, which will be the default response to the latest forecasts API, for which the tutorial continues below.

Create a Token

  1. Click the user icon in the top right, create a token, and save it somewhere for safekeeping!

Accessing the Endpoint


import pandas as pd
import requests

token = '<api-token>'

start = '2024-05-17' # isoformat date
end = '2024-05-20' # isoformat date
api_version = 'v3' # v1 and v2 are deprecated


url = f"http://app.enertel.ai/api/forecasts/latest"
params = {
"start" : start,
"end" : end,
"api_version" : api_version,
}


resp = requests.get(
url,
headers={"Authorization": f"Bearer {token}"},
params=params,
)

print(resp.json())


Interpreting the Response

The response includes an array, each item of which corresponds to a given data series (RTLMP, DALMP) forecast at a given price node.

Instead of a nested JSON, you may want a simple dataframe that includes all the relevant information. Here it is!

forecasts = []

for target in resp:
for forecast in target['forecasts']:
forecasts.append({
'target_id': target['target_id'],
'object_name' : target['object_name'],
'series_name': target['series_name'],
'timezone': target['timezone'],
**forecast
})

df = pd.DataFrame(forecasts)

df.head()