Making API Calls with the PurpleAir API

When using the real-time API, you will always get the most recent data from the sensors you query. Using the “modified since” parameter and the timestamp of your previous request, you can filter out sensors that haven’t uploaded data since then. This will help avoid duplicate entries.

With the historical API, you can enter a timestamp and get the data for the set period. However, at this time, you can only query one sensor at a time with the historical endpoints. To gain access to the historical API, you will need to make a request.

2 Likes