The Forecasting Company Logo

Cookbook

Worked examples of common requests. Each one is a complete request body for the beta endpoint, POST https://api.retrocast.com/v1-beta/forecast?model=t0-alpha, using the same request body as the Introduction — only the fields each example needs change. The model query parameter is required on every call. Every page ends with a "What comes back" section showing the response.

Lengths of time — prediction_length, context, lead_time, the every of a backtest — take either a number of steps of your data's time grid (14) or a duration string: "28d", "2w", "1mo", "1d 12h". The units are y, q, mo, w, d, h, m (minutes), s and us; ISO 8601 ("P2W") works too. A duration must be a whole number of steps, so "1mo" doesn't fit daily data. Responses always write durations in ISO 8601: P1D for a day, PT0S for none.


Every field used here — and the ones these examples leave out, like hierarchies of covariates — is described in the API Reference. If something doesn't work the way these examples suggest, email [email protected].

Last modified on