IQAir Live City Ranking
https://api.sandbase.ai/v1/api/iqair/live-city-rankingReal-time global city air quality rankings sorted by AQI descending. Returns up to 122 major cities with current AQI values, geographic metadata, and follower counts.
- Precio
- $0.01USD / llamada
- Método
- POST
- Respuesta
- JSON asíncrono
- Parámetros
- 0 obligatorios · 0 opcionales
Entorno de pruebas
Su salida aparecerá aquí
Complete las entradas y luego haga clic en Ejecutar.
README de la API
IQAir Live City Ranking
Returns a ranked list of major cities with their current air quality index (AQI), sorted from highest AQI to lowest. The API takes no input. Each row includes the city, state, country, follower count and a page path for the city.
Use cases
- Show a live list of the most polluted cities in a dashboard or news widget.
- Compare the current AQI of cities in different countries in one call.
- Pick the most followed cities to decide which ones to track in more detail.
- Build a list of city page paths to pass to a city-level air quality lookup.
Request
curl -X POST "https://api.sandbase.ai/v1/api/iqair/live-city-ranking" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
The result is returned in outputs[0].data.
Example response
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"citiesData": [
{
"aqi": 236,
"city": "Lahore",
"country": "Pakistan",
"flagURL": "https://cdn.airvisual.net/flags/pakistan.jpg",
"followersCount": 1139595,
"id": "Dt8HhEj6mC2eatyBr",
"rank": 1,
"state": "Punjab",
"updatedAt": "2026-11-03T07:00:00.000Z",
"url": "/pakistan/punjab/lahore"
}
],
"updatedAt": "2026-11-03T07:00:00.000Z"
},
"status": "success"
}
Response fields
| Field | Meaning |
|---|---|
data.citiesData[].rank | Position of the city in the list. Rank 1 has the highest aqi. |
data.citiesData[].aqi | Current air quality index value for the city. A higher number means worse air. |
data.citiesData[].city / data.citiesData[].state / data.citiesData[].country | Name of the city, its state or region, and its country. |
data.citiesData[].id | Identifier of the city record. |
data.citiesData[].url | Path of the city page, built as /country/state/city in lowercase with dashes. |
data.citiesData[].followersCount | Number of followers the city has. |
data.citiesData[].flagURL | Link to the country flag image. |
data.citiesData[].updatedAt / data.updatedAt | Timestamp of the reading for the city and for the whole list. Both are ISO 8601 strings in UTC. |
status | Shows success when the call worked. |
Notes
- The request body is an empty object
{}. There is no pagination parameter. - The
urlvalue gives the country, state and city slugs. Use them with IQAir City Air Quality for a single city. - For a map-based view of stations, see IQAir Map Data.
Pricing
$0.01 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Empiece a construir
Envíe su primera solicitud
Endpoint de la API de la plataforma con autenticación unificada y seguimiento de uso.
curl -X POST "https://api.sandbase.ai/v1/api/iqair/live-city-ranking" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'2. Autenticación
Configure su clave de API de SandBase en el entorno de su servidor. Las solicitudes usan autenticación Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserve su clave en el servidor. No la exponga en código del navegador.
3. Parámetros
No se ha publicado un esquema de parámetros para esta API.
4. Respuesta
Respuesta de ejemplo guardada para esta API; no se realiza ninguna solicitud en vivo al verla.
No se ha publicado ninguna respuesta guardada. Ejecute la API en Playground para inspeccionar su respuesta.
Explorar más
APIs relacionadas
| API | Precio | Respuesta |
|---|---|---|
IQAir Live City RankingEsta API IQAir | $0.01 por llamada | JSON asíncrono |
IQAir | $0.01 por llamada | JSON asíncrono |
IQAir | $0.01 por llamada | JSON asíncrono |
IQAir | $0.01 por llamada | JSON asíncrono |
Preguntas
FAQ
¿Cómo uso la API de IQAir Live City Ranking?
Envía una solicitud POST a https://api.sandbase.ai/v1/api/iqair/live-city-ranking con tu clave API de SandBase en el encabezado Authorization (Bearer) y los parámetros como un cuerpo JSON. También puedes probarlo en el Playground de esta página sin escribir código.
¿Cuánto cuesta la API de IQAir Live City Ranking?
$0.01 por llamada, facturado desde tu saldo de SandBase. Solo se te cobra por las llamadas que haces; no hay suscripción.
¿Qué parámetros acepta la API de IQAir Live City Ranking?
IQAir Live City Ranking no acepta parámetros de entrada; envía un cuerpo JSON vacío.
¿Qué devuelve la API de IQAir Live City Ranking?
Un resultado JSON. Este endpoint se ejecuta de forma asíncrona, así que la respuesta indica cómo obtener el resultado final. El README de esta página incluye una respuesta de ejemplo.
¿Necesito una cuenta de desarrollador o una clave API de IQAir?
No. IQAir Live City Ranking funciona a través de SandBase, así que una sola clave API de SandBase cubre este endpoint y todas las demás APIs y modelos del catálogo. No necesitas solicitar acceso a la API de IQAir por separado.
