The project luftdaten.info by Code for Germany enables people to build a particulate matter sensor and measure the air qualitiy. The firmware that runs on the sensor has the option to send the data also to an own API.
The Google Cloud Function stores the sensor data together with a timestamp in BigQuery. The sensor data in BigQuery can be easily analyzed. As an example a reported created with Data Studio accessing that data:
Create a virtual environment
python3 -m venv .venv
source .venv/bin/activate
Install the dependencies
pip install --requirement requirements.txt
Deploy the Cloud Function
make deploy
-
Open the configuration page of the senor
-
Enable the option Send data to custom API with the settings
Optional Value Server europe-west1-GCP-PROJECT.cloudfunctions.net Path /pm_sensor_storage Port 80
Note: The firmware supports HTTPS, but the sensor crashes for larger SSL certificates because of the limited memory. (Source)