Overview
Breeze uses the Open-Meteo Air Quality API to provide real-time air quality information for any location worldwide. This API returns the US Air Quality Index (AQI) along with detailed measurements of specific pollutants.Base URL
Endpoints Used
Get Current Air Quality
Fetches current air quality data for a specific location. Query Parameters:| Parameter | Type | Description |
|---|---|---|
latitude | Double | Geographic latitude of the location |
longitude | Double | Geographic longitude of the location |
current | String | Comma-separated list of pollutants to include |
timezone | String | Timezone for the response (set to "auto") |
us_aqi- US Air Quality Indexpm10- Particulate Matter < 10 μmpm2_5- Particulate Matter < 2.5 μmcarbon_monoxide- CO concentrationnitrogen_dioxide- NO₂ concentrationsulphur_dioxide- SO₂ concentrationozone- O₃ concentration
Response Format
The API returns a JSON response with the following structure:Response Model
Breeze decodes the response into these Swift models:Usage Example
Here’s how Breeze fetches air quality data:Multiple Location Queries
The API supports querying multiple locations simultaneously by passing comma-separated coordinates:AQI Levels
Breeze interprets AQI values according to US EPA standards:| AQI Range | Level | Description |
|---|---|---|
| 0-25 | Excellent | Pristine air quality |
| 26-50 | Good | No health concerns |
| 51-75 | Moderate | Acceptable for most people |
| 76-100 | Slightly High | May affect sensitive groups |
| 101-150 | Unhealthy for Sensitive Groups | Children, elderly should limit outdoor exposure |
| 151-200 | Unhealthy | Everyone may experience effects |
| 201-300 | Very Unhealthy | Serious health concerns |
| 300+ | Hazardous | Emergency conditions |
Rate Limits
Open-Meteo APIs are free and do not require an API key. They have generous rate limits suitable for most applications.Reference
- Open-Meteo Air Quality API Documentation
- Service Implementation:
BreezeApp/Services/AirQualityService.swift - Data Models:
BreezeApp/Models/AirQuality.swift