Map Web Service: Real-time Air Quality Tile API

Posted on September 18th 2015

Map Overlay Process
(Attribution: Essentials of
Geographic Information Systems

We have been recently cooperating with quite a few more EPAs worlwide. Among all the requests which we have had, it is actually to provide a Web Map Service so that the EPA themselves can include the real-time Air Quality data onto the map from their website.

One of the obvious advantages of using such a map web service from us is to benefit from the transboundary data which we are curating, i.e. a world wide Air Quality information is provided without country boundary limits.

The second advantage is not only that this is a free service, but it is also completely compatible with standard map technologies from google, bing or leaflet, which allows a quick and easy integration with any existing website.


Tile Map Service Endpoint

The tile map server is available from the url{aqi}/{z}/{x}/{y}.png, where aqi refers for the type of marker to be plotted, which can be:
  • usepa-aqi: Plots markers based on the composite AQI calculated with the US EPA standard.
  • usepa-pm25: PM2.5 based AQI - if a station does not have PM2.5 reading, then it is not plotted.
  • usepa-10: Same as above, but for PM10.
  • usepa-o3: Same as above, but for Ozone (based on the 1 hour breakpoints).
  • usepa-no2: Same as above, but for Nitrogen Dioxide.
  • usepa-so2: Same as above, but for Sulfur Dioxide.
  • usepa-co: Same as above, but for Carbon Monoxide.
  • asean-pm10: Asean PM10 raw PM10 concentration (explanations).
Below is the example for the 6 individual pollutants for South China.

Web-Service usage conditions

The map webservice is provided for free, under the condition of reasonable usage limits and acceptable usage policy. The tiles are currently refreshed every 15 minutes (and up to 1 hour in case of high traffic).

Note that our server capacity is limited, so we reserve the right to pause the service at any time, for instance to performance server maintenance. If you need a more stable integration, contact us to find a proper solution, such as setting-up a dedictated server.

Last you also need to specify your own token ID as an extra argument to the tile service endpoint, like token=_TOKEN_ID_ in the following url:{aqi}/{z}/{x}/{y}.png?token=_TOKEN_ID_. You can request your own token ID from this page. You just need to provide a valid email, and you can get your own token within a minute.

Web-Service usage restrictions

When using the service, please do not forget to provide the attribution to the World Air Quality Index project as well as the EPA providing the data (if you use the map service to show data from a specicic location or source). You can get the full list of all the EPA from this link.

As a matter of fact, do not act like the World Resource Institute (WRI): they were scrapping our entire data feed, and republishing the data on their own project website without giving any single attribution for our work... That's not quite ok when you know that they get funded up to 80 millions USD each year. Don't believe us? Check this snapshot.

Future extensions

We are already working on extending this webservice to provide more configuations. For instance:
  • To support for more standards other than the US EPA, such as eucaqi-xxx for the European Common Air Quality Index, innaqi-xxx for the Indian National Air Quality Index , raw-xxx for the unconverted raw data, etc.
  • More indicators such as the wind (both for the current wind speed and wind direction), as well as forecasted ventilation index [1] which can be extrememly usefull for forecasting.
  • Support for kriging geo-statistical surface estimation - i.e. heatmap like interpolations (picture on the right) which can be usefull for lower density monitoring network.
  • Support for 24 hours and 8 hours data averaging . Our map are currenly based on 1 hour averaging, but longer averaging period are useful for epidemilogicial studies.
  • Support for GeoJSON based tile rendering, allowing the customization of markers and color scale, as well as a better integration with tools like

Note that to support more AQI standards and tile configurations, we need to increase our server capacity (both processing power and Storage), for which we will require sponsorship. If you are working for one of the large cloud company, or for instance Google or Microsoft and reading this message, then why not considering making your company environmentally-friendly (combatting air pollution by promoting citizen awarness), and sponsoring part of the needed server extra capacity? That would not only help us, but also help the whole community of researchers, scientists, statisticians and epidemiologies working with environmental data and sciences.


Sample code: Integration with Leaflet

Leaflet is an extremely cool light-weight open-source JavaScript library for mobile-friendly interactive maps, created by Vladimir Agafonkin of MapBox.

Sample code:
<div  id='map'  style='height:380px;'  />  
<link  rel="stylesheet"  href=""  />  
<script  src=""></script>  
      var  OSM_URL  =  'http://{s}{z}/{x}/{y}.png';  
      var  OSM_ATTRIB  =  '&copy;  <a  href="">OpenStreetMap</a>  contributors';  
      var  osmLayer  =  L.tileLayer(OSM_URL,  {attribution:  OSM_ATTRIB});  
      var  WAQI_URL    =  "{z}/{x}/{y}.png?token=_TOKEN_ID_";  
      var  WAQI_ATTR  =  'Air  Quality  Tiles  &copy;  <a  href=""></a>';  
      var  waqiLayer  =  L.tileLayer(WAQI_URL,  {attribution:  WAQI_ATTR});  
      var  map  ='map').setView([51.505,  -0.09],  11);  

