Skip to main content
POST
Get Forecasted Demand by Type

Authorizations

Authorization
string
header
required

An API key, sent as Authorization: Bearer <key>. Create one in the SWITCH Copilot under Settings → API keys (needs the API keys permission in your company), or with POST /auth/api-keys. The key is shown once, at creation.

Path Parameters

forecast_type
string
required

Forecast type identifier (e.g. 'demand', 'unsatisfied-demand').

Body

application/json

Defines the filters applicable to a forecast request.

This schema includes parameters such as location, time granularity, prediction horizon, and grid details.

time_granularity_minutes
integer
required

Length of each forecast time bucket in minutes, e.g. 60. Together with prediction_horizon_size it must match one of the horizons enabled for your company; a 400 response lists them.

prediction_horizon_size
integer
required

Size of the prediction horizon in time steps (each one long time_granularity_minutes minutes)

grid
GridFilters · object
required

Grid schema defining the spatial structure for the forecast

zones_whitelist
string[] | null

Optional list of zone IDs to include in the response. If provided, only zones in this list will be returned.

zones_blacklist
string[] | null

Optional list of zone IDs to exclude from the response. Takes precedence over zones_whitelist when both are provided.

Response

Successfully retrieved forecast predictions for the specified type with time periods and zone-aggregated values.

Represents the response structure for a forecast request.

This schema includes the time periods and forecasted values for different zones.

periods
string<date-time>[]
required

Start of each forecast time bucket (UTC), in order

zones
Zones · object
required

Forecasted value per zone: zone id -> one value per entry of periods, in the same order. Zones whose values are all zero are left out.

Example: