首页 交通出行 长途汽车
长途汽车

长途汽车

  • 2274
  • 2747
提供全国主要城市的长途汽车时刻查询API,汽车站查询API。
230.00/30000次
https://api.binstd.com/bus/city2c
JSON,JSONP
GET POST
https://api.binstd.com/bus/city2c?appkey=yourappkey&start=杭州&end=上海

请求参数:

API在线测试
参数名称类型必填说明
start string 出发城市
end string 到达城市

返回参数:

参数名称类型说明
startcity string 出发城市
endcity string 到达城市
startstation string 出发车站
endstation string 到达车站
starttime string 出发时间
price string 票价
bustype string 车型
distance string 距离

请求代码:

查看代码
<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$start = '杭州';//utf8
$end = '上海';//utf8
$url = "https://api.binstd.com/bus/city2c?appkey=$appkey&start=$start&end=$end";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}

foreach($jsonarr['result'] as $val)
{
    echo $val['startcity'].' '.$val['endcity'].' '.$val['startstation'].' '.$val['endstation'].' '.$val['starttime'].' '.$val['price'].' '.$val['bustype'].' '.$val['distance'].'
'; }

JSON返回示例 :

{
    "status": "0",
    "msg": "ok",
    "result": [
        {
            "startcity": "杭州",
            "endcity": "上海",
            "startstation": "客运中心站",
            "endstation": "上海",
            "starttime": "06:50",
            "price": "68",
            "bustype": "大高3",
            "distance": "181"
        },
        {
            "startcity": "杭州",
            "endcity": "上海",
            "startstation": "客运中心站",
            "endstation": "上海南站",
            "starttime": "07:10",
            "price": "68",
            "bustype": "大高3",
            "distance": "181"
        },
        {
            "startcity": "杭州",
            "endcity": "上海",
            "startstation": "杭州南站",
            "endstation": "上海南站",
            "starttime": "07:10",
            "price": "68",
            "bustype": "大高2",
            "distance": "181"
        }
    ]
}
                    

API错误码:

代号说明
201 出发或到达城市为空
202 城市为空
203 没有信息

系统错误码:

代号说明
101 APPKEY为空或不存在
102 APPKEY已过期
103 APPKEY无请求此数据权限
104 请求超过次数限制
105 IP被禁止
106 IP请求超过限制
107 接口维护中
108 接口已停用
名称权限价格
免费套餐 5次 免费
Level1 30000次 230.00元
Level2 50000次 375.00元
Level3 100000次 725.00元

活动推荐ACTIVITY 更多

  • orc活动

热门API接口推荐RECOMMENDED DATA 更多

开通BinSTD会员

开通账号:

×

会员类型:

  • 会员

会员时长:

  • 按年付

总金额:

  • ¥ 600.00元原价:900.00元
  • ¥ 300.00元原价:450.00元
  • ¥ 50.00元原价:75.00元
  • ¥ 100.00元原价:150.00元
  • ¥ 150.00元原价:225.00元
  • ¥ 200.00元原价:300.00元
  • ¥ 250.00元原价:375.00元