POI搜索
请求路径#
GET /geo/v2/poi/lookup参数#
查询参数
-
location(必选) 需要查询地区的LocationID或以英文逗号分隔的经度,纬度坐标(十进制,最多支持小数点后两位),LocationID可通过GeoAPI获取。例如location=101010100或location=116.41,39.92 -
type(必选) POI类型,可选择搜索某一类型的POI。scenic景点,TSTA潮汐站点 -
city选择POI所在城市,可设定只搜索在特定城市内的POI信息。城市名称可以是文字或城市的LocationID。城市名称为精准匹配,建议使用LocaitonID,如文字无法匹配,则数据返回为空。默认不限制特定城市。 -
number返回结果的数量,取值范围1-20,默认返回10个结果。 -
lang多语言设置,请阅读多语言文档,了解我们的多语言是如何工作、如何设置以及数据是否支持多语言。
请求示例#
curl -X GET --compressed \
-H 'Authorization: Bearer your_token' \
'https://your-api-host/geo/v2/poi/lookup?location=116.41%2C39.92&type=scenic&city=101010100&number=10&lang=zh'
请将your_token替换为你的JWT身份认证,将your_api_host替换为你的API Host
返回数据#
{
"code": "200",
"poi": [
{
"name": "景山公园",
"id": "10101010012A",
"lat": "39.91999",
"lon": "116.38999",
"adm2": "北京",
"adm1": "北京",
"country": "中国",
"tz": "Asia/Shanghai",
"utcOffset": "+08:00",
"isDst": "0",
"type": "scenic",
"rank": "671",
"fxLink": "https://www.qweather.com"
},
{
"name": "静思园",
"id": "10119040702A",
"lat": "31.15999",
"lon": "120.68000",
"adm2": "苏州",
"adm1": "苏州",
"country": "中国",
"tz": "Asia/Shanghai",
"utcOffset": "+08:00",
"isDst": "0",
"type": "scenic",
"rank": "86",
"fxLink": "https://www.qweather.com"
}
],
"refer": {
"sources": [
"https://developer.qweather.com/attribution.html"
],
"license": [
"QWeather Developers License"
]
}
}
-
poiobject POI 列表-
namestring 位置名称 -
idstring 位置ID -
latstring 纬度 -
lonstring 经度 -
adm2string 上级行政区划名称 -
adm1string 一级行政区域名称 -
countrystring 国家名称 -
typestring 位置的属性 -
fxLinkuri 该位置的天气预报网页链接,便于嵌入你的网站或应用
-
-
referobject 数据来源和许可信息-
sourcesarray 原始数据来源,或数据源说明,可能为空 -
licensearray 数据许可或版权声明,可能为空
-