Quickstart Guide

Get started with ForecastAPI in just 5 minutes. This guide will walk you through making your first forecast request.

Prerequisites

You'll need an API key to get started. Sign up for a free account to get your key and 1,000 free API calls per month.

Step 1: Get Your API Key

  1. 1
    Sign up for a free account at /register
  2. 2
    Navigate to your Dashboard and click "API Keys"
  3. 3
    Click "Generate New Key" and copy your API key

Step 2: Prepare Your Data

ForecastAPI works with time series data in a simple JSON format. Your data should include:

  • identifier: A unique identifier for the data series (e.g., SKU, product ID)
  • date: The time period (YYYY-MM-DD) in UTC
  • value: The numeric value for that period

Example Data Format

{
  "identifier": "SKU-12345",
  "data": [
    {"date": "2024-01-01", "value": 120},
    {"date": "2024-02-27", "value": 135},
    {"date": "2024-03-31", "value": 155},
    {"date": "2024-04-01", "value": 142},
    {"date": "2024-05-01", "value": 168}
  ],
  "periods": 6,
  "frequency": "M",
  "data_type": "sales"
}

Step 3: Make Your First Request

forecastapi.com
curl -X POST https://forecastapi.com/v2/forecast \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "identifier": "SKU-12345",
    "data": [
      {"date": "2024-01", "value": 120},
      {"date": "2024-02", "value": 135},
      {"date": "2024-03", "value": 155}
    ],
    "periods": 6,
    "frequency": "M"
  }'

# Response in 287ms
{
  "forecast": [
    {"date": "2024-04", "value": 168.5, "lower": 162.3, "upper": 174.7},
    {"date": "2024-05", "value": 175.2, "lower": 168.1, "upper": 182.3},
    ...
  ],
  "method": "exponential_smoothing",
  "confidence": 0.80
}

Understanding the Response

ForecastAPI returns a comprehensive response with your forecast and additional insights:

{
  "result": {
    "identifier": "SKU-12345",
    "tenant_context": null,
    "forecasts": [
      { "period": 1, "date": "2024-06-01", "forecast": 175.2, "lower": 168.1, "upper": 182.3 },
      { "period": 2, "date": "2024-07-01", "forecast": 181.5, "lower": 173.8, "upper": 189.2 }
    ],
    "model_info": {
      "best_model": "AutoETS",
      "models_evaluated": ["AutoETS", "AutoARIMA", "AutoTheta", "SeasonalNaive"],
      "selection_metric": "smape",
      "interval_source": "conformal"
    }
  },
  "meta": {
    "selection_metric": "smape",
    "timing": { "validation": 8.2, "selection": 45.6, "forecasting": 72.1, "total": 125.9 }
  }
}

Response Fields

Field Description
result.forecasts Array of forecast periods — each has period, date, forecast, and lower/upper bounds
result.identifier Echoes the series identifier you sent in the request
result.model_info The model that was automatically selected, the models evaluated, and their back-testing scores
meta The selection metric used and per-stage timings (in milliseconds)

Common Parameters

Data Type

Specify your data type for optimized model selection:

  • "sales" - Sales data (uses intermittent demand methods for sparse data)
  • "demand" - Demand forecasting
  • "inventory" - Inventory levels
  • "web_traffic" - Website analytics
  • Custom values - Any string for custom data types

Frequency

Specify your data frequency:

  • "D" - Daily
  • "W" - Weekly
  • "M" - Monthly
  • "Q" - Quarterly
  • "Y" - Yearly
  • "H" - Hourly

What's Next?