六派数据-公交地铁查询
  • ID

    34

  • 收藏

    2

  • 使用

    0

公交地铁查询

全国400多个城市公交车次信息、站站智能规划(公交、步行、骑行、自驾)、经过指定公交站的车次、附近公交站等4个API接口。数据更新时间:2021-09-01
套餐
20次 10000次 30000次 70000次 160000次
价格

  • 线路查询
  • 换乘查询
  • 站点查询
  • 附近站点查询
  • 城市查询

基本信息

  • 接口地址: http://open.6api.net/transit/line
  • 支持格式: JSON,JSONP
  • 请求方法: GET POST
  • 请求示例: http://open.6api.net/transit/line?appkey=yourappsecret

请求参数 API在线测试

参数名称 类型 必填 说明
city string 城市 cityid、city任选其一
cityid int 城市ID
transitno string 车次 例如(839路) 查询地铁加地铁2个字

返回参数

参数名称 类型   说明
transitno string   车次
startstation string   始发站
endstation string   终点站
starttime string   最早发车时间
endtime string   最晚发车时间
price decimal   票价
maxprice decimal   最高票价
sequenceno int   顺序
station string   站点
lat string   纬度 百度坐标系
lng string   经度
buscompany string   所属公交公司
timetable string   排班表
subway string   地铁换乘

请求代码 查看代码

  • PHP
  • JAVA
  • Python
require_once("curl.func.php");

$method = "POST";
$url = "http://open.6api.net/transit/line";
$headers = NULL;
$params = array(  
    "appkey" => "yourappsecret",
    "city" => "北京",
    "cityid" => "1",
    "transitno" => "839"
);
$result = api_curl($method, $url, $headers, $params);
if ($result) {
    $body = json_decode($result["body"], TRUE);
    $status_code = $body["status"];
    if ($status_code == "200") { 
        var_dump($body["result"]);
    }else
        var_dump($body); 
}else  
    echo "发送请求失败";

JSON返回示例

