Sand AISand AI MAGI-2MAGI-2 ya está en SandBase: video en 1080p con audio nativoPruébalo ahora

IQAir Live City Ranking

Documentación de la API
https://api.sandbase.ai/v1/api/iqair/live-city-ranking

Real-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

Entrada
No hay esquema de entrada disponible
SalidaListo

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

FieldMeaning
data.citiesData[].rankPosition of the city in the list. Rank 1 has the highest aqi.
data.citiesData[].aqiCurrent air quality index value for the city. A higher number means worse air.
data.citiesData[].city / data.citiesData[].state / data.citiesData[].countryName of the city, its state or region, and its country.
data.citiesData[].idIdentifier of the city record.
data.citiesData[].urlPath of the city page, built as /country/state/city in lowercase with dashes.
data.citiesData[].followersCountNumber of followers the city has.
data.citiesData[].flagURLLink to the country flag image.
data.citiesData[].updatedAt / data.updatedAtTimestamp of the reading for the city and for the whole list. Both are ISO 8601 strings in UTC.
statusShows success when the call worked.

Notes

  • The request body is an empty object {}. There is no pagination parameter.
  • The url value 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.

Explorar más

APIs relacionadas

Todas las APIs
APIPrecioRespuesta
IQAir$0.01 por llamadaJSON asíncrono
IQAir$0.01 por llamadaJSON asíncrono
IQAir$0.01 por llamadaJSON asíncrono
IQAir$0.01 por llamadaJSON 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.