Configuration¶
Some data sources require API keys. This guide explains how to set them up.
Environment Variables¶
Aeolus reads API keys from environment variables. Export them in your shell:
export OPENAQ_API_KEY=your_openaq_key_here
export PURPLEAIR_API_KEY=your_purpleair_key_here
export BL_API_KEY=your_breathe_london_key_here
export AIRQO_API_KEY=your_airqo_token_here
export AIRNOW_API_KEY=your_airnow_key_here
Using a .env file (optional)¶
If you prefer using a .env file, you can use python-dotenv to load it:
Create a .env file in your project root:
# .env
OPENAQ_API_KEY=your_openaq_key_here
PURPLEAIR_API_KEY=your_purpleair_key_here
BL_API_KEY=your_breathe_london_key_here
AIRQO_API_KEY=your_airqo_token_here
AIRNOW_API_KEY=your_airnow_key_here
Then load it before using Aeolus:
Obtaining API Keys¶
OpenAQ¶
- Go to OpenAQ Explorer
- Create a free account
- Navigate to your account settings to find your API key
PurpleAir¶
- Visit PurpleAir
- Create an account and go to your API Keys page
- Generate a read-only API key
Breathe London¶
- Visit the Breathe London API documentation
- Request API access through their developer portal
AirQo¶
- Visit AirQo
- Contact their team to request API access
AirNow¶
- Visit AirNow API
- Register for a free API key
- Keys are typically issued within a few minutes
Sources Without API Keys¶
These sources work without any configuration:
- AURN - UK Automatic Urban and Rural Network
- SAQN - Scottish Air Quality Network (also known as SAQD)
- WAQN - Welsh Air Quality Network
- NI - Northern Ireland Air Quality Network
- AQE - Air Quality England
- LAQN - London Air Quality Network
- SENSOR_COMMUNITY - Global citizen science network
Verifying Configuration¶
Check that your API keys are configured correctly:
import aeolus
# List all sources and their status
sources = aeolus.list_sources()
for source in sources:
info = aeolus.get_source_info(source)
print(f"{source}: {info}")
Next Steps¶
- Data Sources - Detailed information on each source
- Downloading Data - Start downloading data