# Prognose-API

Der Prognose-Endpunkt liefert kurzfristige, hochauflösende 15-Minuten-Zeitreihendaten — +7 Tage voraus und −30 Tage zurück — für Photovoltaikanlagen basierend auf Standort und Anlagenkonfiguration. Der Endpunkt unterstützt `GET`-Anfragen und benötigt zwingend `latitude`, `longitude` sowie `slope` und `orientation`.

:::note
Nutzer des kostenlosen Tarifs erhalten Prognosedaten nur für +1 Tag (heute und morgen) und keine vergangenen Tage.
:::

:::note
**Anfragelimits** hängen vom Tarif ab:
- **Free:** 40 Anfragen pro Monat
- **Bezahlte Tarife:** 1.000 Anfragen pro Monat
- **Nowcast-Tarif:** 3.000 Anfragen pro Monat

Es gilt Fair-Use-Nutzung. Limits können sich ändern. Je nach Abo können individuelle Limits gelten.

Unabhängig vom Tarif gilt ein **Rate-Limit von 10 Anfragen pro Sekunde**. Bei Überschreitung wird `429` zurückgegeben.
:::

## Nowcast

:::tip
Satelliten-Nowcast-Daten (~1,5 × 1,5 km) verbessern die Prognose mit hochauflösenden Daten und sind für Nutzer im **Nowcast-Tarif** **standardmäßig aktiviert**. Die Funktion kann durch Übergabe des URL-Parameters <code>nowcast=False</code> deaktiviert werden.

**Updates:** In Europa alle **10 Minuten**. Außerhalb Europas alle **15 Minuten** in ausgewählten Regionen.
:::

## Basis-URL

```
https://api.pvnode.com/v1/forecast/
```

## Beispielanfrage

Die folgenden Beispiele zeigen, wie die erforderlichen Parameter übergeben und der [API-Key](/docs/de/authentication) zur Authentifizierung genutzt wird. Das Beispiel verwendet eine Neigung (`slope`) von 30 Grad, eine Ausrichtung (`orientation`) von 180 Grad (Süden) und den Standort Rosenheim, Deutschland mit den Koordinaten `latitude`: 47.84812, `longitude`: 12.06231.

<CodeTabs>

    ```python
    import requests

    url = 'https://api.pvnode.com/v1/forecast/'
    body = {
    "latitude": 47.84812,
    "longitude": 12.06231,
    "slope": 30,
    "orientation": 180
}
    headers = {
    'Authorization': 'Bearer ' + YOUR_API_KEY
}
    response = requests.get(url, headers=headers, params=body)
    data = response.json()
    ```

    ```javascript
    const axios = require('axios');

    const url = 'https://api.pvnode.com/v1/forecast/';
    const params = {
    latitude: 47.84812,
    longitude: 12.06231,
    slope: 30,
    orientation: 180
};
    const headers = {
    Authorization: 'Bearer YOUR_API_KEY'
};

    axios.get(url, {headers, params})
    .then(response => {
    console.log(response.data);
})
    .catch(error => {
    console.error('Error during API call:', error);
});
    ```

</CodeTabs>

Dies ist die Basis-Konfiguration. Die API unterstützt viele weitere Parameter für Verschattung, Tracker-Systeme, Moduleigenschaften und mehr — die vollständige Liste findet sich in der [API-Referenz](/api/v1-endpoints#forecast).

## Erweiterte Konfiguration

<div className="not-prose mt-4">
    <div className="grid sm:grid-cols-2 gap-3">
        <a href="/docs/de/guides/shading-horizon"
           className="group block rounded-xl border border-border bg-card p-5 hover:border-primary/50 hover:shadow-lg hover:shadow-primary/5 transition-all">
            <h3 className="font-semibold text-sm mb-1 group-hover:text-primary transition-colors">Verschattung &amp; Horizont</h3>
            <p className="text-xs text-muted-foreground leading-relaxed">Horizontprofile, Reihenverschattung und weitere
                Verschattungsszenarien konfigurieren.</p>
        </a>
        <a href="/docs/de/guides/tracker-configuration"
           className="group block rounded-xl border border-border bg-card p-5 hover:border-primary/50 hover:shadow-lg hover:shadow-primary/5 transition-all">
            <h3 className="font-semibold text-sm mb-1 group-hover:text-primary transition-colors">Tracker-Konfiguration</h3>
            <p className="text-xs text-muted-foreground leading-relaxed">Einachsige und zweiachsige Tracker-Systeme mit
                eigenen Parametern einrichten.</p>
        </a>
        <a href="/docs/de/guides/demand-profiles"
           className="group block rounded-xl border border-border bg-card p-5 hover:border-primary/50 hover:shadow-lg hover:shadow-primary/5 transition-all">
            <h3 className="font-semibold text-sm mb-1 group-hover:text-primary transition-colors">Lastprofile</h3>
            <p className="text-xs text-muted-foreground leading-relaxed">Lastprofile einbinden, um Eigenverbrauch und
                Netzeinspeisung zu modellieren.</p>
        </a>
        <a href="/docs/de/guides/weather-codes"
           className="group block rounded-xl border border-border bg-card p-5 hover:border-primary/50 hover:shadow-lg hover:shadow-primary/5 transition-all">
            <h3 className="font-semibold text-sm mb-1 group-hover:text-primary transition-colors">Wettercodes</h3>
            <p className="text-xs text-muted-foreground leading-relaxed">Referenz für Wettercode-Werte, die in der
                Prognose-Antwort zurückgegeben werden.</p>
        </a>
        <a href="/docs/de/guides/data-columns"
           className="group block rounded-xl border border-border bg-card p-5 hover:border-primary/50 hover:shadow-lg hover:shadow-primary/5 transition-all">
            <h3 className="font-semibold text-sm mb-1 group-hover:text-primary transition-colors">Datenspalten</h3>
            <p className="text-xs text-muted-foreground leading-relaxed">Vollständige Referenz aller Felder, die in der
                Prognose-Antwort enthalten sind.</p>
        </a>
    </div>
</div>
