# German Weather History (DWD) – Daily Data & Degree Days (`datvanu/dwd-weather-history`) Actor

Official DWD weather observations (CC BY 4.0, commercial use allowed) for any German location or DWD station: daily or monthly rows with temperature, rain, sunshine, gusts, heating degree days (VDI 3807) and configurable bad-weather days.

- **URL**: https://apify.com/datvanu/dwd-weather-history.md
- **Developed by:** [Kilian Schieri](https://apify.com/datvanu) (community)
- **Categories:** Developer tools, Business
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## German Weather History (DWD) – Wetterhistorie Deutschland

**Official weather observations from the Deutscher Wetterdienst (DWD) for any place in Germany: daily or monthly rows with temperature, rain, sunshine, gusts, heating degree days and bad-weather days. Commercial use is allowed (DWD data under CC BY 4.0).**

🇬🇧 [English](#english) · 🇩🇪 [Deutsch](#deutsch)

***

### English

#### What does it do?

You give it a location (coordinates or a DWD station ID) and a date range. It fetches the hourly measurements of the nearest DWD station and condenses them into tidy rows:

- **Daily:** mean/min/max temperature, precipitation, sunshine hours, max gust, frost/ice/rain day flags
- **Heating degree days** G20/15 (VDI 3807) and cooling degree days (base 18 °C)
- **Bad-weather days** using thresholds you configure (rain, frost, gusts, snow). Useful for construction delay records.
- **Monthly** totals: degree days, frost days, rain days, bad-weather days
- Every row says which station was used and how far away it is, and whether the data is `final` or still `preliminary`

#### Who is it for?

Construction companies (bad-weather evidence), energy consultants and property managers (degree days for weather-normalised consumption), agriculture, event planners, insurers, and data scientists.

#### Why this actor?

- **Licence-safe:** DWD open data is published under **CC BY 4.0**, so commercial use is allowed with attribution. The attribution is included in every row (`source`). Many generic weather APIs are free for non-commercial use only.
- **No API key, no proxy, no browser.** Small and fast.
- **Honest data:** forecast hours are excluded by default. Days that are incomplete or still provisional are flagged.

#### Input example

```json
{
  "locations": [
    { "label": "Baustelle Leipzig", "lat": 51.34, "lon": 12.37 },
    { "label": "Berlin-Tempelhof", "dwdStationId": "00433" }
  ],
  "startDate": "2026-01-01",
  "endDate": "2026-03-31",
  "output": "daily",
  "badWeather": { "rainMm": 5, "frostMaxC": 0, "gustKmh": 62, "snow": true }
}
```

#### Output example (daily)

```json
{ "location": "Berlin-Tempelhof", "station": "Berlin-Tempelhof", "dwdStationId": "00433", "date": "2026-09-01",
  "dataStatus": "final", "tMeanC": 18.7, "tMinC": 14.8, "tMaxC": 23.8, "precipitationMm": 0.9, "maxGustKmh": 46.1,
  "heatingDegreeDays": 0, "badWeatherDay": false, "badWeatherReasons": [],
  "source": "Datenbasis: Deutscher Wetterdienst (DWD), CC BY 4.0, abgerufen über Bright Sky (brightsky.dev)" }
```

Export as JSON, CSV, Excel, or use the API, webhooks, Make, Zapier or n8n.

#### How much does it cost? (pay per event)

| Event | Price |
|---|---|
| `day-row` – per delivered daily row (location × day) | **USD 0.001** |
| `month-row` – per delivered monthly row (location × month) | **USD 0.01** |
| `apify-actor-start` – per run (Apify default) | USD 0.00005 |

One location × one year: **USD 0.37** (daily) or **USD 0.12** (monthly). No compute-time charges. The current price is always shown on the Pricing tab.

#### FAQ

- **Can I use the data commercially?** Yes. DWD Open Data is CC BY 4.0; keep the `source` attribution.
- **Why is a value `null`?** Not every station measures every parameter (e.g. sunshine).
- **Forecasts?** Excluded by default (`includeForecast: false`), so history stays clean.

#### Limits and notes

- Germany only. Hourly data from 2010 onwards. At most 3 years and 100 locations per run.
- Values come from the station nearest to your coordinates (`stationDistanceM`). Gaps are filled by DWD's neighbouring stations (`usesFallbackStations`).
- Sunshine is not measured at every station (`null`).
- Data source: DWD Open Data, accessed through the free open-source API [Bright Sky](https://brightsky.dev). This actor is not affiliated with DWD or Bright Sky.

***

### Deutsch

#### Was macht der Actor?

Für beliebige Orte in Deutschland, angegeben als Koordinaten oder DWD-Stationskennung, und einen Zeitraum holt er die stündlichen Messwerte der nächstgelegenen DWD-Station. Daraus macht er:

- **Tageswerte:** Temperatur (Mittel/Min/Max), Niederschlag, Sonnenstunden, Spitzenböe, Frost-, Eis- und Regentage
- **Gradtagzahl** G20/15 nach VDI 3807 und Kühlgradtage
- **Schlechtwettertage** nach eigenen Schwellen (Regen, Frost, Böen, Schnee), z. B. als Nachweis für eine Behinderungsanzeige am Bau
- **Monatswerte** mit Summen und Zähltagen
- Station, Entfernung und Datenstatus (`final` oder `preliminary`) in jeder Zeile

#### Für wen?

Bauunternehmen, Energieberater, Hausverwaltungen (Witterungsbereinigung), Landwirtschaft, Veranstalter, Versicherungen und Gutachter, Data Science.

#### Warum dieser Actor?

- **Rechtssicher kommerziell nutzbar:** DWD-Open-Data stehen unter CC BY 4.0. Der Quellenvermerk steht in jeder Zeile.
- Kein API-Schlüssel, kein Proxy, schnell und günstig.
- Prognosewerte sind standardmäßig ausgeschlossen. Unvollständige oder vorläufige Tage werden markiert.

#### Hinweise

Preis: 0,001 USD je Tageszeile, 0,01 USD je Monatszeile (1 Ort × 1 Jahr ≈ 0,37 bzw. 0,12 USD). Nur Deutschland, ab 2010, höchstens 3 Jahre und 100 Orte pro Lauf. Datenquelle: DWD Open Data über [Bright Sky](https://brightsky.dev). Der Actor steht in keiner Verbindung zum DWD.

# Actor input Schema

## `locations` (type: `array`):

List of {"label", "lat", "lon"} (nearest DWD station is used) or {"label", "dwdStationId"} (e.g. "00433" = Berlin-Tempelhof). Germany only, max. 100.

## `startDate` (type: `string`):

YYYY-MM-DD, from 2010-01-01.

## `endDate` (type: `string`):

YYYY-MM-DD. Max. 3 years per run; future dates are clamped to today.

## `output` (type: `string`):

Daily = 1 row per location and day; monthly = 1 row per location and month.

## `badWeather` (type: `object`):

A day counts as bad weather if ANY rule matches: precipitation ≥ rainMm, max temperature < frostMaxC, gust ≥ gustKmh, snow/sleet observed (snow: true).

## `maxDistanceKm` (type: `integer`):

Only for lat/lon locations: ignore stations farther away than this.

## `includeForecast` (type: `boolean`):

Off (recommended): only measured data. On: fill today's missing hours with DWD MOSMIX forecast (marked dataStatus = contains-forecast).

## Actor input object example

```json
{
  "locations": [
    {
      "label": "Berlin Mitte",
      "lat": 52.52,
      "lon": 13.4
    },
    {
      "label": "Berlin-Tempelhof",
      "dwdStationId": "00433"
    }
  ],
  "startDate": "2026-01-01",
  "endDate": "2026-03-31",
  "output": "daily",
  "badWeather": {
    "rainMm": 5,
    "frostMaxC": 0,
    "gustKmh": 62,
    "snow": true
  },
  "maxDistanceKm": 50,
  "includeForecast": false
}
```

# Actor output Schema

## `results` (type: `string`):

All items of the default dataset (JSON). Add ?format=csv or xlsx for other formats.

## `runSummary` (type: `string`):

Counts, warnings and charged events of this run (key RUN_SUMMARY).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "locations": [
        {
            "label": "Berlin Mitte",
            "lat": 52.52,
            "lon": 13.4
        },
        {
            "label": "Berlin-Tempelhof",
            "dwdStationId": "00433"
        }
    ],
    "startDate": "2026-01-01",
    "endDate": "2026-03-31",
    "badWeather": {
        "rainMm": 5,
        "frostMaxC": 0,
        "gustKmh": 62,
        "snow": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("datvanu/dwd-weather-history").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "locations": [
        {
            "label": "Berlin Mitte",
            "lat": 52.52,
            "lon": 13.4,
        },
        {
            "label": "Berlin-Tempelhof",
            "dwdStationId": "00433",
        },
    ],
    "startDate": "2026-01-01",
    "endDate": "2026-03-31",
    "badWeather": {
        "rainMm": 5,
        "frostMaxC": 0,
        "gustKmh": 62,
        "snow": True,
    },
}

# Run the Actor and wait for it to finish
run = client.actor("datvanu/dwd-weather-history").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "locations": [
    {
      "label": "Berlin Mitte",
      "lat": 52.52,
      "lon": 13.4
    },
    {
      "label": "Berlin-Tempelhof",
      "dwdStationId": "00433"
    }
  ],
  "startDate": "2026-01-01",
  "endDate": "2026-03-31",
  "badWeather": {
    "rainMm": 5,
    "frostMaxC": 0,
    "gustKmh": 62,
    "snow": true
  }
}' |
apify call datvanu/dwd-weather-history --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datvanu/dwd-weather-history"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gwOPioWGveiZnGDwr/builds/aMzWnEKmOvqGn5cU5/openapi.json
