# Germany Air Quality (UBA) – PM10, PM2.5, NO2, O3, SO2, CO (`friedl/germany-air-quality`) Actor

Hourly and daily air quality and air pollution data from all German monitoring stations (Umweltbundesamt open data – Luftqualität, Feinstaub): one record per station, pollutant and timestamp, with station metadata and air quality index. Delta mode for monitoring.

- **URL**: https://apify.com/friedl/germany-air-quality.md
- **Developed by:** [Friedrich K](https://apify.com/friedl) (community)
- **Categories:** Developer tools, Other
- **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

## Germany Air Quality (UBA) – PM10, PM2.5, NO2, O3, SO2, CO

Hourly and daily air quality measurements from the German federal and state monitoring networks, straight from the open data API of the Umweltbundesamt (UBA, German Environment Agency). One clean record per **station x pollutant x timestamp**, including station metadata (name, city, state, coordinates, station type and setting) and the UBA air quality index class. No API key needed.

### Use cases

- Air quality dashboards, alerts and BI reports for German cities and states
- Research, journalism and ESG / site-assessment data pipelines
- Monitoring stations for threshold exceedances (use `delta` mode on a schedule)
- Joining pollution data with weather, traffic or health data (lat/lon included)

### Input

| Field | Description |
|---|---|
| `states` | State codes (`BE`, `BY`, `NW`, ...) or German names. Empty = all of Germany. |
| `stationCodes` | UBA station codes (e.g. `DEBE010`). Empty = all stations of the selected states. |
| `components` | Any of `PM10`, `PM2.5`, `NO2`, `O3`, `SO2`, `CO`. Empty = all six. |
| `scope` | `1SMW` hourly mean (default), `1TMW` daily mean, `8SMW` 8-hour mean, `1SMW_MAX`, `8SMW_MAX`, `1TMWGL`. |
| `dateFrom` / `dateTo` | `YYYY-MM-DD` or `YYYY-MM-DDTHH:mm`. Default: the last 24 hours. Times without offset are CET. |
| `mode` | `all` (default) or `delta` (only new/changed records since the last run with the same input). |
| `maxResults` | Cap on results per run (= charged events). |
| `deltaStateName` | Optional name for the delta state, to run independent monitors. |

```json
{
  "states": ["BE", "BB"],
  "components": ["PM10", "PM2.5", "NO2", "O3"],
  "scope": "1SMW",
  "maxResults": 100000
}
```

Each pollutant costs one API request (the API returns all stations at once), so runs are fast: a full day for Berlin and Brandenburg (about 3,000 records) takes well under a minute.

### Output (one item)

```json
{
  "id": "DEBE010_NO2_1SMW_2026-10-05T10:00:00+01:00",
  "stationCode": "DEBE010",
  "stationName": "Berlin Wedding",
  "city": "Berlin",
  "state": "Berlin",
  "stateCode": "BE",
  "lat": 52.543,
  "lon": 13.3493,
  "stationType": "Hintergrund",
  "setting": "städtisches Gebiet",
  "component": "NO2",
  "scope": "1h mean",
  "scopeCode": "1SMW",
  "value": 21,
  "unit": "µg/m³",
  "datetime": "2026-10-05T10:00:00+01:00",
  "datetimeEnd": "2026-10-05T11:00:00+01:00",
  "airQualityIndex": 1,
  "source": { "name": "Umweltbundesamt (UBA) Luftdaten API v3", "...": "..." },
  "fetchedAt": "2026-10-06T08:33:12.001Z"
}
```

- `datetime` is the **start** of the measurement period. UBA publishes all times in CET (UTC+01:00, no daylight saving); the actor converts UBA's hour-ending "24:00" notation to proper ISO 8601 timestamps with offset. Daily values use midnight of the day.
- `airQualityIndex` is the UBA index class of the value (higher = worse), `null` if not available.
- Station type and setting names are in German (as published by UBA).

### Pricing

Pay per event: one `result` event per output record. Free plan users get at most **50 results per run**; paid plans have no actor-side limit (set `maxResults` or your max charge per run as a budget guard).

### Delta mode

With `mode: "delta"` the actor remembers every record it has returned (state is stored in the named key-value store `germany-air-quality-state` of your account, keyed by `deltaStateName` or a hash of your input). Later runs return only records that are new or whose value changed (UBA corrects preliminary values), marked with `changeType` = `new` / `changed`. Schedule it hourly with the default 24-hour window to build a continuous feed.

### Data source, license and attribution

- Data: Umweltbundesamt (German Environment Agency), Luftdaten API (https://luftdaten.umweltbundesamt.de/api/air-data/v3).
- License: **Datenlizenz Deutschland – Namensnennung – Version 2.0** (dl-de/by-2-0, https://www.govdata.de/dl-de/by-2-0). Commercial use is allowed with attribution.
- Required attribution: **"Umweltbundesamt mit Daten der Messnetze der Länder und des Bundes"**. Keep it, plus the license link, when you redistribute the data.
- Changes: the actor reformats the data (JSON fields, ISO timestamps) and does not alter the measured values. Recent values are preliminary.

### Disclaimer

This actor is not affiliated with, endorsed by or operated by the Umweltbundesamt or any German state agency. Data is provided as-is without warranty. Recent values are preliminary and may be corrected or removed later; do not use them for safety-critical decisions or legal compliance proofs without checking the official source.

### Impressum / Legal notice

Anbieter dieses Actors (Angaben gemäß § 5 DDG) / Provider of this actor:

Friedrich Köhler\
Spatzenweg 7\
04720 Döbeln\
Deutschland\
E-Mail: actorcreater_010@web.de

# Actor input Schema

## `states` (type: `array`):

State codes (e.g. BE, BY, NW) or German names (e.g. Bayern). Empty = all of Germany.

## `stationCodes` (type: `array`):

UBA station codes such as DEBE010, DEBY004. Empty = all stations (of the selected states).

## `components` (type: `array`):

Subset of PM10, PM2.5, NO2, O3, SO2, CO. Empty = all six. Each pollutant costs one API request.

## `scope` (type: `string`):

Averaging scope. 1SMW = hourly mean, 1TMW = daily mean, 8SMW = 8-hour mean, 1SMW_MAX / 8SMW_MAX = daily maximum of those, 1TMWGL = daily mean (hourly floating).

## `dateFrom` (type: `string`):

YYYY-MM-DD or YYYY-MM-DDTHH:mm (CET if no offset given). Default: 24 hours before dateTo.

## `dateTo` (type: `string`):

YYYY-MM-DD (inclusive, whole day) or YYYY-MM-DDTHH:mm. Default: now.

## `mode` (type: `string`):

'all' returns every record. 'delta' returns only records that are new or changed since the last run with the same input (state is kept in your account's key-value store).

## `maxResults` (type: `integer`):

Maximum number of results (= charged events) per run. Users on the Apify Free plan are limited to 50 results per run.

## `deltaStateName` (type: `string`):

Name for the delta state, e.g. "daily-monitor". Leave empty to derive it from the input. Use different names to run independent monitors.

## Actor input object example

```json
{
  "states": [
    "BE"
  ],
  "components": [
    "PM10",
    "NO2"
  ],
  "scope": "1SMW",
  "mode": "all",
  "maxResults": 1000
}
```

# Actor output Schema

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

No description

# 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 = {
    "states": [
        "BE"
    ],
    "components": [
        "PM10",
        "NO2"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("friedl/germany-air-quality").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 = {
    "states": ["BE"],
    "components": [
        "PM10",
        "NO2",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("friedl/germany-air-quality").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 '{
  "states": [
    "BE"
  ],
  "components": [
    "PM10",
    "NO2"
  ]
}' |
apify call friedl/germany-air-quality --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,friedl/germany-air-quality"
        }
    }
}
```

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/lbPFGcCr63zdfeXc4/builds/EbfsecD5ZheHcd7h2/openapi.json
