RapidAPI logo

UK Air Quality

FREEMIUM
By extropynet
Updated 7 days ago
Weather
2.8/10
Popularity Score
1965ms
Latency
83%
Success Rate

UK Air Quality API Documentation

Provides Air Quality Data across the UK, updated hourly and provided by DEFRA

View API Details
GETLatest Pollutants
GETNearest Site
GETSite
GETLatest Pollutants

Latest pollutant data for a given monitoring site.

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
siteIdSTRING
REQUIREDDEFRA site id, eg "PLYM".
Code Snippet
unirest.get("https://uk-air-quality.p.rapidapi.com/latestpollutants")
.header("X-RapidAPI-Host", "uk-air-quality.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://uk-air-quality.p.rapidapi.com/latestpollutants
Request Method: GET
Response Headers
Response Body
Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://uk-air-quality.p.rapidapi.com/latestpollutants")
.header("X-RapidAPI-Host", "uk-air-quality.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication