Sand AISand AI MAGI-2MAGI-2 hiện đã có trên SandBase: video 1080p với âm thanh gốcDùng thử ngay

IQAir Live City Ranking

Tài liệu 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.

Giá
$0.01USD / lượt gọi
Phương thức
POST
Phản hồi
JSON bất đồng bộ
Tham số
0 bắt buộc · 0 tùy chọn

Phòng thử nghiệm

Đầu vào
Không có schema đầu vào
Đầu raSẵn sàng

Đầu ra của bạn sẽ xuất hiện ở đây

Hoàn tất đầu vào, rồi nhấp 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

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.

Khám phá thêm

APIs liên quan

Tất cả APIs
APIGiáPhản hồi
IQAir$0.01 mỗi lần gọiJSON bất đồng bộ
IQAir$0.01 mỗi lần gọiJSON bất đồng bộ
IQAir$0.01 mỗi lần gọiJSON bất đồng bộ
IQAir$0.01 mỗi lần gọiJSON bất đồng bộ

Câu hỏi

FAQ

Làm thế nào để dùng API IQAir Live City Ranking?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/iqair/live-city-ranking với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.

API IQAir Live City Ranking có giá bao nhiêu?

$0.01 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.

API IQAir Live City Ranking chấp nhận những tham số nào?

IQAir Live City Ranking không nhận tham số đầu vào; hãy gửi một phần thân JSON rỗng.

API IQAir Live City Ranking trả về gì?

Kết quả JSON. Endpoint này chạy bất đồng bộ, nên phản hồi sẽ cho bạn biết cách lấy kết quả hoàn tất. README trên trang này có ví dụ phản hồi.

Tôi có cần tài khoản nhà phát triển hoặc API key của IQAir không?

Không. IQAir Live City Ranking chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của IQAir.