{
  "openapi": "3.0.1",
  "info": {
    "title": "Time Series Forecasting (Chronos-2): Sales, Demand, Traffic",
    "description": "Forecast sales, demand, traffic, prices or any time series with Amazon's Chronos-2 model: prediction intervals, backtest accuracy, seasonality, a plain-language summary and a chart per series. From values, CSV, Excel, Google Sheets or an Apify dataset. For AI agents.",
    "version": "0.1",
    "x-build-id": "cFw7kx8lEjbMwhOu8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jumblemog~time-series-forecasting/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jumblemog-time-series-forecasting",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/jumblemog~time-series-forecasting/runs": {
      "post": {
        "operationId": "runs-sync-jumblemog-time-series-forecasting",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/jumblemog~time-series-forecasting/run-sync": {
      "post": {
        "operationId": "run-sync-jumblemog-time-series-forecasting",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "data": {
            "title": "Data rows (JSON)",
            "type": "array",
            "description": "Rows with a date column and one or more number columns, such as [{\"date\": \"2025-01\", \"sales\": 1200}, ...]. Long data (one row per date and product, store or ticker) and wide data (one column per series) both work, and so do an object of dates and values ({\"2025-01\": 1200, ...}). To use what you already know about the future (planned promotions, prices), add rows for future dates with the value left empty and the covariate columns filled in. The example is 5 years of monthly CO2 at Mauna Loa (NOAA, public domain)."
          },
          "values": {
            "title": "Values (one series)",
            "type": "array",
            "description": "A single series as numbers, oldest first: [112, 118, 132, 129, ...]. Add Dates, or a Start date (and Frequency), for dated forecasts; otherwise the forecast counts steps."
          },
          "dates": {
            "title": "Dates for the values",
            "type": "array",
            "description": "One date per value, such as [\"2025-01-01\", \"2025-01-02\", ...]. Optional."
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "The date of the first value when the values have no dates: 2025-01-01 (daily), 2025-01 (monthly), 2025-Q1 (quarterly) or 2025 (yearly). Also used for tables without a date column."
          },
          "series": {
            "title": "Several series (JSON)",
            "type": "array",
            "description": "Named series, each with its own values and dates or start date: [{\"name\": \"Store A\", \"values\": [...], \"startDate\": \"2025-01-01\", \"frequency\": \"day\"}, ...]. A series can carry covariates, such as \"covariates\": {\"promo\": [0, 1, 0, ...]}; a covariate list longer than the values gives its known future values."
          },
          "csv": {
            "title": "CSV data",
            "type": "string",
            "description": "CSV or TSV text with a header row, such as date,sales on the first line and 2025-01-01,1200 on the next. Comma, semicolon, tab and pipe separators work; lines starting with # are skipped."
          },
          "dataUrl": {
            "title": "Data file link",
            "type": "string",
            "description": "A link to a CSV, TSV, JSON or Excel (.xlsx) file. Google Sheets share links (shared as \"Anyone with the link\"), GitHub file links and JSON API answers work. The site's robots.txt is respected."
          },
          "datasetId": {
            "title": "Apify dataset",
            "type": "string",
            "description": "Forecast the items of a dataset in your account, such as a scraper's results with dates and numbers (prices, reviews per day, followers, search interest). Lists of dated items inside each item (timelines, price histories) are read too. Up to 500,000 items; the tool gets read access to this dataset only."
          },
          "dateField": {
            "title": "Date column",
            "type": "string",
            "description": "The column with dates or times. Empty: a column named like date, time, month or timestamp, or year and month columns together."
          },
          "valueFields": {
            "title": "Columns to forecast",
            "type": "array",
            "description": "The number columns to forecast, each one a series. Empty: the number columns that aren't ids, years or coordinates (for stock prices, the close).",
            "items": {
              "type": "string"
            }
          },
          "seriesFields": {
            "title": "Series columns",
            "type": "array",
            "description": "Columns that tell the series apart in long data, such as store and product, or ticker. Empty: found when dates repeat.",
            "items": {
              "type": "string"
            }
          },
          "covariateFields": {
            "title": "Covariate columns",
            "type": "array",
            "description": "Columns that help predict the values, such as price, promotion or temperature (numbers or labels). Their values in future rows (rows with the value left empty) are used as known future values.",
            "items": {
              "type": "string"
            }
          },
          "frequency": {
            "title": "Frequency",
            "enum": [
              "auto",
              "minute",
              "5min",
              "15min",
              "30min",
              "hour",
              "day",
              "business day",
              "week",
              "month",
              "quarter",
              "year"
            ],
            "type": "string",
            "description": "The time step of the series and the forecast. Auto finds it from the dates; irregular dates (orders, posts) are put on a daily, weekly or monthly grid. Choosing a coarser step than the data's (week for daily data) adds the values up or averages them per step.",
            "default": "auto"
          },
          "aggregate": {
            "title": "Values in the same step",
            "enum": [
              "auto",
              "sum",
              "mean",
              "median",
              "min",
              "max",
              "first",
              "last",
              "count"
            ],
            "type": "string",
            "description": "How to combine several values that fall in the same step, such as many orders on one day. Count rows forecasts the number of rows per step, for data with dates but no number to forecast.",
            "default": "auto"
          },
          "fillMissing": {
            "title": "Missing steps",
            "enum": [
              "auto",
              "leave",
              "zero",
              "previous",
              "interpolate"
            ],
            "type": "string",
            "description": "What steps without data mean. Chronos-2 handles gaps itself, so leaving them is usually best; days without orders are 0.",
            "default": "auto"
          },
          "horizon": {
            "title": "Steps to forecast",
            "minimum": 1,
            "maximum": 1024,
            "type": "integer",
            "description": "How many steps ahead to forecast (12 for a year of months). Empty: the future rows the data lists, or 48 hours, 30 days, 22 business days, 13 weeks, 12 months, 8 quarters or 5 years."
          },
          "intervals": {
            "title": "Prediction intervals (%)",
            "type": "array",
            "description": "The ranges the actual values should fall in with these probabilities, such as [80, 95]: each step gets lower80 and upper80, lower95 and upper95.",
            "default": [
              80,
              95
            ]
          },
          "quantiles": {
            "title": "Extra quantiles",
            "type": "array",
            "description": "Quantiles to add to each step, between 0 and 1, such as [0.05, 0.9] for q5 and q90 (a 90% service level for stock planning)."
          },
          "holidays": {
            "title": "Public holidays",
            "type": "string",
            "description": "A country code (US, GB, DE, FR, IN...) or region (US-CA, GB-SCT, DE-BY) whose public holidays the model should know about, past and future. For daily, business-day, weekly and hourly data."
          },
          "nonNegative": {
            "title": "No negative forecasts",
            "enum": [
              "auto",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Keeps forecasts and intervals at 0 or above, for sales, counts and prices.",
            "default": "auto"
          },
          "crossLearning": {
            "title": "Learn across series",
            "type": "boolean",
            "description": "Lets the model use all series of the run together. Helps short series of related items (products of one store); leave off for unrelated series.",
            "default": false
          },
          "contextLength": {
            "title": "History to use (steps)",
            "minimum": 16,
            "maximum": 8192,
            "type": "integer",
            "description": "The most recent steps of history the model reads. Empty: up to 8,192, the model's limit."
          },
          "seriesName": {
            "title": "Series name",
            "type": "string",
            "description": "A name for the series given in Values. Default: value."
          },
          "backtest": {
            "title": "Backtest",
            "type": "boolean",
            "description": "Forecasts the most recent past from the data before it and measures the error (MAE, MAPE, WAPE, MASE), compares it with simply repeating the last cycle, and checks how often the intervals held the actual values.",
            "default": true
          },
          "backtestWindows": {
            "title": "Backtest windows",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many past windows to test, each as long as the forecast. Empty: 3, or 1 for runs with more than 100 series."
          },
          "detectAnomalies": {
            "title": "Find unusual values",
            "type": "boolean",
            "description": "Checks the last 512 steps of history for values far outside what the model expected from the values before them (spikes, drops, data errors) and lists them with their expected range.",
            "default": false
          },
          "chart": {
            "title": "Charts",
            "type": "boolean",
            "description": "Draws each forecast: the history, the forecast and its intervals, and unusual values.",
            "default": true
          },
          "chartFormats": {
            "title": "Chart formats",
            "type": "array",
            "description": "PNG for chats, emails, docs and slides; SVG and PDF stay sharp at any size; HTML shows each value on hover.",
            "items": {
              "type": "string",
              "enum": [
                "png",
                "svg",
                "pdf",
                "html"
              ],
              "enumTitles": [
                "PNG",
                "SVG",
                "PDF",
                "Interactive HTML (hover for values)"
              ]
            },
            "default": [
              "png"
            ]
          },
          "chartTheme": {
            "title": "Chart theme",
            "enum": [
              "light",
              "dark"
            ],
            "type": "string",
            "description": "Light or dark background.",
            "default": "light"
          },
          "chartHistory": {
            "title": "History shown (steps)",
            "minimum": 1,
            "type": "integer",
            "description": "How many past steps the chart shows. Empty: four times the forecast length (at least 60)."
          },
          "title": {
            "title": "Chart title",
            "type": "string",
            "description": "Title of the first chart. Empty: the series name."
          },
          "maxCharts": {
            "title": "Most charts",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Charts are drawn for this many series; the rest get forecasts without charts.",
            "default": 25
          },
          "maxSeries": {
            "title": "Most series",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Forecast at most this many series. Each series forecast is one charge.",
            "default": 1000
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}