Top City

Platform: API iOS Android

Get a list of popular cities around the world.

Request URL

https://geoapi.qweather.com/v2/city/top

Request Parameters

All parameters are separated by &. If no optional parameters are set, the default value will be used.

  • rangeSet to search only within a certain country or region. The country and region name needs to use country code ISO 3166. If this parameter is not set, the search range will be all cities. Example: range=cn
  • numberNumber of the results in response, from 1 to 20, 10 is the default.
  • langMulti-language setting, please see Language to find out how our multi-language works and how to set up.

Request Example

curl -X GET --compressed \
-H 'Authorization: Bearer your_token' \
'https://geoapi.qweather.com/v2/city/top?number=5&range=cn'

Replace your_token with your JWT or learn more about Authentication

Response

The response is in JSON format and is Gzip compressed.

{
  "code":"200",
  "topCityList":[
    {
      "name":"北京",
      "id":"101010100",
      "lat":"39.90499",
      "lon":"116.40529",
      "adm2":"北京",
      "adm1":"北京市",
      "country":"中国",
      "tz":"Asia/Shanghai",
      "utcOffset":"+08:00",
      "isDst":"0",
      "type":"city",
      "rank":"10",
      "fxLink":"https://www.qweather.com/weather/beijing-101010100.html"
    },
    {
      "name":"朝阳",
      "id":"101010300",
      "lat":"39.92149",
      "lon":"116.48641",
      "adm2":"北京",
      "adm1":"北京市",
      "country":"中国",
      "tz":"Asia/Shanghai",
      "utcOffset":"+08:00",
      "isDst":"0",
      "type":"city",
      "rank":"15",
      "fxLink":"https://www.qweather.com/weather/chaoyang-101010300.html"
    },
    {
      "name":"海淀",
      "id":"101010200",
      "lat":"39.95607",
      "lon":"116.31032",
      "adm2":"北京",
      "adm1":"北京市",
      "country":"中国",
      "tz":"Asia/Shanghai",
      "utcOffset":"+08:00",
      "isDst":"0",
      "type":"city",
      "rank":"15",
      "fxLink":"https://www.qweather.com/weather/haidian-101010200.html"
    },
    {
      "name":"深圳",
      "id":"101280601",
      "lat":"22.54700",
      "lon":"114.08595",
      "adm2":"深圳",
      "adm1":"广东省",
      "country":"中国",
      "tz":"Asia/Shanghai",
      "utcOffset":"+08:00",
      "isDst":"0",
      "type":"city",
      "rank":"13",
      "fxLink":"https://www.qweather.com/weather/shenzhen-101280601.html"
    },
    {
      "name":"上海",
      "id":"101020100",
      "lat":"31.23171",
      "lon":"121.47264",
      "adm2":"上海",
      "adm1":"上海市",
      "country":"中国",
      "tz":"Asia/Shanghai",
      "utcOffset":"+08:00",
      "isDst":"0",
      "type":"city",
      "rank":"11",
      "fxLink":"https://www.qweather.com/weather/shanghai-101020100.html"
    },
    {
      "name":"浦东新区",
      "id":"101020600",
      "lat":"31.24594",
      "lon":"121.56770",
      "adm2":"上海",
      "adm1":"上海市",
      "country":"中国",
      "tz":"Asia/Shanghai",
      "utcOffset":"+08:00",
      "isDst":"0",
      "type":"city",
      "rank":"15",
      "fxLink":"https://www.qweather.com/weather/pudong-101020600.html"
    }
  ],
  "refer":{
    "sources":[
      "QWeather"
    ],
    "license":[
      "QWeather Developers License"
    ]
  }
}
  • code See Status Code
  • topCityList.name Location Name
  • topCityList.id Location ID
  • topCityList.lat Latitude of the location
  • topCityList.lon Longitude of the location
  • topCityList.adm2 Name of the superior administrative division of the location
  • topCityList.adm1 The first-level administrative area of ​​the location
  • topCityList.country Country name of the location
  • topCityList.tz Location timezone
  • topCityList.utcOffset The number of hours offset between local time and UTC time, refer to UTC Offset
  • topCityList.isDst Is the location currently on daylight saving time. 1 for daylight saving time and 0 for not in daylight saving time
  • topCityList.type Location type
  • topCityList.rank Location Rank
  • topCityList.fxLink Responsive web page of this location, easy to embed in your website or APP
  • refer.sources Data source and other statements, may be null
  • refer.license Data license, may be null