Downloadable Air Quality Widgets
Wordpress, Wix & Blogger Widget

Share: aqicn.org/widgets/airnet/

All-in-one simplified scripts

Using a single script:

Or using an iframe:


You can also specify a container identifier ('div' id) when using the script:

<div id='widget1' style='text-align: center'></div>
...

Last, but not least, you can also change the display style but changing the size parameter to one of those: xxl, xlarge, large, medium, small, xsmall. (see below for the visual result)

Advanced scripting setup

The basic integration is simple and straight forward. You first need to add the following piece of code:

<script  src='https://aqicn.org/widgets/js/waqi-feed.v1.js'></script>

Then, just add this other code to include the widget:

The function `_waqiFeed` takes as argument the configuration for the widget. You just need to define the station, and the widget display style (size). This is what is produces:

You can also specify the container identifier ('div' id) where the widget needs to be shown:

<div id='widget2' style='text-align: center;border: 1px dashed #ccc;'></div>

Specifying the display format

The display format can be changed by changing the size parameter to one of those:

xxl
xlarge
large
small
xsmall
_waqiFeed({
size: "xxl",
station: ""
});
_waqiFeed({
size: "xlarge",
station: ""
});
_waqiFeed({
size: "large",
station: ""
});
_waqiFeed({
size: "small",
station: ""
});
_waqiFeed({
size: "xsmall",
station: ""
});

Advanced template engine

It is possible to customize the text to be displayed within the widget by specifying the display option. For instance, to display with both the textual "AQI" name as well as the update time (as shown on the widget on the left), you can use the following code:

_waqiFeed({    
	display:"%cityname  AQI  is  <span  style='%style'>%impact  (%aqiv)</span>  <small>on  %date</small>",  
	station:"A373120"  
});  

The parameter display is an HTML-based string, and can contain any of the following keywords:

  • `%cityname` for the name of the city (eg Beijing),
  • `%aqi` for the decorated AQI value (eg 58),
  • `%aqiv` for the undecorated (raw text) AQI value (eg 58),
  • `%style` for the css declaration of the decorated AQI details (eg background-color: #ffde33;color:#000000;),
  • `%date` for the time at which the AQI was updated (eg Wed 20:00),
  • `%impact` for the associated health impact (eg Good, Moderate...)
  • `%attribution` for the AQI data attribution ( eg Beijing Environmental Protection Monitoring Center)
  • `%details` for the full AQI details (the content of the popup displayed when moving the mouse over the AQI value).

Here are a few examples:

Display Configuration Result

Specifying the Language

...

You can also specify the language to be used by setting the lang option. For instance, to include the widget in Chinese (as shown on the right), use the following code:

The currently supported languages are:

  • "en": English
  • "cn": Chinese
  • "jp": Japanese
  • "es": Spanish
  • "kr": Korean
  • "ru": Russian
  • "hk": Traditional Chinese
  • "fr": French
  • "pl": Polish
  • "de": German
  • "pt": Portuguese
  • "vn": Vietnamese
  • "it": Italian
  • "id": Indonesian
  • "nl": Dutch
  • "fa": Persian
  • "th": Thai
  • "hu": Hungarian
  • "el": Greek
  • "ro": Romanian
  • "bg": Bulgarian
  • "ur": Urdu
  • "hi": Hindi
  • "ar": Arabic
  • "sr": Serbian
  • "bn": Bangla
  • "hu": Hungarian
  • "bs": Bosnian
  • "hr": Croatian

    If not specified or set to null, English is used.

  • Further questions

    Register to the data-platform and get your "token" to be able to send us questions: aqicn.org/data-platform/register/

    If you have any question or comment, send us a message using the form below:

    Examples

    Click on any of the widgets below to see the associated code:

    Measure the air quality in your neighborhood
    Participate with your own air quality monitoring station

    The GAIA air quality monitor uses laser particle sensors to measure in real-time PM2.5 and PM10 particle pollution, which is one of the most harmful air pollutants.

    It is very easy to set up: It only requires a WIFI access point and a USB compatible power supply. Once connected, your real time air pollution levels are instantaneously available in on our maps.

    The station comes together with 10-meter water-proof power cables, a power supply, mounting equipment and an optional solar panel.

    About the Air Quality and Pollution Measurement:

    About the Air Quality Levels

    AQI Air Pollution Level Health Implications Cautionary Statement (for PM2.5)
    0 - 50 Good Air quality is considered satisfactory, and air pollution poses little or no risk None
    51 -100 Moderate Air quality is acceptable; however, for some pollutants there may be a moderate health concern for a very small number of people who are unusually sensitive to air pollution. Active children and adults, and people with respiratory disease, such as asthma, should limit prolonged outdoor exertion.
    101-150 Unhealthy for Sensitive Groups Members of sensitive groups may experience health effects. The general public is not likely to be affected. Active children and adults, and people with respiratory disease, such as asthma, should limit prolonged outdoor exertion.
    151-200 Unhealthy Everyone may begin to experience health effects; members of sensitive groups may experience more serious health effects Active children and adults, and people with respiratory disease, such as asthma, should avoid prolonged outdoor exertion; everyone else, especially children, should limit prolonged outdoor exertion
    201-300 Very Unhealthy Health warnings of emergency conditions. The entire population is more likely to be affected. Active children and adults, and people with respiratory disease, such as asthma, should avoid all outdoor exertion; everyone else, especially children, should limit outdoor exertion.
    300+ Hazardous Health alert: everyone may experience more serious health effects Everyone should avoid all outdoor exertion

    To know more about Air Quality and Pollution, check the wikipedia Air Quality topic or the airnow guide to Air Quality and Your Health.

    For very useful health advices of Beijing Doctor Richard Saint Cyr MD, check www.myhealthbeijing.com blog.


    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.



    Settings


    Language Settings:


    Temperature unit:
    Celcius