openaq / openaq-fetch

A tool to collect data for OpenAQ platform.
MIT License
85 stars 39 forks source link

New adapter needed for India Data Source #477

Closed RocketD0g closed 6 years ago

RocketD0g commented 6 years ago

The Central Pollution Control Board has a beautiful new website to share AQ data, but since we access the data by scraping and not programmatically, this unfortunately breaks the existing adapter for this data source, and we will need a new adapter to connect to the new website.

Here is the new website with the station-level raw data:

https://app.cpcbccr.com/ccr/#/caaqm-dashboard-all/caaqm-landing

Here is the previous adapter: https://github.com/openaq/openaq-fetch/blob/develop/adapters/cpcb.js

Thanks very much in advance for any and all code contributions to get this back up and operating for the community!

RocketD0g commented 6 years ago

A contact has shared there is an existing API....will write more when I learn more, but wanted to flag that for anyone who would begin writing this scraper.

(I originally put this on hold after learning this, but if someone does have the ability to write this in a non-time consuming manner, that they should go for it: this is such an important data source to many.)

RocketD0g commented 6 years ago

Update from Community Member:

Overview:

https://data.gov.in/resources/real-time-air-quality-index-various-locations/api

JSON/XML response URL: https://api.data.gov.in/resource/3b01bcb8-0b14-4abf-b6f2-c1bfd384ba69?format=json&api-key=xxxxxxxxxxxxxxxxxxxxxx

I signed up for an API license key (https://auth.mygov.in/user/register?destination=oauth2/register/datagovindia) and am able to view data dated March 7th 12:00 (as seen in response below). "station": "Secretariat, Amaravati - APPCB "station": "Anand Kala Kshetram, Rajamahendravaram - APPCB" "station": "Tirumala, Tirupati - APPCB" "station": "PWD Grounds, Vijayawada - APPCB" "station": "GVM Corporation, Visakhapatnam - APPCB" "station": "Collectorate, Gaya - BSPCB", "station": "Muzaffarpur Collectorate,Muzaffarpur - BSPCB", "station": "IGSC Planetarium Complex, Patna - BSPCB", "station": "Anand Vihar, New Delhi - DPCC", "station": "Aya Nagar, New Delhi - IMD", "station": "Burari Crossing, New Delhi - IMD", "station": "CRRI Mathura Road, New Delhi - IMD", "station": "DTU, New Delhi - CPCB", "station": "IGI Airport Terminal - 3, New Delhi - IMD", "station": "IHBAS, Dilshad Garden,New Delhi - CPCB", "station": "ITO, New Delhi - CPCB", "station": "Lodhi Road, New Delhi - IMD", "station": "Mandir Marg, New Delhi - DPCC",