api/post/forecast.py
# POST /forecast
import requests
url = "https://api.retrocast.com/forecast?model=navi"
payload = {
"series": [
{
"future_variables": { "local_attendance_forecast": [125, 75, 200, 122, 123, 150, 100, 120, 121, 119] },
"future_variables_index": ["2001-01-06", "2001-01-07", "2001-01-08", "2001-01-09", "2001-01-10", "2001-01-11", "2001-01-12", "2001-01-13", "2001-01-14", "2001-01-15"],
"hist_variables": { "temperature": [74, 72, 79, 77, 75] },
"index": ["2001-01-06", "2001-01-07", "2001-01-08", "2001-01-09", "2001-01-10"],
"static_variables": { "Population": 100000 },
"target": [125, 120, 140, 135, 133]
}
],
"horizon": 5,
"freq": "D"
}
headers = {
"Authorization": "Bearer YOUR_KEY_HERE",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)