POST /forecast

This endpoint allows you to get a time series forecast from the API.

Base URL

https://api.nolano.ai/forecast

Authentication

An API key must be provided in the request headers using the Authorization header.

Authorization: your_api_key_here

Headers

X-Model-Id
string

The ID of the model you want to use for the forecast. If not provided, the default model will be used.

Available Models

The API provides four different forecasting models, each optimized for different use cases:

Request Body

The request must be a JSON object with the following structure.

series
array
required

An array containing one or more time series objects. For now, only one is supported.

forecast_horizon
integer
required

The number of future periods you want to predict.

data_frequency
string
required

The frequency of your input timestamps. Must be one of: “Seconds”, “Minutes”, “Hours”, “Daily”, “Weekly”, “Monthly”, “Quarterly”, “Yearly”.

forecast_frequency
string
required

The desired frequency of the forecast output. Currently, this must match data_frequency.

confidence
float
default:"0.95"

The desired confidence level for the upper and lower forecast bounds. Must be between 0 and 1 (e.g., 0.95 for 95%).

Example Request

curl --location 'https://api.nolano.ai/forecast' \
--header 'Content-Type: application/json' \
--header 'Authorization: your_api_key_here' \
--header 'X-Model-Id: forecast-model-1' \
--data '{
  "series": [
    {
      "timestamps": ["2023-01-01T00:00:00", "2023-01-02T00:00:00"],
      "values": [100, 102]
    }
  ],
  "forecast_horizon": 24,
  "data_frequency": "Daily",
  "forecast_frequency": "Daily",
  "confidence": 0.95
}'

Response

On a successful request, the API will return a 200 OK status with a JSON object containing the forecast.

forecast_timestamps
array of strings

The timestamps for the forecasted values.

lower_bound
array of numbers

The lower bound of the forecast confidence interval.

median
array of numbers

The median forecasted values.

upper_bound
array of numbers

The upper bound of the forecast confidence interval.

Example Response

{
    "forecast_timestamps": ["2024-01-01T00:00:00", "2024-01-02T00:00:00"],
    "lower_bound": [145.5, 146.5],
    "median": [150.0, 151.0],
    "upper_bound": [154.5, 155.5]
}