热门城市查询
请求路径#
GET /geo/v2/city/top参数#
查询参数
-
rangestring搜索范围,可设定只在某个国家或地区范围内进行搜索,国家和地区名称需使用ISO 3166 所定义的国家代码。如果不设置此参数,搜索范围将在所有城市。例如
range=cn -
numberinteger返回结果的数量,取值范围1-20,默认返回10个结果。
-
langstring
请求示例#
curl -X GET --compressed \
-H 'Authorization: Bearer your_token' \
'https://your-api-host/geo/v2/city/top'
请将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"
]
}
}
-
codestring
-
topCityListobject热门城市/地区列表
-
namestring位置名称
-
idstring位置ID
-
latstring纬度
-
lonstring经度
-
adm2string上级行政区划名称
-
adm1string一级行政区域名称
-
countrystring国家名称
-
tzstring
-
utcOffsetstring当前位置与UTC时间偏移的小时数
-
isDststring
-
typestring位置的属性
-
rankstring
-
fxLinkuri该位置的天气预报网页链接,便于嵌入你的网站或应用
-
-
referobject数据来源和许可信息
-
sourcesarray原始数据来源,或数据源说明,可能为空
-
licensearray数据许可或版权声明,可能为空
-