[How To] Use Real-time Air Quality API from data.gov.in
data.gov.in is an Open Data platform which has many datasets and APIs from the Government of India. One of them is the Realtime Air Quality Index API which gives values from different monitoring stations across India. The pollutants monitored are Sulphur Dioxide (SO2), Nitrogen Dioxide (NO2), Particulate Matter (PM10 and PM2.5), Carbon Monoxide (CO), Ozone(O3), etc.
I've played around with the API in the try it out the section on the website and added filters to get particular information for a city or a state.
This API provides real-time information and hence you may have to store the information in a DB if you want to build something on the historical data of Air Quality. Also, note that this data is updated every hour. So make sure your requests are sent for an hour instead of every minute to not hit the rate limits and also, why would you fetch the same information again and again?
Request Type: GET
apikey: Sign up and create an account on data.gov.in to get an apikey.
Example Request URL: api.data.gov.in/resource/3b01bcb8-0b14-4abf..
What can you build?
- Realtime map showing Air Quality Index of different cities
- Charts and graphs of Air Quality from different cities
- Graphs of the pollutants based on the Air Quality information of a city and help make quick decisions
Please update the API Key since this example shows the API Key from the website itself.