---
title: "Weather-based renewable energy generation forecast"
method: POST
path: "/api/forecast/generation-forecast"
tags: ["Renewable Energy Forecasting"]
---

# Weather-based renewable energy generation forecast

`POST /api/forecast/generation-forecast`

## Request

- Base URL: `https://api.cernion.de`
- URL: `https://api.cernion.de/api/forecast/generation-forecast`
- Auth: none declared

Regional Solar/Wind generation forecast based on ACTUAL installed capacity from MaStR, combined with weather forecasts from Visual Crossing API.

**How it works:**
1. Queries MaStR database for ALL installed solar/wind capacity in the specified area
2. Fetches weather forecast from Visual Crossing API (24h cache, IEC-compliant)
3. Calculates expected generation using IEC 61853 (solar) / IEC 61400 (wind) standards
4. Returns daily MW forecast + weather conditions for up to 14 days

**Key Features:**
- Real installation data from German MaStR registry (3.7M+ installations)
- IEC standard compliance (IEC 61853 for solar, IEC 61400 for wind)
- Daily forecasts up to 14 days
- Filter by grid operator (MaStR ID), federal state, district, municipality, or postal code
- Optional cross-validation with SMARD data

**Use Cases:**
- **Grid Operators (VNB/GNB)**: Anticipate feed-in volumes and plan redispatch measures
- **Energy Suppliers (Stadtwerke)**: Optimize procurement by forecasting local renewable generation
- **Virtual Power Plants (VPP)**: Aggregate forecasts for trading and balancing markets
- **Energy Trading**: Intraday and day-ahead market positioning

**Parameters:**
- **installationType**: "solar" (default), "wind", or "all" (combined solar+wind)
- **forecastDays**: Forecast period 1-14 days (default: 7)
- **resolution**: Time resolution — `"daily"` (1 point/day, default), `"hourly"` (24 pts/day, intraday trading), `"15min"` (96 pts/day, §12 StromNZV balancing/scheduling)
- **gridOperatorMastrId**: MaStR Netzbetreiber-ID (SNB/GNB...) — use cernion_vnb_lookup to resolve BDEW→MaStR
- **bundesland**: German federal state (e.g., "Bayern", "Baden-Württemberg")
- **landkreis**: District/Landkreis name
- **gemeinde**: Municipality/Gemeinde name
- **postleitzahl**: 5-digit postal code (e.g., "69115")
- **latitude/longitude**: Coordinates for precise weather data
- **startDate**: Optional start date (`YYYY-MM-DD`). Omit for default tomorrow behaviour (no breaking change). Past dates retrieve **observed weather data** (Visual Crossing historical observations) — identical IEC calculation, 30-day cache. Response gains `summary.isHistorical` and `summary.dataMode` fields.
- **includeValidation**: Cross-validate with SMARD data (default: false)
- **installationMastrNummer**: Single-installation forecast by MaStR unit ID (SEE…=solar, SWE…=wind). **Highest priority** — overrides all regional filters. installationType is auto-derived from prefix.
- **messlokationId**: Single-installation forecast via Metering Location ID (MeLo, 33 chars, starts with DE). Resolved via NAP table. Priority: installationMastrNummer > messlokationId > gridOperatorMastrId > location.

## Query parameters

- `token` string

## Request body

- object
  - `installationType` 'solar' | 'wind' | 'all': Installation type to forecast
  - `forecastDays` number: Number of days to forecast (1-14)
  - `resolution` 'daily' | 'hourly' | '15min': Time resolution of forecast output. "daily" = 1 pt/day (default); "hourly" = 24 pts/day (intraday dispatch/trading); "15min" = 96 pts/day (§12 StromNZV balancing/scheduling, linear interpolation between hourly values)
  - `gridOperatorMastrId` string: MaStR Netzbetreiber-ID (SNB/GNB...). Use cernion_vnb_lookup to resolve BDEW → MaStR ID.
  - `installationMastrNummer` string: MaStR unit ID for single-installation forecast (SEE…=solar, SWE…=wind). Highest priority — overrides all regional filters. installationType is auto-derived from prefix.
  - `messlokationId` string: Metering location ID (MeLo, 33 chars, starts with DE). Resolved via NAP table. Priority: installationMastrNummer > messlokationId > gridOperatorMastrId > location.
  - `bundesland` string: German federal state
  - `landkreis` string: District/Landkreis name
  - `gemeinde` string: Municipality/Gemeinde name
  - `postleitzahl` string: 5-digit postal code
  - `latitude` number: Latitude for precise weather data
  - `longitude` number: Longitude for precise weather data
  - `startDate` string: Optional start date (YYYY-MM-DD). Omit for default tomorrow behaviour. Past dates switch to historical observation mode (30-day cache, observed weather instead of forecast).
  - `includeValidation` boolean: Cross-validate forecast with SMARD data
  - `format` 'json' | 'csv' | 'xlsx': Output format
  - `token` string: Optional Cernion MCP token for this request. Overrides CERNION_TOKEN when provided.

## Response `200`

Forecast generated successfully

- object
  - `success` boolean
  - `summary` object
    - `location` string
    - `type` string
    - `totalCapacityMW` number
    - `installationCount` number
    - `isHistorical` boolean: true when startDate is in the past (observed weather data used)
    - `dataMode` 'weather_forecast' | 'historical_observation': "weather_forecast" for future dates, "historical_observation" for past dates
    - `forecastPeriod` object
      - `start` string, date-time
      - `end` string, date-time
  - `forecasts` object[]
    - `timestamp` string, date-time
    - `generationMW` number: Forecasted generation in MW
    - `capacityFactor` number, nullable: Capacity factor (0-1)
    - `weather` object
      - `temperature` number: Temperature in °C
      - `windSpeed` number: Wind speed in m/s
      - `solarIrradiance` number: Solar irradiance in W/m²
      - `cloudCover` number: Cloud cover in %
  - `metadata` object
    - `toolName` string
    - `timestamp` string, date-time
    - `weatherDataSource` string
    - `iecStandardApplied` string: IEC 61853 for solar, IEC 61400 for wind
    - `cachingEnabled` boolean
    - `apiCallsUsed` number
    - `orientationCorrectionApplied` boolean
    - `portfolioOrientationFactor` number: Capacity-weighted azimuth+tilt factor from MaStR Hauptausrichtung
    - `orientationDataCoverage` number: Fraction of installations with MaStR orientation data

## Other responses

- `400`: Invalid request parameters
- `500`: Server error during forecast generation

---

[API](https://skmtc.dev/cernion/apis/cernion-energy-tools-api.md) · [All operations](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cernion/apis/cernion-energy-tools-api/revisions/cdb94473b538?raw)
