The Timeline Weather API offers optional air quality index elements. This article describes how to include them with your API request. Air Quality Elements are currently available globally with limited history and five day forecast (hourly or daily).
Please note: The Air Quality Elements are currently in testing and open to all users to provide feedback. During the testing phase of the Air Quality Elements, the parameters, response format, and response information may change.
API Request Format
All weather alerts API requests follow the same form as a regular Timeline Weather API request. Air quality elements are included using the elements parameter. In this following example, only the datetime and the Air quality elements are requested:
https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/New York City,NY?unitGroup=metric&key=YOUR_API_KEY&contentType=json&elements=datetime,pm1,pm2p5,pm10,o3,no2,so2,co,aqius,aqieur
You may also use the + prefix to add air quality elements to the default set of elements. In this example, the US Air Quality Index is added to the list of default elements.
https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/New York City,NY?unitGroup=metric&key=YOUR_API_KEY&contentType=json&elements=+aqius
Note that in most systems, the ‘+’ character must be URL encoded:
https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/New York City,NY?unitGroup=metric&key=YOUR_API_KEY&contentType=json&elements=%2Baqius
Available Air Quality Elements
aqius – United States Air Quality Index – the US EPA’s calculation for the Air Quality which combines multiple aspects of the atmospheric chemistry to create a single air quality score. This is an integer ranging from 0 (very low air pollution) to 300 or more. Values above 100 indicate a polluted air (see https://www.airnow.gov/aqi/aqi-basics/ for more information).
aqieur – European Air Quality Index – the European calculation for air quality. This is a number ranging from 1 (very low pollution) to 6 (extremely high pollution). For more information, see https://ecmwf-projects.github.io/copernicus-training-cams/proc-aq-index.html
pm1 – Particulate matter <1 micrometers diameter – any solid and aerosols less than one micron in size. Particulate matter has many sources including combustion products, dust, wild fires, factories etc. Values are in
pm2p5 – Particulate matter <2.5 micrometers diameter – any solid and aerosols less than 2.5 micron in size.
pm10 – Particulate matter <10 micrometers diameter – any solid and aerosols less than ten micron in size.
o3 – ground level ozone – The amount of ozone near the surface. Values are in microns meter cubed.
no2 – nitrogen dioxide – The amount of nitrogen dioxide. Values are in microns meter cubed.
so2 – sulphur dioxide – The amount of sulphur dioxide. Values are in microns meter cubed.
co – carbon monoxide – The amount of carbon monoxide. Values are in microns meter cubed.
Questions or need help?
If you have a question or need help, please post on our actively monitored forum for the fastest replies. You can also contact us via our support site or drop us an email at support@visualcrossing.com.