Top City
Get a list of popular cities around the world.
Request URL
https://geoapi.qweather.com/v2/city/top?[params]
Request Parameters
All parameters are separated by &
. If no optional parameters are set, the default value will be used.
-
key
(required)API authentication key, please refer to How To Get Your Key. Support Signature Authentication. Example:key=12334567890ABC
-
range
Set 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
-
number
Number of the results in response, from 1 to 20, 10 is the default. -
lang
Multi-language setting, see language code for available value. If data does not match the language you set, it will return results in English or its native language.
Request Example
Top 5 cities in China
curl -L -X GET --compressed 'https://geoapi.qweather.com/v2/city/top?number=5&range=cn&key=YOUR_KEY'
Response
The response is in JSON format and is Gzip compressed, all fields are Strings.
{
"code": "200",
"topCityList": [
{
"name": "余杭",
"id": "101210106",
"lat": "30.42118",
"lon": "120.30173",
"adm2": "杭州",
"adm1": "浙江省",
"country": "中国",
"tz": "Asia/Shanghai",
"utcOffset": "+08:00",
"isDst": "0",
"type": "city",
"rank": "25",
"fxLink": "http://hfx.link/32t1"
},
{
"name": "嘉定",
"id": "101020500",
"lat": "31.38352",
"lon": "121.25033",
"adm2": "上海",
"adm1": "上海市",
"country": "中国",
"tz": "Asia/Shanghai",
"utcOffset": "+08:00",
"isDst": "0",
"type": "city",
"rank": "23",
"fxLink": "http://hfx.link/2bf1"
},
{
"name": "朝阳",
"id": "101010300",
"lat": "39.92148",
"lon": "116.48641",
"adm2": "北京",
"adm1": "北京市",
"country": "中国",
"tz": "Asia/Shanghai",
"utcOffset": "+08:00",
"isDst": "0",
"type": "city",
"rank": "15",
"fxLink": "http://hfx.link/2az1"
},
{
"name": "萧山",
"id": "101210102",
"lat": "30.16293",
"lon": "120.27069",
"adm2": "杭州",
"adm1": "浙江省",
"country": "中国",
"tz": "Asia/Shanghai",
"utcOffset": "+08:00",
"isDst": "0",
"type": "city",
"rank": "23",
"fxLink": "http://hfx.link/32p1"
},
{
"name": "江干",
"id": "101210111",
"lat": "30.26660",
"lon": "120.20263",
"adm2": "杭州",
"adm1": "浙江省",
"country": "中国",
"tz": "Asia/Shanghai",
"utcOffset": "+08:00",
"isDst": "0",
"type": "city",
"rank": "25",
"fxLink": "http://hfx.link/1tvn1"
}
],
"refer": {
"sources": [
"qweather.com"
],
"license": [
"commercial license"
]
}
}
-
code
API status code, please refer to 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 and0
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