logo
Overview
API Reference
Authentication
Model inference
Submit job for retrocasting
Retrieve job result
OpenAPI spec
powered by zuplo
Sign in

The Forecasting Company API

Welcome to the TFC API. If you have any issues or feedback please get in touch with us at support@theforecastingcompany.com.

BASE URL
https://api.retrocast.com

Authentication

Sign into view and manage your API credentials

Model inference

Perform inference with foundation models.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Query Parameters

model

required, string enum, default: tabpfn-ts

The forecasting model to use for inference. Note that only tabpfn-ts, moirai and moirai-moe support exogenous variables.

Possible Enum Values

moirai

chronos

chronos-bolt

timesfm

timesfm-2

moirai-moe

tabpfn-ts

Request Body

series

required, array

horizon

required, integer, maximum value of 1000, minimum value of 1

Number of steps to forecast given the frequency.

freq

required, string enum

Frequency of the time series.

Possible Enum Values

H

D

W

M

Q

Y

15min

context
optional, default: null

The amount of history to use when forecasting. This is the number of steps to look back in the target series. More history can improve the forecast accuracy, but can also increase the computation time. By default this is set to the max of model capability or the length of the provided target series, whichever is shorter.

quantiles

optional, array of numbers, default: [0.1,0.9,0.4,0.5]
covariates
optional, default: null

Apply additional co-variates provided by TFC. Only supported by the following models: Navi, Moirai, Moriai-MoE and TabPFN-TS.

POST
/forecast
1
EXAMPLE BODY
{
  "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",
  "context": 20,
  "quantiles": [
    0.1,
    0.9,
    0.4,
    0.5
  ],
  "covariates": [
    {
      "config": {
        "country": "US"
      },
      "type": "holidays'"
    }
  ]
}

Submit job for retrocasting

Perform historic inference for a range of forecast creation dates (fcds). These jobs can run longer and need to be retrieved with a separate endpoint and the returned job ID.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Query Parameters

model

required, string enum, default: tabpfn-ts

The forecasting model to use for inference. Note that only tabpfn-ts, moirai, and moirai-moe support exogenous variables.

Possible Enum Values

tabpfn-ts

moirai

chronos

chronos-bolt

timesfm

timesfm-2

time-moe

Request Body

series

required, array

horizon

required, integer, maximum value of 1000, minimum value of 1

Number of steps to forecast given the frequency.

freq

required, string enum

Frequency of the time series.

Possible Enum Values

H

D

W

M

Q

Y

15min

context
optional, default: null

The amount of history to use when forecasting. This is the number of steps to look back in the target series. More history can improve the forecast accuracy, but can also increase the computation time. By default this is set to the max of model capability or the length of the provided target series, whichever is shorter.

quantiles

optional, array of numbers, default: [0.1,0.9,0.4,0.5]
covariates
optional, default: null

Apply additional co-variates provided by TFC. Only supported by the following models: Navi, Moirai, Moriai-MoE and TabPFN-TS.

POST
/retrocast-jobs
1
EXAMPLE BODY
{
  "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",
  "context": null,
  "quantiles": [
    0.1,
    0.9,
    0.4,
    0.5
  ],
  "covariates": [
    {
      "config": {
        "country": "US"
      },
      "type": "holidays'"
    }
  ]
}

Retrieve job result

Retrieve the forecast result from a retrocast job.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

job_id

required, string
GET
/retrocast-jobs/:job_id
1

OpenAPI spec

Return the OpenAPI spec for the TFC API.

GET
/openapi
1