Science
Rank cities by air quality API
Take a list of cities or coordinate pairs, fetch each one's current US AQI + PM2.5 from Open-Meteo (keyless), and derive a ranked comparison: cleanest-to-dirtiest order, best/worst picks, and the AQI spread. The value-add is the multi-location ranking. Differs from data-air-quality (single location). Answers 'which of these cities has the cleanest air', 'rank these cities by AQI', 'compare air quality across locations', 'best and worst air right now'.
Price$0.01per request
MethodPOST
Route/v1/science/aqi-rank
StatusLive
MIME typeapplication/json
Rate limit60/minute
Cache3600s public
scienceaqiair-qualityrankingpollutioncomparecitiespm25
API URL
Integration docshttps://x402.hexl.dev/v1/science/aqi-rankExample request
{
"locations": [
{
"city": "Los Angeles"
},
{
"city": "Zurich"
},
{
"city": "Delhi"
}
]
}Example response
{
"count": 3,
"ranking": [
{
"rank": 1,
"location": "Zurich, Switzerland",
"usAqi": 30,
"category": "Good",
"pm2_5": 5
},
{
"rank": 2,
"location": "Los Angeles, United States",
"usAqi": 80,
"category": "Moderate",
"pm2_5": 20
},
{
"rank": 3,
"location": "Delhi, India",
"usAqi": 150,
"category": "Unhealthy for sensitive groups",
"pm2_5": 55
}
],
"cleanest": {
"location": "Zurich, Switzerland",
"usAqi": 30,
"category": "Good"
},
"dirtiest": {
"location": "Delhi, India",
"usAqi": 150,
"category": "Unhealthy for sensitive groups"
},
"aqiSpread": 120
}Input schema
{
"type": "object",
"required": [
"locations"
],
"properties": {
"locations": {
"type": "array",
"minItems": 2,
"maxItems": 10,
"items": {
"type": "object",
"properties": {
"city": {
"type": "string"
},
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
}
}
}
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}