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.
- Harga
- $0.01USD / panggilan
- Metode
- POST
- Respons
- JSON Asinkron
- Parameter
- 0 wajib · 0 opsional
Playground
Output Anda akan muncul di sini
Lengkapi input, lalu klik Run.
README 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.
Mulai membangun
Kirim permintaan pertama Anda
Endpoint API platform dengan autentikasi dan pelacakan penggunaan terpadu.
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. Autentikasi
Atur SandBase API key Anda di environment server Anda. Permintaan menggunakan autentikasi Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Simpan key Anda di server. Jangan tampilkan di kode browser.
3. Parameter
Tidak ada schema parameter yang dipublikasikan untuk API ini.
4. Respons
Contoh respons yang disimpan untuk API ini; tidak ada permintaan langsung yang dibuat saat melihatnya.
Belum ada respons tersimpan yang dipublikasikan. Jalankan API di Playground untuk melihat responsnya.
Jelajahi lebih lanjut
API Terkait
| API | Harga | Respons |
|---|---|---|
IQAir Live City RankingAPI ini IQAir | $0.01 per panggilan | JSON Asinkron |
IQAir | $0.01 per panggilan | JSON Asinkron |
IQAir | $0.01 per panggilan | JSON Asinkron |
IQAir | $0.01 per panggilan | JSON Asinkron |
Pertanyaan
FAQ
Bagaimana cara menggunakan API IQAir Live City Ranking?
Kirim permintaan POST ke https://api.sandbase.ai/v1/api/iqair/live-city-ranking dengan kunci API SandBase Anda di header Authorization (Bearer) dan parameter sebagai body JSON. Anda juga dapat mencobanya di Playground di halaman ini tanpa menulis kode.
Berapa biaya API IQAir Live City Ranking?
$0.01 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.
Parameter apa yang diterima API IQAir Live City Ranking?
IQAir Live City Ranking tidak memiliki parameter input; kirim body JSON kosong.
Apa yang dikembalikan API IQAir Live City Ranking?
Hasil JSON. Endpoint ini berjalan secara asinkron, jadi responsnya memberi tahu cara mengambil hasil yang sudah selesai. README di halaman ini menyertakan contoh respons.
Apakah saya memerlukan akun developer atau kunci API IQAir?
Tidak. IQAir Live City Ranking berjalan melalui SandBase, jadi satu kunci API SandBase mencakup endpoint ini dan setiap API serta model lain di katalog. Anda tidak perlu mendaftar akses API IQAir secara terpisah.
