跳转到: 导航, 搜索

location/line/bus_route

根据起点与终点数据查询公交乘坐路线信息

URL

https://api.weibo.com/2/location/line/bus_route.json

支持格式

JSON

HTTP请求方式

GET

是否需要登录


关于登录授权,参见 如何登录授权

访问授权限制

访问级别:普通接口
频次限制:
关于频次限制,参见 接口访问权限说明

请求参数

  必选 类型及范围 说明
access_token true string 采用OAuth授权方式为必填参数,OAuth授权后获得。
begin_pid false string 查询起点POI的ID,与begin_coordinate参数必选其一,begin_pid优先。
begin_coordinate false string 查询起点的坐标,经度纬度用逗号分隔,与begin_pid参数必选其一,begin_pid优先。
end_pid false string 查询终点POI的ID,与end_coordinate参数必选其一,end_pid优先。
end_coordinate false string 查询终点的坐标,经度纬度用逗号分隔,与end_pid参数必选其一,end_pid优先。
type false int 查询类型,0:最快捷、1:最经济、2:最少换乘、3:最少步行、4:最舒适,默认值为0。

注意事项

begin_pid及end_pid可由location/pois/search/by_locationlocation/pois/search/by_geolocation/pois/search/by_area接口取得。Place系列接口的poi信息不适用于该接口。

调用样例及调试工具

API测试工具

返回结果

JSON示例

{
    "type": "0",
    "city": "0010",
    "begin_pid": "P010A00CHR9",
    "begin_coordinate": "116.22106,39.90652",
    "end_pid": "P010A00CWWJ",
    "end_coordinate": "116.27505,40.00236",
    "extension_info": "0",
    "transfers": [
        {
            "result_id": "1",
            "distance": "18534米",
            "expense": "0",
            "before_len": "160米",
            "after_len": "820米",
            "nav_count": "2",
            "drive_coordinates": "116.22106,39.90652|116.22106,39.90594",
            "lines": [
                {
                    "seg_id": "1",
                    "name": "598路",
                    "distance": "4470米",
                    "after_len": "160米",
                    "stations_num": "7",
                    "stations": [
                        {
                            "name": "西直门",
                            "longitude": "116.21946",
                            "latitude": "116.21946",
                            "district": "110102",
                            "station_info": "地铁4号线(公益西桥-安河桥北)",
                            "address": "北京西直门",
                            "telephone": ""
                        },
                        ...
                    ]
                },
                ...
            ]
        },
        ...
    ],
    "total_number": 6
}

关于错误返回值与错误代码,参见 错误代码说明

返回字段说明

其他

相关问题


帮助中心 查看更多问题或提问


Language: [[{{{2/uri}}}|中文]]




文档更新时间: 2014-02-21