{
    "status": 200,
    "msg": "OK",
    "result": [
        {
            "transitno": "839路",
            "startstation": "刘家窑桥西",
            "endstation": "房山汽车站",
            "starttime": "06:20",
            "endtime": "21:00",
            "price": "2",
            "maxprice": "11.00",
            "buscompany": "北京公交集团第六客运分公司",
            "timetable": "06:20-21:00",
            "updatetime": "2020-09-16",
            "list": [
                {
                    "sequenceno": 1,
                    "station": "刘家窑桥西",
                    "lat": "39.8634191",
                    "lng": "116.4239830",
                    "subway": null
                },
                {
                    "sequenceno": 2,
                    "station": "木樨园桥东",
                    "lat": "39.8634911",
                    "lng": "116.4113750",
                    "subway": null
                },
                {
                    "sequenceno": 3,
                    "station": "木樨园桥西",
                    "lat": "39.8634221",
                    "lng": "116.3992480",
                    "subway": null
                },
                {
                    "sequenceno": 4,
                    "station": "洋桥西",
                    "lat": "39.8634011",
                    "lng": "116.3894650",
                    "subway": null
                },
                {
                    "sequenceno": 5,
                    "station": "草桥",
                    "lat": "39.8593931",
                    "lng": "116.3661540",
                    "subway": null
                },
                {
                    "sequenceno": 6,
                    "station": "玉泉营桥西",
                    "lat": "39.8546570",
                    "lng": "116.3459960",
                    "subway": null
                },
                {
                    "sequenceno": 7,
                    "station": "夏家胡同",
                    "lat": "39.8551840",
                    "lng": "116.3341390",
                    "subway": null
                },
                {
                    "sequenceno": 8,
                    "station": "丰台北路",
                    "lat": "39.8728091",
                    "lng": "116.3044580",
                    "subway": null
                },
                {
                    "sequenceno": 9,
                    "station": "七里庄",
                    "lat": "39.8724351",
                    "lng": "116.2987270",
                    "subway": "[{\"background_color\":\"#d5a7a1\",\"name\":\"<font color=\\\"#ffffff\\\">14号线西段<\\/font>\"},{\"background_color\":\"#8fc31f\",\"name\":\"<font color=\\\"#ffffff\\\">9号线<\\/font>\"}]"
                },
                {
                    "sequenceno": 10,
                    "station": "西道口",
                    "lat": "39.8609711",
                    "lng": "116.2444070",
                    "subway": null
                },
                {
                    "sequenceno": 11,
                    "station": "长阳环岛南",
                    "lat": "39.7740871",
                    "lng": "116.1736200",
                    "subway": null
                },
                {
                    "sequenceno": 12,
                    "station": "长阳路口",
                    "lat": "39.7669951",
                    "lng": "116.1681140",
                    "subway": null
                },
                {
                    "sequenceno": 13,
                    "station": "黄辛庄",
                    "lat": "39.7635351",
                    "lng": "116.1657510",
                    "subway": null
                },
                {
                    "sequenceno": 14,
                    "station": "送变电公司路口西",
                    "lat": "39.7561311",
                    "lng": "116.1592470",
                    "subway": null
                },
                {
                    "sequenceno": 15,
                    "station": "行宫南门路口",
                    "lat": "39.7533571",
                    "lng": "116.1548280",
                    "subway": null
                },
                {
                    "sequenceno": 16,
                    "station": "良乡北关",
                    "lat": "39.7486831",
                    "lng": "116.1473900",
                    "subway": null
                },
                {
                    "sequenceno": 17,
                    "station": "西潞园",
                    "lat": "39.7412351",
                    "lng": "116.1425390",
                    "subway": null
                },
                {
                    "sequenceno": 18,
                    "station": "良乡西门",
                    "lat": "39.7371851",
                    "lng": "116.1408860",
                    "subway": null
                },
                {
                    "sequenceno": 19,
                    "station": "苏庄东街北口",
                    "lat": "39.7370671",
                    "lng": "116.1337270",
                    "subway": null
                },
                {
                    "sequenceno": 20,
                    "station": "良乡西路",
                    "lat": "39.7370461",
                    "lng": "116.1308430",
                    "subway": null
                },
                {
                    "sequenceno": 21,
                    "station": "苏园",
                    "lat": "39.7354440",
                    "lng": "116.1268460",
                    "subway": null
                },
                {
                    "sequenceno": 22,
                    "station": "阎村",
                    "lat": "39.7259481",
                    "lng": "116.1008930",
                    "subway": null
                },
                {
                    "sequenceno": 23,
                    "station": "紫草坞路口",
                    "lat": "39.7231111",
                    "lng": "116.0877330",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 24,
                    "station": "大董村",
                    "lat": "39.7203151",
                    "lng": "116.0681320",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 25,
                    "station": "大石河",
                    "lat": "39.7161601",
                    "lng": "116.0446240",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 26,
                    "station": "房山马各庄",
                    "lat": "39.7121771",
                    "lng": "116.0247080",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 27,
                    "station": "饶乐府",
                    "lat": "39.7086661",
                    "lng": "116.0152040",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 28,
                    "station": "房山东大桥",
                    "lat": "39.7053081",
                    "lng": "116.0035530",
                    "subway": null
                },
                {
                    "sequenceno": 29,
                    "station": "房山火车站",
                    "lat": "39.7124270",
                    "lng": "115.9955850",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 30,
                    "station": "万宁桥",
                    "lat": "39.7150081",
                    "lng": "115.9902670",
                    "subway": null
                },
                {
                    "sequenceno": 31,
                    "station": "仓房小区",
                    "lat": "39.7098571",
                    "lng": "115.9910820",
                    "subway": null
                },
                {
                    "sequenceno": 32,
                    "station": "房山南关立交桥北",
                    "lat": "39.6988961",
                    "lng": "115.9932540",
                    "subway": null
                },
                {
                    "sequenceno": 33,
                    "station": "房山汽车站",
                    "lat": "39.7010811",
                    "lng": "115.9957180",
                    "subway": null
                }
            ]
        },
        {
            "transitno": "839路",
            "startstation": "房山汽车站",
            "endstation": "刘家窑桥西",
            "starttime": "04:50",
            "endtime": "19:30",
            "price": "2",
            "maxprice": "11.00",
            "buscompany": "北京公交集团第六客运分公司",
            "timetable": "05:00-19:30",
            "updatetime": "2020-09-25",
            "list": [
                {
                    "sequenceno": 0,
                    "station": "房山南关南",
                    "lat": "39.6940900",
                    "lng": "115.9911118",
                    "subway": null
                },
                {
                    "sequenceno": 1,
                    "station": "房山汽车站",
                    "lat": "39.7012552",
                    "lng": "115.9956979",
                    "subway": null
                },
                {
                    "sequenceno": 2,
                    "station": "仓房小区",
                    "lat": "39.7097263",
                    "lng": "115.9911329",
                    "subway": null
                },
                {
                    "sequenceno": 3,
                    "station": "万宁桥",
                    "lat": "39.7154223",
                    "lng": "115.9903677",
                    "subway": null
                },
                {
                    "sequenceno": 4,
                    "station": "房山火车站",
                    "lat": "39.7110062",
                    "lng": "115.9962189",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 5,
                    "station": "房山东大桥",
                    "lat": "39.7051859",
                    "lng": "116.0040296",
                    "subway": null
                },
                {
                    "sequenceno": 6,
                    "station": "饶乐府",
                    "lat": "39.7084277",
                    "lng": "116.0149566",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 7,
                    "station": "房山马各庄",
                    "lat": "39.7119637",
                    "lng": "116.0245708",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 8,
                    "station": "大石河",
                    "lat": "39.7155556",
                    "lng": "116.0434447",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 9,
                    "station": "大董村",
                    "lat": "39.7205341",
                    "lng": "116.0700614",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 10,
                    "station": "紫草坞路口",
                    "lat": "39.7232076",
                    "lng": "116.0891913",
                    "subway": "[{\"background_color\":\"#e46022\",\"name\":\"<font color=\\\"#ffffff\\\">燕房线<\\/font>\"}]"
                },
                {
                    "sequenceno": 11,
                    "station": "阎村",
                    "lat": "39.7254385",
                    "lng": "116.1005811",
                    "subway": null
                },
                {
                    "sequenceno": 12,
                    "station": "苏园",
                    "lat": "39.7339882",
                    "lng": "116.1251900",
                    "subway": null
                },
                {
                    "sequenceno": 13,
                    "station": "良乡西路",
                    "lat": "39.7369593",
                    "lng": "116.1318618",
                    "subway": null
                },
                {
                    "sequenceno": 14,
                    "station": "苏庄东街北口",
                    "lat": "39.7370442",
                    "lng": "116.1365249",
                    "subway": null
                },
                {
                    "sequenceno": 15,
                    "station": "良乡西门",
                    "lat": "39.7377680",
                    "lng": "116.1425739",
                    "subway": null
                },
                {
                    "sequenceno": 16,
                    "station": "西潞园",
                    "lat": "39.7396571",
                    "lng": "116.1425650",
                    "subway": null
                },
                {
                    "sequenceno": 17,
                    "station": "良坨路口",
                    "lat": "39.7461950",
                    "lng": "116.1437321",
                    "subway": null
                },
                {
                    "sequenceno": 18,
                    "station": "良乡北关东",
                    "lat": "39.7498236",
                    "lng": "116.1495011",
                    "subway": null
                },
                {
                    "sequenceno": 19,
                    "station": "行宫南门路口",
                    "lat": "39.7543493",
                    "lng": "116.1567181",
                    "subway": null
                },
                {
                    "sequenceno": 20,
                    "station": "送变电公司路口西",
                    "lat": "39.7567653",
                    "lng": "116.1606045",
                    "subway": null
                },
                {
                    "sequenceno": 21,
                    "station": "黄辛庄",
                    "lat": "39.7642945",
                    "lng": "116.1664445",
                    "subway": null
                },
                {
                    "sequenceno": 22,
                    "station": "长阳碧桂园",
                    "lat": "39.7679893",
                    "lng": "116.1690302",
                    "subway": null
                },
                {
                    "sequenceno": 23,
                    "station": "昊天北桥南",
                    "lat": "39.7740342",
                    "lng": "116.1738182",
                    "subway": null
                },
                {
                    "sequenceno": 24,
                    "station": "七里庄",
                    "lat": "39.8720990",
                    "lng": "116.2989881",
                    "subway": "[{\"background_color\":\"#d5a7a1\",\"name\":\"<font color=\\\"#ffffff\\\">14号线西段<\\/font>\"},{\"background_color\":\"#8fc31f\",\"name\":\"<font color=\\\"#ffffff\\\">9号线<\\/font>\"}]"
                },
                {
                    "sequenceno": 25,
                    "station": "丰台北路",
                    "lat": "39.8723845",
                    "lng": "116.3036274",
                    "subway": null
                },
                {
                    "sequenceno": 26,
                    "station": "夏家胡同",
                    "lat": "39.8552082",
                    "lng": "116.3336311",
                    "subway": null
                },
                {
                    "sequenceno": 27,
                    "station": "玉泉营桥西",
                    "lat": "39.8545351",
                    "lng": "116.3451199",
                    "subway": null
                },
                {
                    "sequenceno": 28,
                    "station": "草桥",
                    "lat": "39.8594651",
                    "lng": "116.3669100",
                    "subway": null
                },
                {
                    "sequenceno": 29,
                    "station": "洋桥西",
                    "lat": "39.8632591",
                    "lng": "116.3893397",
                    "subway": null
                },
                {
                    "sequenceno": 30,
                    "station": "木樨园桥西",
                    "lat": "39.8633526",
                    "lng": "116.4013528",
                    "subway": null
                },
                {
                    "sequenceno": 31,
                    "station": "木樨园桥东",
                    "lat": "39.8633353",
                    "lng": "116.4115817",
                    "subway": null
                },
                {
                    "sequenceno": 32,
                    "station": "赵公口桥西",
                    "lat": "39.8633241",
                    "lng": "116.4156910",
                    "subway": null
                },
                {
                    "sequenceno": 33,
                    "station": "刘家窑桥西",
                    "lat": "39.8632868",
                    "lng": "116.4232866",
                    "subway": null
                }
            ]
        }
    ]
}

    数据信息

  • 今日调用: 40,834  次
  • 客服电话: 010-8639-9970
  • 客服邮箱: kf@ksmsoft.net
  • 售前客服:
  • 售后技术:

公交地铁查询问答专区

问答专区

相关资讯

其他推荐