# UK Air Quality – DEFRA AURN Live & Hourly Readings (`denjino/uk-air-quality-defra`) Actor

Live and hourly UK air pollution readings (PM2.5, PM10, NO2, ozone, SO2, NOx, CO) from DEFRA's official UK-AIR / AURN monitoring network, about 150 stations. Filter by pollutant, station or distance from a point; NO2 rows include the Daily Air Quality Index band.

- **URL**: https://apify.com/denjino/uk-air-quality-defra.md
- **Developed by:** [John Martinez](https://apify.com/denjino) (community)
- **Categories:** Open source, Integrations, Business
- **Stats:** 1 total users, 0 monthly users, 63.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## UK Air Quality: DEFRA AURN Live and Hourly Readings

Get official UK air pollution readings from DEFRA's **UK-AIR** network (the Automatic Urban and Rural Network and affiliated sites) as a clean table. One row per station, pollutant and hour, with coordinates, units and, for NO2, the Daily Air Quality Index (DAQI) band.

### Who it's for

- **Property, proptech and relocation sites** showing "air quality near this address".
- **Health, fitness and running apps** that want a live pollution signal for a route or city.
- **ESG, insurance and research teams** pulling hourly history for reports and models.
- **Dashboards and alerts**: schedule it hourly and trigger on NO2 or PM2.5 spikes near a site.

### What you get

- PM2.5, PM10, nitrogen dioxide, ozone, sulphur dioxide, nitrogen oxides, nitric oxide and carbon monoxide (or everything the network publishes, including VOCs).
- About 150 monitoring stations across England, Scotland, Wales and Northern Ireland.
- Latest valid reading per station (default) or up to 7 days of hourly history.
- Near-me search: give a latitude and longitude plus a radius and get the nearest stations first, with the distance in km.
- NO2 rows carry the DAQI index (1 to 10) and band (Low, Moderate, High, Very High), which DEFRA defines on the hourly mean.

### Example output

```json
{"stationName":"London Marylebone Road","pollutant":"Nitrogen dioxide (NO2)","pollutantKey":"NO2","value":27.731,"unit":"ug.m-3","timestampUtc":"2026-10-15T05:00:00.000Z","daqiIndex":1,"daqiBand":"Low","latitude":51.52253,"longitude":-0.154611,"distanceKm":null}
```

### Inputs

Pollutants, station name contains, near latitude and longitude with a radius, hours of history (0 for latest only), include missing readings, and max results.

### Pricing

**$1 per 1,000 readings** plus a $0.005 start fee. A live snapshot of PM2.5, PM10, NO2 and ozone for every station is roughly 500 readings, about $0.50. A 24-hour history for the 10 stations nearest a point is a few cents.

### Notes

- Source: DEFRA UK-AIR SOS API. © Crown copyright Defra via uk-air.defra.gov.uk, licensed under the Open Government Licence v3.0.
- Recent hours are provisional and can be revised or ratified later by DEFRA. Hours the network has not published yet are skipped unless *Include missing readings* is on.
- Timestamps are UTC as published by the UK-AIR API.
- Only environmental measurements are collected. No personal data.

# Actor input Schema

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

Which pollutants to return.

## `stationNameContains` (type: `string`):

Optional, e.g. London, Manchester, Marylebone.

## `latitude` (type: `number`):

Optional. With longitude, returns only stations within the radius, nearest first.

## `longitude` (type: `number`):

Optional longitude for the near-me search.

## `radiusKm` (type: `integer`):

Search radius around the point.

## `hoursOfHistory` (type: `integer`):

0 returns the latest valid hourly reading per station and pollutant. 1 to 168 returns every hourly reading in that window.

## `includeMissing` (type: `boolean`):

Keep hours where the network published no valid value (value is null).

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

Stop after this many readings.

## Actor input object example

```json
{
  "pollutants": [
    "PM25",
    "PM10",
    "NO2",
    "O3"
  ],
  "radiusKm": 25,
  "hoursOfHistory": 0,
  "includeMissing": false,
  "maxResults": 1000
}
```

# Actor output Schema

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

One row per station, pollutant and hour from DEFRA UK-AIR.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("denjino/uk-air-quality-defra").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("denjino/uk-air-quality-defra").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 '{}' |
apify call denjino/uk-air-quality-defra --silent --output-dataset

```

## MCP server setup

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

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/o35s3yWtniOg8pHvr/builds/GRjnPOWQxfgXoOwmE/openapi.json
