QQ群①:120292508(满)
QQ群②:93064193
POI查询
根据不同的请求来源,该 API 使用不同的验证方式。如果请求来自第三方厂商(即经由开发者服务器中转),驴博士会验证Vend ID 与 来源 IP;如果请求来自终端设备,驴博士会验证 API Key。
开发者注册 Vend ID: http://lbs.org.cn/apireg.php
开发者需要提供固定IP。
开发者注册 API Key: http://lbs.org.cn/apireg.php(勾选“客户端直连模式 ”)
HTTP GET http://lbs.org.cn/api/lbs/poi_cat.php
<categories>
<category>
<id>(poi category id)</id>
<name>(poi category name in Chinese)</name>
</category>
...
</categories>
HTTP POST http://lbs.org.cn/api/lbs/poi.php
<poi_search ver='(string)' vendid='(string)'>
<query>(string)</query>
<lon>(double)</lon>
<lat>(double)</lat>
<range>(integer)</range>
<hex>(string)</hex>
<page>(integer)</page>
<count>(integer)</count>
<category>(integer)</category>
</poi_search>
或
<poi_search ver='(string)' key='(string)'>
<query>(string)</query>
<lon>(double)</lon>
<lat>(double)</lat>
<range>(integer)</range>
<hex>(string)</hex>
<page>(integer)</page>
<count>(integer)</count>
<category>(integer)</category>
</poi_search>
其中,
poi_search.ver 属性:版本号,当前为 1.0;
poi_search.vendid 属性: Vend ID;
poi_search.key 属性: API Key;
poi_search.query 节点:可选,搜索关键词;
poi_search.lat 节点:可选,纬度;
poi_search.lon 节点:可选,经度;
poi_search.range节点:可选,搜索半径,单位米,默认是5000 ;
poi_search.hex 节点:可选,16进制编码的定位依据,可以依靠此信息得到搜索位置的经纬度,当请求中包含了lon,lat参数时,则驴博士服务端忽略此参数;
poi_search.page 节点:可选,返回结果的起始页 ;
poi_search.count 节点:可选,每页返回结果的数量,默认20,最大50;
poi_search.category 节点:可选,类别的ID号(数字序号) ;
示例
<poi_search ver='1.0' vendid='tIK16YmYv8KbZ5Ja'>
<query>家乐福</query>
<lon>120.670738</lon>
<lat>31.295284</lat>
<range>5000</range>
<page>1</page>
<count>5</count>
</poi_search>
<poi_search>
<place>
<lon>(double)</lon>
<lat>(double)</lat>
<address>(string)</address>
<city>(string)</city>
</place>
<pois>
<poi_concise>
<id>(integer)</id>
<category_id>(integer)</category_id>
<name>(string)</name>
<lon>(double)</lon>
<lat>(double)(double)</lat>
<address>(string)</address>
<city>(string)</city>
<province>(string)</province>
<country>(string)</country>
</poi_concise>
...
</pois>
</poi_search>
或
<poi_search><error>错误的请求数据</error></poi_search>
或
<poi_search><error>无效的api key()</error></poi_search>
或
<poi_search><error>当天请求次数已满</error></poi_search>
在 Linux 终端用 curl 命令在 N31.295 E120.6707 附近搜索“家乐福”(您可能需要替换POST参数中的poi_search.key 属性):
curl http://lbs.org.cn/api/lbs/poi.php -d "<poi_search key='8746bbc0f1e77d913e1a3beb504b93fa'>
<query>家乐福</query>
<lon>120.670738</lon>
<lat>31.295284</lat>
<range>5000</range>
<page>1</page>
<count>5</count>
</poi_search>"
得到如下应答:
< xml version="1.0" encoding="UTF-8" >
<poi_search><pois><poi_concise><id><![CDATA[159940]]></id><category_id>0</category_id><name><![CDATA[家乐福(东环店)]]></name><address><![CDATA[苏州市工业园区葑谊路266号(东城世纪广场)]]></address><lon><![CDATA[120.65542]]></lon><lat><![CDATA[31.28955]]></lat><phone><![CDATA[0512-62761385]]></phone><country /><city><![CDATA[苏州市]]></city><province /></poi_concise><poi_concise><id><![CDATA[19053325]]></id><category_id><![CDATA[5]]></category_id><name><![CDATA[东环路家乐福二楼迪欧咖啡]]></name><address><![CDATA[东环路 和 机场路 附近]]></address><lon><![CDATA[120.65603]]></lon><lat><![CDATA[31.28912]]></lat><phone /><country /><city><![CDATA[苏州市]]></city><province /></poi_concise><poi_concise><id><![CDATA[1374060]]></id><category_id><![CDATA[1]]></category_id><name><![CDATA[苏州好利来(家乐福店)]]></name><address><![CDATA[娄葑镇葑谊街266号家乐福超市1楼]]></address><lon><![CDATA[120.65756]]></lon><lat><![CDATA[31.28864]]></lat><phone /><country /><city><![CDATA[苏州市]]></city><province /></poi_concise><poi_concise><id><![CDATA[19056052]]></id><category_id><![CDATA[1]]></category_id><name><![CDATA[大娘水饺(家乐福店)]]></name><address><![CDATA[娄封葑谊路 家乐福出口]]></address><lon><![CDATA[120.65581]]></lon><lat><![CDATA[31.28951]]></lat><phone /><country /><city><![CDATA[苏州市]]></city><province /></poi_concise><poi_concise><id><![CDATA[222862]]></id><category_id>0</category_id><name><![CDATA[家乐福(万达店)]]></name><address><![CDATA[平江区人民路3188号万达广场]]></address><lon><![CDATA[120.62109]]></lon><lat><![CDATA[31.31302]]></lat><phone><![CDATA[0512-87770398 0512-87770550]]></phone><country /><city><![CDATA[苏州市]]></city><province /></poi_concise></pois></poi_search>