微博开放平台
微连接
移动应用
网站接入
电商服务商
电商商家
数据服务
数据服务
合作伙伴
微博支付
轻应用
粉丝服务
文档
推广
我的应用
登录
weibo
开发文档
首页
平台政策与指引
概述
平台公约
新手指南
开发者协议
应用运营管理规范
微连接分级管理办法
应用审核产品指南
应用安全开发注意事项
平台应用设计规范
微服务接入指南
微博登录接入
用微博帐号登录
授权机制
移动应用接入
移动应用介绍
移动应用SSO授权
微博Deep Link
媒体接入平台
头条文章开放接口
视频上传开放接口
电商接入平台
电商服务商接入
电商商家端接入
电商平台能力接口
粉丝服务平台
粉丝服务平台
新手接入指南
微信开发者迁移指南
接收消息
发送消息
自定义菜单
用户管理
生成带参数的二维码
Fans Service Platform
商业接口
商业数据接入指南
订阅服务手册(中文版)
订阅服务手册(英文版)
商业接口-REST API
商业数据常见问题
网站接入
网站接入介绍
微博API
微博API
接口访问频次权限
资源下载
SDK
微博标识下载
常见问题
联系我们
工具箱
链入页面
链出更改
特殊页面
查看源代码
跳转到:
导航
,
搜索
根据下列原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== '''公交线路搜索''' == 根据线路关键字或城市代码等进行搜索,返回公交线路信息 == '''URL''' == http://api.map.sina.com.cn/bus/line.(json|xml) == '''支持格式''' == '''XML/JSON''' == '''HTTP请求方式''' == '''GET''' == '''是否需要登录''' == '''false''' == '''请求数限制''' == '''true''' == '''请求参数''' == {| style="width:100%; height:200px;" border="1" cellspacing="0" cellpadding="0" ! style="text-align:center;width:20%;" |参数 ! style="text-align:center;width:10%" |必选 ! style="text-align:center;width:20%" |类型及范围 ! style="text-align:center;width:50%" |说明 |- style="height:px" | style="text-align:center;" |source | style="text-align:center;" |true | style="text-align:center;" |string | 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份 |- style="height:px" | style="text-align:center;" |q | style="text-align:center;" |true | style="text-align:center;" |string | 搜索关键字 |- style="height:px" | style="text-align:center;" |city | style="text-align:center;" |false | style="text-align:center;" |string | 所在城市代码,默认为0010,(详见[[Location/citycode|城市代码对照表]]) |- | style="text-align:center;" |page | style="text-align:center;" |false | style="text-align:center;" |int | 返回结果的页码(默认为1) |- | style="text-align:center;" |count | style="text-align:center;" |false | style="text-align:center;" |int | 单页返回的结果条数(默认为10,最大为40) |} == '''返回结果''' == === '''XML示例''' === <pre> <?xml version="1.0" encoding="UTF-8" ?> <geoSearchResult> <count>4</count> <status>1</status> <lines> <line> <result_id>1</result_id> <city>0010</city> <q>320路区间</q> <rid>136</rid> <coordinates>116.331676;39.986227;......</coordinates> <name>320路区间(保福寺桥西--北京西站北广场)</name> <front_name>保福寺桥西</front_name> <front_spell>bao fu si qiao xi</front_spell> <terminal_name>北京西站北广场</terminal_name> <terminal_spell>bei jing xi zhan bei guang chang</terminal_spell> <start_time>05:</start_time> <end_time>23:</end_time> <service_period /> <time_desc /> <company>北京公交集团第六客运分公司</company> <length>13.2563</length> <basic_price>1</basic_price> <total_price>1</total_price> <air>0</air> <commutation_ticket>0</commutation_ticket> <status>1</status> <auto>1</auto> <ic_card>1</ic_card> <express_way>0</express_way> <double_deck>0</double_deck> <description>北京公交集团第六客运分公司</description> <type>1</type> <stations> <station> <name>保福寺桥西</name> <longitude>116.331676</longitude> <latitude>39.98622</latitude> <district>310100</district> <station_info /> <telephone /> <address /> </station> ... </stations> </line> ... </lines> </geoSearchResult> </pre> === '''JSON示例''' === <pre> { "count":"4", "status":"1", "lines": [ { "result_id":"1", "city":"0010", "q":"320\u8def\u533a\u95f4", "rid":"136", "coordinates":"116.331676;39.986227;...", "name":"320\u8def\u533a\u95f4(\u4fdd\u798f\u5bfa\u6865\u897f--\u5317\u4eac\u897f\u7ad9\u5317\u5e7f\u573a)", "front_name":"\u4fdd\u798f\u5bfa\u6865\u897f", "front_spell":"bao fu si qiao xi", "terminal_name":"\u5317\u4eac\u897f\u7ad9\u5317\u5e7f\u573a", "terminal_spell":"bei jing xi zhan bei guang chang", "start_time":"05:", "end_time":"23:", "service_period":"", "time_desc":"", "company":"\u5317\u4eac\u516c\u4ea4\u96c6\u56e2\u7b2c\u516d\u5ba2\u8fd0\u5206\u516c\u53f8", "length":"13.2563", "basic_price":"1", "total_price":"1", "air":"0", "commutation_ticket":"0", "status":"1", "auto":"1", "ic_card":"1", "express_way":"0", "double_deck":"0", "description":"\u5317\u4eac\u516c\u4ea4\u96c6\u56e2\u7b2c\u516d\u5ba2\u8fd0\u5206\u516c\u53f8", "type":"1", "stations": [ { "name":"\u4fdd\u798f\u5bfa\u6865\u897f", "longitude":"116.331676", "latitude":"39.98622", "district":"310100", "station_info":"", "telephone":"", "address":"" }, ... ] }, ... ] } </pre> === '''字段说明 ''' === :count:返回的结果数 :status:标识结果;如该值为0,则没有找到相关的路线信息 :lines:返回的结果集 ::result_id:结果id ::rid:线路数据id ::name:线路名称 ::city:城市代码 ::q:线路关键字 ::front_name:起点名称 ::front_spell:起点拼音 ::terminal_name:终点名称 ::terminal_name:终点拼音 ::start_time:首班车时间 ::end_time:末班时间 ::service_period:区间 ::time_desc:时间说明 ::company:运营公司 ::length:总长度 ::basic_price:起步价 ::total_price:全程票价 ::air:是否有空调 ::commutation_ticket:是否能使用月票 ::status:状态 ::auto:无人售票 ::ic_card:是否能刷IC卡 ::express_way:是否快车 ::double_deck:是否双层车 ::description:线路描述 ::type:类型 ::coordinates:线路坐标串(格式:’;’分隔,经度;纬度;经度;纬度;) ::stations:途径站点集 :::name:站名 :::longitude:站点经度 :::latitude:站点纬度 :::district:区 :::station_info:站点详情 :::telephone:电话 :::address:地址 == '''使用示例''' == <pre> xml: http://api.map.sina.com.cn/bus/line.xml?q=320&source=appkey json: http://api.map.sina.com.cn/bus/line.json?q=320&source=appkey </pre>
返回到
Bus/line
。
反馈
分享
顶部