# History API

Der History-Endpunkt liefert detaillierte historische 15-Minuten-Zeitreihendaten ab 2015 bis einschließlich gestern, basierend auf Standort und Anlagenkonfiguration. Der Endpunkt unterstützt `GET`-Anfragen und benötigt zwingend `latitude`, `longitude`, `slope`, `orientation` sowie `start_date` und `end_date` für den gewünschten Zeitraum.

:::note
Erweiterte Daten zurück bis **2007** sind als Add-on verfügbar. Mit `include_historical_data=true` aktivieren und `historical_data_start_year` entsprechend setzen.
:::

:::note
Ein **Rate-Limit von 6 Anfragen pro Minute** gilt, um Missbrauch zu verhindern. Bei Überschreitung wird `429` zurückgegeben.
:::

## Basis-URL

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

## 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/history/'
body = {
    "latitude": 47.84812,
    "longitude": 12.06231,
    "slope": 30,
    "orientation": 180,
    "start_date": "2023-01-01",
    "end_date": "2023-12-31"
}
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/history/';
const params = {
    latitude: 47.84812,
    longitude: 12.06231,
    slope: 30,
    orientation: 180,
    start_date: '2023-01-01',
    end_date: '2023-12-31'
};
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, Lastprofile und mehr — die vollständige Liste findet sich in der [API-Referenz](/api/v1-endpoints#history).

## 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 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 über den <code>required_data</code>-Parameter abrufbar sind.</p>
    </a>
  </div>
</div>
