Skip to main content
POST
Get Forecasted Demand as GeoJSON

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.

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 as GeoJSON with spatial geometries and prediction values.

geojson
Geojson · object
required

GeoJSON FeatureCollection with one Polygon feature per forecasted zone; each feature's properties are zone_id and predictions (one value per entry of periods).

Example:
periods
string<date-time>[]
required

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