热门城市查询
获取全球各国热门城市列表。
请求路径#
GET /geo/v2/city/top参数#
查询参数
-
range搜索范围,可设定只在某个国家或地区范围内进行搜索,国家和地区名称需使用ISO 3166 所定义的国家代码。如果不设置此参数,搜索范围将在所有城市。例如range=cn -
number返回结果的数量,取值范围1-20,默认返回10个结果。 -
lang多语言设置,请阅读多语言文档,了解我们的多语言是如何工作、如何设置以及数据是否支持多语言。
请求示例#
curl -X GET --compressed \
-H 'Authorization: Bearer your_token' \
'https://your-api-host/geo/v2/city/top?range=cn&number=10&lang=zh'
请将your_token替换为你的JWT身份认证,将your_api_host替换为你的API Host
返回数据#
{
"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": [
"https://developer.qweather.com/attribution.html"
],
"license": [
"QWeather Developers License"
]
}
}
-
topCityListobject 热门城市/地区列表-
namestring 位置名称 -
idstring 位置ID -
latstring 纬度 -
lonstring 经度 -
adm2string 上级行政区划名称 -
adm1string 一级行政区域名称 -
countrystring 国家名称 -
typestring 位置的属性 -
fxLinkuri 该位置的天气预报网页链接,便于嵌入你的网站或应用
-
-
referobject 数据来源和许可信息-
sourcesarray 原始数据来源,或数据源说明,可能为空 -
licensearray 数据许可或版权声明,可能为空
-