Download data in Sep 2020

I want to use the data to verify and improve CMAQ model simulations for Sep 2020. So I want to download data of all stations. I am new and don’t have any experience on the API. It seems that first I need to get the sensor list, and then download the data for each sensor in Sep 2022. Does anyone have done similar work? Any suggestions and help are welcome and appreciated. Thanks!

Hi Hongli,

I might be having data for Sep 2020. Let me know your if you need for entire month or specific days and which area.

Thanks!!

Hi Zuber,

It is great to hear that. I would like to have the data for the entire month of Sep 2020. My NOAA email is Hongli.Wang@noaa.gov. We can talk more about the data though email too.

Thanks,
Hongli

1 Like

Hello Hongli,

We have the following article Making API Calls with the PurpleAir API if you want to learn about using the PurpleAir API.

Email us at contact:purpleair.com if you would like API keys.

All we require is the first/last name you would like the keys assigned to for us to complete the process.

Kind regards,
Aki

Hello Aki,

Thanks for your reply.
Ethan had assigned me a API key. The problem I met is how to specify the dates along with specific area:
For example, the below command works:
curl -X GET https://api.purpleair.com/v1/sensors?fields=pm2.5_60minute%2Clatitude%2Clongitude -H "X-API-Key:curl -X GET https://api.purpleair.com/v1/sensors?fields=pm2.5_60minute%2Clatitude%2Clongitude -H “X-API-Key: *”

But if I and conditions, it doesn’t work:
curl -X GET https://api.purpleair.com/v1/sensors?fields=pm2.5_60minute%2Clatitude%2Clongitude&nwlng=-120&nwlat=50&selng=-100&selat=20&start_timestamp=“2020-09-11T15:30:00Z”&end_timestamp=“2020-09-15T15:30:00Z” -H “X-API-Key: *”

Another question, how can I check if the data during Sep 2020 exist with API without the Sensor ID info.

Thanks,
Hongli

At the moment, the start and end timestamps will only work with the preview historical endpoint. To complete this task, you would need to use a bounding box to collect the sensor IDs of the sensors you want to query and then use the history endpoints to collect the data for each of those sensors.

Ethan,

The bounding box to collect sensors is not working for me for below domain. Any advise?
lat_lon = [nwlng, nwlat, selng, selat]
lat_lon = [97.001, 35.001, 67.001, 7.001]

Thank you,
Zuber

Looking at your coordinates, you do not have a north-west (nw) corner and a south-east (se) corner; you have a north-east corner and a south-west corner. You should swap the arrangement to be the following:

lat_lon = [nwlng, nwlat, selng, selat]
lat_lon = [67.001, 35.001, 97.001, 7.001]

1 Like

Wow, what a blunder I was doing :o
It worked. Thank you!