Sample code: Integration with Google

Google maps are quite convinient and free up to 25,000 API calls a day. Note that google maps is available in china, but the maps API script needs to be loaded from ( instead of the regular url.

<div  id='map'  style='height:380px;'  />  
<script  src=""></script>  
      var  map  =  new  google.maps.Map(document.getElementById('map'),  {  
                  center:  new  google.maps.LatLng(51.505,  -0.09),  
                  mapTypeId:  google.maps.MapTypeId.ROADMAP,  
                  zoom:  11  
                              var  t  =  new  Date().getTime();  
      var  waqiMapOverlay  =  new  google.maps.ImageMapType({  
                  getTileUrl:  function(coord,  zoom)  {  
                            return  ''  +  zoom  +  "/"  +  coord.x  +  "/"  +  coord.y  +  ".png?token=_TOKEN_ID_";  
                  name:  "Air  Quality",  

Sample code: Integration with Microsoft Bing Maps

Bing maps are actually quite cool, and also using Here base map for some countries. There are still quite a lot of web site based on Microsoft Maps (and especially in the domain of Air Quality and weather).

<div  id='map'  style='height:380px;'    style='position:relative;'/>  
<script  type="text/javascript"  src=""></script>  
      var  map  =  new  Microsoft.Maps.Map(document.getElementById('map'),    
                  {    center:  new  Microsoft.Maps.Location(51.505,  -0.09),  zoom:11  }  );  
      var  waqiTileOptions  =  {  uriConstructor:  function  (quadkey)  {  
            return  ""  +  quadkey.levelOfDetail+"/"+quadkey.x+"/"+  quadkey.y  +  ".png?token=_TOKEN_ID_";  
      }  };  
      var  waqiTileSource  =  new  Microsoft.Maps.TileSource(waqiTileOptions);  
      var  waqiTilelayer  =  new  Microsoft.Maps.TileLayer({  mercator:  waqiTileSource  });  

[1] Also refered as venting index or cumulated wind power

Click here to see all the FAQ entries
  • Nitrogen Dioxyde (NO2) in our atmosphere
  • Ozone AQI Scale update
  • Kriging Interpolation

  • comments powered by Disqus

    O pomiarach jakości powietrza i zanieczyszczeń:

    O Poziomach Jakości Powietrza

    -Wartości Indeksu Jakości Powietrza (AQI)Poziomy zagrożenia zdrowia
    0 - 50Dobra0-50: Dobra - Jakość powietrza jest uznawana za zadowalającą, a zanieczyszczenie powietrza stanowi niewielkie ryzyko lub jego brak.
    51 -100Średnia50-100: Średnia - Jakość powietrza jest dopuszczalna; jednak niektóre zanieczyszczenia mogą być umiarkowanie szkodliwe dla bardzo małej liczby osób, które są niezwykle wrażliwe na zanieczyszczenie powietrza.
    101-150Niezdrowa dla osób wrażliwych100-150: Niezdrowe dla wrażliwych osób - u osób wrażliwych mogą wystąpić negatywne skutki dla zdrowia. Większość populacji może nie odczuwać negatywnych objawów.
    151-200Niezdrowa150-200: Niezdrowe - Każdy może zacząć doświadczać negatywnych skutków zdrowotnych; U osób wrażliwych mogą wystąpić poważniejsze skutki zdrowotne.
    201-300Bardzo niezdrowa200-300: Bardzo niezdrowe - Ostrzeżenie zdrowotne, poziom alarmowy. Bardzo prawdopodobny negatywny wpływ na całą populację.
    300+Zagrożenie dla życia300 : Niebezpieczny - Alarm Zdrowotny: każdy może doświadczyć poważniejszych skutków zdrowotnych.

    Aby dowiedzieć się więcej na temat jakości powietrza i zanieczyszczenia, sprawdź w wikipedii temat "jakość powietrza" lub nasz poradnik o jakości powietrza i jego wpływie na Twoje zdrowie.

    Więcej przydatnych informacji zdrowotnych na blogu doktora Richarda Sainta z Pekinu: .

    Usage Notice: All the Air Quality data are unvalidated at the time of publication, and due to quality assurance these data may be amended, without notice, at any time. The World Air Quality Index project has exercised all reasonable skill and care in compiling the contents of this information and under no circumstances will the World Air Quality Index project team or its agents be liable in contract, tort or otherwise for any loss, injury or damage arising directly or indirectly from the supply of this data.


    Ustawienia Języka:

    Temperature unit: