PurpleAir Data Migration to BigQuery and a New API

This API information is from May of 2022. The API update occurred on July 18, 2022. For more information, view this post: https://community.purpleair.com/t/new-version-of-the-purpleair-api-on-july-18th/1251.

For the last few months, we have been working on migrating the sensor database from ThingSpeak to Google’s BigQuery. That process has been completed, and real-time data is being fed into BigQuery. Sometime after August, historical data will no longer be accessible through the ThingSpeak API.

PurpleAir will be releasing a new API to provide access to historical data. This API will be released within the next few months, and all users will be migrated from using the ThingSpeak.com API. There will be a period where both APIs will be active simultaneously to allow users to switch systems without forcing their software to stop functioning.

This new API will let all users access historical data simply and efficiently, and will allow us to implement new cool and useful features to PurpleAir products, one of the first being real averages instead of running averages on the PurpleAir map.

We are excited to release this new API, and we believe it will open the door to many new possibilities with PurpleAir data. Feel free to ask questions or concerns, and we will make everyone aware once the first release is out.

A preview version of the new historical API can be used to test new features. Read more in the post Preview of API that includes the ability to get sensor history.

1 Like

I have liked the simplicity of the current API. I hope that is not abandoned in the migration.

Thanks for the update. Will this also affect API calls to query data for the last interval for a particular PAII device as opposed to more historical data? I have a python program running which does a very basic API call against a specific PAII device so am assuming the code will need to be updated as part of this change?

The current API used to access real-time data will not be affected. Instead, we will be adding a new endpoint for historical data. We want to keep backward compatibility as much as possible, and if significant changes need to be made, a new version will be released rather than updating the existing systems.

Great - thanks for confirming.

Could you clarify what you mean by historical data?

Our group regularly pulls data (from the previous 2 days) for a number of monitors using the thingspeak API ID/Key. Am I understanding correctly that this workflow won’t change?

If that’s the case, what will be changing exactly? Is this just impacting the sensor list download tool used from a web browser?

Thanks for clarifying.

Hi @ewalks, currently there are two APIs that can be used to access PurpleAir data. The API that can be found at api.purpleair.com is used to access real-time data. This would be the latest data that each sensor on the map has reported, or what currently appears on the map. This API is not going to change.

The second API that is in use is the ThingSpeak.com API. This API is used to access historical data, or non real-time data. This API will soon no longer be able to access PurpleAir data. This means that your ThingSpeak system you are currently using will stop working. For this reason, we are creating the PurpleAir historical API. With this new API, you can continue to access the same data that you could through ThingSpeak.

@Ethan_Breinholt, thanks for clarifying. I look forward to testing the beta version when it is out in June.

For those ending up here from a Google search, the preview of the BigQuery API is available here: Preview of API that includes the ability to get sensor history