Get Sensor Data from Zip

Hello -

New to the purpleair API. Is there a way to get sensordata for any sensors in or near a particular zipcode?

I see the map has this functionality, but I don’t know how to duplicate in an API

Here’s what I did: I used the map to identify a bunch of PA sensors within a short distance of my residence and (using the API) created a group using those sensors’ IDs. Then I get the members’ data (only the specific fields I want) periodically. Then I just average each of the appropriate values.

I like the fact that I can cherry-pick which sensors I want because I’ve noticed that there are several that often/occasionally have wildly different values than neighboring sensors (for whatever reason), so I can just eliminate them upfront.

By the way, I used the appropriate “Send a Sample Request” on the API page to create the group and add members since (rather than write code for it) since (for me) it’s just a one-time thing. I love having the ability to test the API calls on api.purpleair.com so see what I’ll be receiving once I add it to my Python code.

You could also select a NW lat/lon and a SE lat/lon to get all the sensors and specific data within a rectangular area.

1 Like