Pois/view
Zhangchao2 (讨论 | 贡献) (创建新页面为 '== '''poi/view''' == 根据关键字和(或)分类,在一个矩形里进行搜索,返回相关的poi点信息 == '''URL''' == http://api.t.sina.com.cn/poi/search_view.(…') |
Zhangchao2 (讨论 | 贡献) (→请求参数) |
||
第19行: | 第19行: | ||
== '''请求参数''' == | == '''请求参数''' == | ||
{| style="width:100%; height:200px;" border="1" cellspacing="0" cellpadding="0" | {| style="width:100%; height:200px;" border="1" cellspacing="0" cellpadding="0" | ||
− | ! style="width:20%;" |参数 | + | ! style="text-align:center;width:20%;" |参数 |
− | ! style="width:10%" |必选 | + | ! style="text-align:center;width:10%" |必选 |
− | ! style="width:20%" |类型及范围 | + | ! style="text-align:center;width:20%" |类型及范围 |
− | ! style="width:50%" |说明 | + | ! style="text-align:center;width:50%" |说明 |
|- style="height:px" | |- style="height:px" | ||
| style="text-align:center;" |source | | style="text-align:center;" |source |
2011年3月11日 (五) 11:56的版本
目录 |
poi/view
根据关键字和(或)分类,在一个矩形里进行搜索,返回相关的poi点信息
URL
http://api.t.sina.com.cn/poi/search_view.(json%7Cxml)
支持格式
XML/JSON
HTTP请求方式
GET
是否需要登录
false
请求数限制
true
请求参数
参数 | 必选 | 类型及范围 | 说明 |
---|---|---|---|
source | true | string | 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。 |
coordinate | true | float | 搜索矩阵(用于视野内搜索)(格式为:x1,y1,x2,y2 其中1代表左下角的点,2代表右上角的点) |
注意:以下参数至少选填一个 | |||
q | false | string | 查询的关键字 |
category | false | string | 查询poi分类代码(详见分类代码对照表) |
注意:以下参数选填 | |||
sign | false | string | 返回值查询关键词标红(y或n,默认为n) |
city | false | string | 城市代码(不填城市代码,默认在全国搜索,详见城市代码对照表) |
page | false | int | 返回的首条结果在结果集中的页码(默认为1,最大为10) |
count | false | int | 返回的结果集中每页的结果数(默认为20,最大为50) |
返回结果
XML示例
<?xml version="1.0" encoding="utf-8" ?> <xml> <result>1</result> <total>1355</total> <count>2</count> <page>1</page> <coordinates>116.37666,39.93258,116.43943,39.91171</coordinates> <list> <item> <pid>0010_70585</pid> <title>中共东城区纪委信访接待室(...</title> <address>育群胡同1号</address> <pic_urlS /> <gc>116.41603 39.92913</gc> <bus>1</bus> </item> <item> <pid>0010_669424</pid> <title>皇朝娱乐</title> <address>华侨大厦B1</address> <pic_urlS /> <gc>116.41146 39.92348</gc> <bus>1</bus> </item> </list> </xml>
JSON示例
{ "result":"1", "total":"1355", "count":"2", "page":"1", "coordinates":"116.37666,39.93258,116.43943,39.91171", "list": [{ "pid":"0010_70585", "title":"\u4e2d\u5171\u4e1c\u57ce\u533a\u7eaa\u59d4\u4fe1\u8bbf\u63a5\u5f85\u5ba4(...", "address":"\u80b2\u7fa4\u80e1\u540c1\u53f7", "pic_urlS":"", "gc":"116.41603 39.92913", "bus":"1"}, { "pid":"0010_669424", "title":"\u7687\u671d\u5a31\u4e50", "address":"\u534e\u4fa8\u5927\u53a6B1", "pic_urlS":"", "gc":"116.41146 39.92348", "bus":"1" }] }
使用示例
xml: http://api.t.sina.com.cn/pois/view.xml?q=1&coordinate=116.37666,39.93258,116.43943,39.91171&source=appkey json: http://api.t.sina.com.cn/pois/view.json?q=1&coordinate=116.37666,39.93258,116.43943,39.91171&source=appkey