Pois/view
Zhangchao2 (讨论 | 贡献) (→XML示例) |
Zhangchao2 (讨论 | 贡献) (→JSON示例) |
||
第102行: | 第102行: | ||
"page":"1", | "page":"1", | ||
"coordinates":"116.37666,39.93258,116.43943,39.91171", | "coordinates":"116.37666,39.93258,116.43943,39.91171", | ||
− | " | + | "pois": |
[{ | [{ | ||
"pid":"0010_70585", | "pid":"0010_70585", | ||
− | " | + | "name":"\u4e2d\u5171\u4e1c\u57ce\u533a\u7eaa\u59d4\u4fe1\u8bbf\u63a5\u5f85\u5ba4(...", |
"address":"\u80b2\u7fa4\u80e1\u540c1\u53f7", | "address":"\u80b2\u7fa4\u80e1\u540c1\u53f7", | ||
+ | "category":"", | ||
"pic_urlS":"", | "pic_urlS":"", | ||
"gc":"116.41603 39.92913", | "gc":"116.41603 39.92913", | ||
"bus":"1"}, | "bus":"1"}, | ||
− | + | ... | |
− | + | ] | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
2011年3月23日 (三) 13:24的版本
目录 |
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" ?> <geoSearchResult> <result>1</result> <total>1355</total> <count>2</count> <page>1</page> <coordinates>116.37666,39.93258,116.43943,39.91171</coordinates> <pois> <poi> <pid>0010_70585</pid> <name>中共东城区纪委信访接待室(...</name> <address>育群胡同1号</address> <pic_urlS /> <gc>116.41603 39.92913</gc> <bus>1</bus> </poi> ... </pois> </geoSearchResult>
JSON示例
{ "result":"1", "total":"1355", "count":"2", "page":"1", "coordinates":"116.37666,39.93258,116.43943,39.91171", "pois": [{ "pid":"0010_70585", "name":"\u4e2d\u5171\u4e1c\u57ce\u533a\u7eaa\u59d4\u4fe1\u8bbf\u63a5\u5f85\u5ba4(...", "address":"\u80b2\u7fa4\u80e1\u540c1\u53f7", "category":"", "pic_urlS":"", "gc":"116.41603 39.92913", "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