UK Air Quality

FREEMIUM
By EXTROPY.NET Ltd. | Updated 3 months ago | Weather
Popularity

6.9 / 10

Latency

5,207ms

Service Level

100%

UK Air Quality Overview

Followers: 5
Resources:
Product Website Terms of use
API Creator:
avatar
EXTROPY.NET Ltd.
extropynet
Rate API:
Log In to Rate API

README

All data is courtesy of Defra and uk-air.defra.gov.uk (https://uk-air.defra.gov.uk/data/) which supplies data under the OGL (http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/).

© Crown 2019 copyright Defra via uk-air.defra.gov.uk, licenced under the Open Government Licence (OGL).

This API provides pollutant data in the UK provided by DEFRA. It is updated hourly.

Resources

The API returns two types of resource:

  • Site - this represents a monitoring station at a particular location
  • Pollutant - a measurement of a particular kind of pollutant at a particular time

Endpoints

There are three endpoints:

  • find nearest site for a given latitude and longitude
  • latest pollutant data for a site
  • return basic site information given a site code

All Sites

This endpoint returns all sites in the UK, along with latitude and longitude.

Example Request:

https://uk-air-quality.p.rapidapi.com/sites

Response:

An array of items of the following form:

{ "siteId": "ABD", "pubDate": "Tue, 09 Jun 2020 23:00:00 +0000", "longitude": -2.094278, "latitude": 57.15736, "title": "Aberdeen", "link": "https://uk-air.defra.gov.uk/data/site-data?f_site_id=ABD&view=last_hour" }

Nearest Site

This endpoint takes a latitude and longitude and returns the id of the nearest site.

Example Request:

https://uk-air-quality.p.rapidapi.com/nearestsite?latitude=50.370380&longitude=-4.142650

Response:

{ "siteId":"PLYM" "distance":0.09003139014481146 }

Latest Pollutants

This endpoint returns the latest pollutation data for a given site id.

Example request:

https://uk-air-quality.p.rapidapi.com/latestpollutants?siteId=PLYM

Response:

{
    "siteId":"PLYM"
    "latestBatchTime":"2019-03-25T19:44:01.405Z"
    "pollutants":[
    {
        "time":"19:00"
        "pollutant":"Volatile PM2.5 (Hourly measured) (Volatile PM2.5)"
        "date":"25/03/2019"
        "measurement":"-0.500"
        "unit":"µg/m3 (TEOM FDMS)"
        "period":"Hourly"
    },
    {
        "unit":"µg/m3 (TEOM FDMS)"
        "period":"Hourly"
        "time":"19:00"
        "pollutant":"Volatile PM10 (Hourly measured) (Volatile PM10)"
        "date":"25/03/2019"
        "measurement":"1.000"
    }
    ...
  • latestBatchTime - when this data was most recently updated by the API
  • unit - what unit the pollutant is measured in
  • period - how often the data is updated
  • time - when this measurement was taken (local time)
  • date - what date this measurement was taken
  • pollutant - what pollutant this measurement is for
  • measurement - the value for this pollutant

Site

This endpoint returns some information about a given site (by site id).

Example Request:

https://uk-air-quality.p.rapidapi.com/site?siteId=PLYM

Response:

{
    "siteId":"PLYM"
    "pubDate":"Sun, 24 Mar 2019 23:00:00 +0000"
    "link":"https://uk-air.defra.gov.uk/data/site-data?f_site_id=PLYM&view=last_hour"
    "latitude":50.37167
    "longitude":-4.142361
    "title":"Plymouth Centre"
 }

Notes

The information is provided by DEFRA and updated hourly. Not all sites provide all possible pollutants.

Rating: 5 - Votes: 1