Forecasting API · Public
API Reference
REST API for time-series forecasting. Send a series, get predictions back.
Base URL
api.oab-forecasting.comAuthentication
Bearer <key>→ Generate keyVersioning
v1 · v1.0.0→ ChangelogAvailable Models
chronosAmazon Chronostiny · small · base · largeNochronos-2Amazon Chronos-2small · baseYestimesfmGoogle TimesFM200mNotimesfm-2Google TimesFM 2.5200mNomoirai-2Salesforce Moirai-2smallYestabpfn-tsTabPFN-TSdefaultYesRun a Forecast
Make your first forecast call in seconds. Works in terminal, Jupyter, and Google Colab.
DataFrame (df)
| date | value (float) |
|---|---|
| 2024-01-01 | 120.0 |
| 2024-02-01 | 126.0 |
| 2024-03-01 | 133.0 |
| 2024-04-01 | 129.0 |
| ... | ... |
DatetimeIndex · one row per timestep · sorted ascending
POST /forecast · series[0]
"index": ["2024-01-01", "2024-02-01", ...]
"target": [120.0, 126.0, ...]
}
index & target — same length · extracted via df.index.strftime("%Y-%m-%d").tolist()
requestsPython 3.8+·Notebookmatplotlibpandasimport os, requests
from getpass import getpass
# ── Setup
API_KEY = os.environ.get("API_KEY") or getpass("Enter your API key: ")
BASE_URL = "https://api.oab-forecasting.com"
# ── Model selection
MODEL = "chronos-2" # chronos | chronos-2 | timesfm | timesfm-2 | moirai-2 | tabpfn-ts
MODEL_SIZE = "base" # chronos: tiny|small|base|large · chronos-2: small|base
# ── Input data
index = ["2024-01-01","2024-02-01","2024-03-01","2024-04-01",
"2024-05-01","2024-06-01","2024-07-01","2024-08-01",
"2024-09-01","2024-10-01","2024-11-01","2024-12-01"]
target = [120.0, 126.0, 133.0, 129.0, 138.0, 145.0,
141.0, 149.0, 152.0, 148.0, 155.0, 162.0]
# ── Covariates (optional — supported by chronos-2, moirai-2, tabpfn-ts)
horizon = 6
hist_variables = {
"temperature": [20.0, 21.0, 22.0, 23.0, 24.0, 25.0,
26.0, 27.0, 26.0, 24.0, 22.0, 20.0],
"promotion": [0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0],
}
future_variables = {
"temperature": [19.0, 20.0, 21.0, 22.0, 23.0, 24.0],
"promotion": [1.0, 0.0, 1.0, 0.0, 1.0, 0.0],
}
future_variables_index = [
"2025-01-01","2025-02-01","2025-03-01",
"2025-04-01","2025-05-01","2025-06-01",
]
# ── API request
payload = {
"series": [{
"index": index,
"target": target,
"hist_variables": hist_variables,
"future_variables": future_variables,
"future_variables_index": future_variables_index,
}],
"horizon": horizon,
"freq": "MS", # MS | D | W | H | Q | Y
"quantiles": [0.1, 0.5, 0.9],
"model": MODEL,
"model_size": MODEL_SIZE,
}
resp = requests.post(
f"{BASE_URL}/forecast",
headers={"Authorization": f"Bearer {API_KEY}"},
json=payload,
timeout=60,
)
resp.raise_for_status()
result = resp.json()
print(f"Model: {result['model']} | Status: {result['status']}\n")
pred = result["series"][0][0]["prediction"]
idx = result["series"][0][0]["index"]
print("Forecast:")
for i, date in enumerate(idx):
print(f"{date} p50={pred['0.5'][i]:6.2f} [{pred['0.1'][i]:6.2f}–{pred['0.9'][i]:6.2f}]")
API_KEY as an env var to skip the prompt, or just paste it when asked.