Using public data sources for air quality data
In this section, we are going to discuss retrieving air quality data using publicly available data, namely the AirNow API provided by the United States Environmental Protection Agency (US EPA). API is the acronym for Application Programming Interface. Here, it refers to the interface provided to retrieve air quality data. An API typically comes with specifications for access. Here, it is a program that aggregates data from federal, state, and local agencies to report the Air Quality Index (AQI). We are going to test the API and then discuss the code needed to retrieve the air quality data using the Pico:
Data Sources Outside the United States
If you live outside the United States, we recommend using the local data source in your region. If one doesn't exist, we recommend checking out the Interfacing a CO2 sensor on a Pico section of this chapter.
The steps to retrieve air quality data using publicly available data are as...