Skip to main content
Get started with Synthefy’s powerful forecasting API in minutes. This guide will walk you through making your first forecast using our Python client.

Installation

Install the Synthefy Python package:

Authentication

Set your API key as an environment variable (you can get your key here: https://console.synthefy.com/api-keys):
Or pass it directly to the client:

Basic Forecasting

Simple Sales Forecast

Here’s a complete example of forecasting sales data. We’ll create historical data and then prepare it for forecasting:
basic_forecast.py
Forecasting Reult
Sales Forecasting Plot

Using Leak Columns

When you have some knowledge about future information, like promotions, you can “leak” this data so our model can leverage it for the forecast.

Backtesting

Example: 7-Day Rolling Forecasts

Here’s how to backtest with 7-day forecast windows, moving forward 7 days at a time. The API automatically handles splitting your data into multiple time windows:
backtest_example.py
Backtesting Reult
Sales Backtesting Plot