# Air Quality API - Europe AQI, PM2.5, NO2, No API Key (`martin10291/air-quality-api`) Actor

Live air quality for any place in Europe, no API key: newest hourly PM2.5, PM10, NO2, ozone and SO2 measured by official EEA monitoring stations (3,700+ active stations in 38 countries incl. UK), the nearest stations to a lat/lon with distance, European Air Quality Index band, data age, hourly histo

- **URL**: https://apify.com/martin10291/air-quality-api.md
- **Developed by:** [Martin Petrov](https://apify.com/martin10291) (community)
- **Categories:** Agents, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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

## Air Quality API - Europe (PM2.5, PM10, NO2, Ozone, SO2, AQI)

**Problem:** your app, report or AI agent needs to know *how clean the air is at a place right now*, and most "air quality APIs" return model forecasts, not measurements, or need a key and a paid plan.

This API returns the **newest hourly values measured by official monitoring stations** of the European Environment Agency (EEA) network, for any latitude/longitude in Europe. No API key, no login.

- **3,700+ active stations in 38 countries** (EU, EEA members, Western Balkans, Switzerland, Norway, Iceland and the UK)
- **5 pollutants:** PM2.5, PM10, NO2, O3 (ozone), SO2, in µg/m³
- **European Air Quality Index (EAQI)** band per pollutant and overall (Good, Fair, Moderate, Poor, Very poor, Extremely poor), using the official EEA hourly thresholds
- Nearest stations first, with **distance in km**, measurement time in UTC and **data age in hours** (honest: some countries report with a delay of 1-2 days; the age tells you)
- **Hourly history** of any station for up to 30 days
- **Station list** of any country
- **Only-new mode** with a Monitor ID: schedule it hourly and get each new measurement once

### Quick start (API)

```bash
curl -X POST "https://api.apify.com/v2/acts/martin10291~air-quality-api/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"latest","lat":52.52,"lon":13.405,"limit":3}'
```

Example row (Berlin, real response 2026-11-14):

```json
{
 "station_code": "DEBE068",
 "station_name": "Berlin Mitte",
 "country_code": "DE",
 "country": "Germany",
 "lat": 52.5136,
 "lon": 13.4188,
 "distance_km": 1.17,
 "station_type": "Some main pollutants",
 "measurements": {
  "PM2.5": {
   "value": 17.85,
   "unit": "µg/m3",
   "time_utc": "2026-11-14T21:00:00Z",
   "age_hours": 1.6
  },
  "PM10": {
   "value": 22.36,
   "unit": "µg/m3",
   "time_utc": "2026-11-14T21:00:00Z",
   "age_hours": 1.6
  },
  "NO2": {
   "value": 35.95,
   "unit": "µg/m3",
   "time_utc": "2026-11-14T21:00:00Z",
   "age_hours": 1.6
  }
 },
 "eaqi": {
  "band": "Moderate",
  "band_index": 3,
  "dominant_pollutant": "PM2.5",
  "per_pollutant": {
   "PM2.5": {
    "band": "Moderate",
    "band_index": 3
   },
   "PM10": {
    "band": "Fair",
    "band_index": 2
   },
   "NO2": {
    "band": "Moderate",
    "band_index": 3
   }
  }
 },
 "data_age_hours": 1.6,
 "source": "European Environment Agency (EEA) air quality up-to-date data (E2a), CC BY 4.0",
 "stale": false,
 "pm25": 17.85,
 "pm10": 22.36,
 "no2": 35.95,
 "eaqi_band": "Moderate"
}
```

Other inputs:

- Several places: `{"locations": ["48.8566,2.3522", "45.4642,9.19"]}`
- History: `{"mode": "history", "station": "FR04055", "hours": 72}`
- Stations of a country: `{"mode": "stations", "country": "PL"}`
- Only some pollutants: `{"lat": 50.06, "lon": 19.94, "pollutants": ["PM2.5", "PM10"]}`

### Use from AI agents (MCP)

Add Apify's MCP server to Claude, Cursor or any MCP client and call this actor as a tool:

```json
{"mcpServers": {"apify": {"url": "https://mcp.apify.com/?actors=martin10291/air-quality-api"}}}
```

Ask: *"What is the air quality near the Eiffel Tower right now?"* The agent sends the lat/lon and gets measured values plus the EAQI band.

### Output fields

| Field | Meaning |
|---|---|
| station_code, station_name, country_code, lat, lon | EEA station (EoI code) |
| distance_km | Distance from your point |
| measurements | Per pollutant: value, unit, time_utc (end of the measured hour), age_hours |
| eaqi | band, band_index 1-6, dominant_pollutant, per_pollutant. Null with a reason when the newest value is older than 3 hours |
| pm25, pm10, no2, o3, so2, eaqi_band, measured_at_utc | Flat columns for spreadsheets |
| data_age_hours, stale, notes | Freshness and any upstream problem |
| source | Data source and licence |

### FAQ

**How fresh is the data?** Stations report every hour. For most countries (DE, FR, BE, PL, IT, UK, ...) the newest value is 1-3 hours old. Some countries upload with a delay (Spain about 24 h; Austria, Slovenia, Netherlands, Bulgaria sometimes 40 h). Every value has `time_utc` and `age_hours`, and the EAQI band is only computed from values up to 3 hours old.

**What if there is no station near my point?** You get the nearest stations anyway, with a note that they are outside your radius. Points more than 300 km from any EEA station (outside Europe) return a clear error, not empty rows.

**Which limits apply?** latest: up to 25 places and 20 stations per place per run; history: up to 720 hours (30 days); stations: up to 5,000 rows.

**Errors?** Bad input returns a readable message (for example "'lat' must be a number"). If an upstream file fails, the last good copy is used and the row says `"stale": true`.

### Data source and licence

Data: European Environment Agency (EEA), air quality "up-to-date" (E2a) data reported by national networks, CC BY 4.0. The EEA allows reuse for commercial and non-commercial purposes when the EEA is acknowledged; every row carries the source line. Up-to-date data is not yet validated by the countries and can change later. This is not a health or emergency service.

### Pricing

$1.00 per 1,000 results (one result = one station row or one history hour).

# Actor input Schema

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

latest = newest hourly values at the stations nearest to a place (with European Air Quality Index band); history = hourly values of one station for the last N hours; stations = list all stations of a country.

## `lat` (type: `number`):

Latitude of the place, e.g. 52.52 (Berlin). Europe only (EEA member and cooperating countries, plus UK).

## `lon` (type: `number`):

Longitude of the place, e.g. 13.405 (Berlin).

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

For latest: up to 25 places as 'lat,lon', e.g. 48.8566,2.3522. Each place returns its nearest stations; rows carry query_location.

## `station` (type: `string`):

EEA station EoI code, e.g. DEBE068 or FR04055. Required for history unless lat/lon is given (then the nearest station is used).

## `country` (type: `string`):

For stations: ISO 2-letter country code, e.g. DE, FR, BG, PL.

## `pollutants` (type: `array`):

Any of PM2.5, PM10, NO2, O3, SO2. Empty = all five.

## `radius_km` (type: `integer`):

For latest: search radius around the place. Default 25, max 200. If no station is inside, the nearest ones are returned with a note.

## `limit` (type: `integer`):

For latest: how many nearest stations to return per place (default 3, max 20). For stations mode: max rows (default 500).

## `hours` (type: `integer`):

For history: how many past hours to return (default 24, max 720 = 30 days).

## `onlyNew` (type: `boolean`):

Monitor mode: return only station hours not returned before for this Monitor ID. Schedule the actor hourly to get each new measurement once.

## `monitorId` (type: `string`):

Name of the only-new memory, so several schedules stay separate, e.g. 'berlin-office'.

## Actor input object example

```json
{
  "mode": "latest",
  "lat": 52.52,
  "lon": 13.405,
  "radius_km": 25,
  "limit": 3,
  "hours": 24,
  "onlyNew": false
}
```

# Actor output Schema

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

latest: one row per station (code, name, country, lat, lon, distance_km, measurements per pollutant with time and age, eaqi band, flat pm25/pm10/no2/o3/so2). history: one row per hour. stations: one row per station.

# 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 = {
    "mode": "latest",
    "lat": 52.52,
    "lon": 13.405
};

// Run the Actor and wait for it to finish
const run = await client.actor("martin10291/air-quality-api").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 = {
    "mode": "latest",
    "lat": 52.52,
    "lon": 13.405,
}

# Run the Actor and wait for it to finish
run = client.actor("martin10291/air-quality-api").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 '{
  "mode": "latest",
  "lat": 52.52,
  "lon": 13.405
}' |
apify call martin10291/air-quality-api --silent --output-dataset

```

## MCP server setup

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

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/f40JeeNRtqnYiA501/builds/UyVCo2HmH71gIMBLb/openapi.json
