Hong Kong Air Quality Health Data API
What is this for?
Air Quality in Hong Kong is a big deal (mainly because it can vary considerably). I wanted to create a air monitoring solution that would tell me when it was more polluted outside. Luckily the government has a strong scientific team to monitor and give access via an official website an app. As part of the Hong Kong OpenData initiative they also offer RSS feeds for the data.
I've found that the official feed is lacking a lot of detail, so instead of using that, I looked at the unofficial JSON feeds that the mobile app uses and created a helpful node module to parse those. They are a bit strange in terms of the formatting, so I've tried to kind of nudge it into a format that's a bit easier to process.
npm install --save hongkong-pollution
When creating the instance, you can pass some options, for now, only the language code is supported, possible values are 'en' English, 'tc' Traditional Chinese or 'sc' Simplified Chinese.
var HongKongPollution = ;var hkPollution = ;hkPollution;
getDistrictReadings(districtName)- Note: districtName is optional
getAQHIHistory(districtNameOrId)- Note: districtNameOrId is optional
All methods return JSON, please see the examples linked above for more info on how to call each method.
Gives this response
Other Handy Modules
- hongkong-weather - For Hong Kong Weather Information.
Feel free to submit any pull requests or add functionality, I'm usually pretty responsive.
If you like the module, please consider donating some bitcoin or litecoin.