Air quality in our modern cities is a big concern. Most often poor air quality is due to industry but also the masses of cars (in western countries) and scooters/motorbikes (in Asia) that crowd the streets of our cities.
To raise awareness about air pollution in your city, you can simply setup quickly a Facebook stream with a camera facing out at the skyline and overlay the current Air Quality Index (AQI) read-out for your district. Here is how.
Retrieve AQI information
With this key you will be granted permission to query their data API at a pace of 1000 request per minutes, or 16 requests per seconds. Also, with this API you get access to read outs from over 10,000 stations worldwide.
BTW, big thank you to the World Air Quality Index project (WAQI) as well as the local EPA’s for providing the data.
Run the code
We create a simple example code that runs with nodeJS and makes use of the Overlay.live nodejs library The code is available from our github.
- Simply download / clone the source code from github: https://github.com/OverlayLive/device-library/tree/master/src/examples
- Then edit the device config in “device-config.js” to link it to your Overlay.live account.
- Edit the WAQI config in “WAQI-config.js” to enter your own API token as well as the city code (UID) that corresponds to your city/district or nearest sensor.
- and run with the following command:
$ node aqi-example.js
You should have something similar to this in your terminal:
And on your Overlay.live Dashboard, you should be getting the following for the linked manual device you’ve added.
Final step – Overlay and stream
Finally, all there is left to do is to simply create a new overlay, and customize it. Then, configure for example OBS adding your overlay URL as a web-source, connect with your favorite streaming service and go live!
So that’s it for this quick guide. Hopefully this will help you raise awareness around you for a world with less air pollution. If you have any questions or issues with this code – please reach out! And head over to our community forums for support.
Illustrations by Petter Rudwall, and Remi Yuan