OpenAQ is an open-source global air quality data platform aggregating real-time and historical measurements from government and research monitoring stations across 100 plus countries, freely accessible without commercial restrictions.
MoEngage <> OpenAQ
The MoEngage <> OpenAQ integration allows you to personalise health and environmental campaigns with official station-level air quality data at send time. Common use cases include surfacing PM2.5 or NO2 readings for a user's city, sending health advisories when pollutant thresholds are exceeded, or contextualising outdoor activity recommendations with air quality data.
Integration
| library_add_check |
Prerequisites Ensure you have an OpenAQ account with an active API key. Free keys are available at explore.openaq.org/register. |
Step 1: Get your OpenAQ API key
- Navigate to explore.openaq.org/register and create a free account.
- Your API key is emailed to you after registration. Copy it.
Step 2: Set up the Content API on MoEngage
- Navigate to Dashboard > Settings > APIs and open the Content API tab.
- Click Add Content API.
- Fill in the details using the table below as a reference.
| Key | Value | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Name | Choose a descriptive name, for example OpenAQ City Measurements. |
||||||||||||
| Method | GET | ||||||||||||
| API URL |
Use |
||||||||||||
| Headers |
|
||||||||||||
| Key Value Parameters |
|
- Click Validate to confirm the platform returns a response, then click Save.
Once saved, refer to the MoEngage documentation on using Content APIs in campaigns to learn how to reference response fields inside your campaign templates.
Understanding the API response
The response contains a results array of monitoring location objects.
| Response field | Template variable example | Description |
|---|---|---|
results[0].name |
{{ContentApi.results[0].name}} |
Monitoring station name. |
results[0].locality |
{{ContentApi.results[0].locality}} |
City or locality of the station. |
results[0].country.name |
{{ContentApi.results[0].country.name}} |
Country name. |
results[0].sensors[0].parameter.name |
{{ContentApi.results[0].sensors[0].parameter.name}} |
Pollutant being measured, for example pm25 or no2. |
results[0].sensors[0].summary.avg |
{{ContentApi.results[0].sensors[0].summary.avg}} |
Average reading for the pollutant. |