六派数据-火车查询
  • ID

    18

  • 收藏

    4

  • 使用

    11

火车查询

提供全国火车票时刻查询、火车站站查询、火车余票查询等3个接口。
套餐
50次 50000次 100000次
价格

立即申请 收藏数据 首次申请赠送50次免费调用
  • 站站查询
  • 车次查询
  • 余票查询

基本信息

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

请求参数 API在线测试

参数名称 类型 必填 说明
start string 出发
end string 到达
ishigh int 是否高铁
date string 时间

返回参数

参数名称 类型   说明
trainno string   车次
type string   类型
station string   出发站
endstation string   到达站
departuretime string   出发时间
arrivaltime string   到达时间
sequenceno int   顺序
costtime string   用时
distance string   距离
isend int   是否终点
pricesw string   商务座票价
pricetd string   特等座票价
pricegr1 string   高级软卧上票价
pricegr2 string   高级软卧下票价
pricerw1 string   软卧上票价
pricerw2 string   软卧下票价
priceyw1 string   硬卧上票价
priceyw2 string   硬卧中票价
priceyw3 string   硬卧下票价
priceyd string   一等座票价
priceed string   二等座票价
pricerz string   软座票价
priceyz string   硬座票价

请求代码 查看代码

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

$method = "POST";
$url = "http://open.liupai.net/train/station";
$headers = NULL;
$params = array(  
    "appkey" => "yourappsecret",
    "start" => "杭州",
    "end" => "北京",
    "ishigh" => "0",
    "date" => "参数4"
);
$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": 0,
    "msg": "ok",
    "result": [
        {
            "trainno": "G34",
            "type": "高铁",
            "station": "杭州东",
            "endstation": "北京南",
            "departuretime": "07:18",
            "arrivaltime": "13:07",
            "sequenceno": "1",
            "costtime": "5时49分",
            "distance": "1279",
            "isend": "1",
            "pricesw": "",
            "pricetd": "",
            "pricegr1": "",
            "pricegr2": "",
            "pricerw1": "0.0",
            "pricerw2": "0.0",
            "priceyw1": "0.0",
            "priceyw2": "0.0",
            "priceyw3": "0.0",
            "priceyd": "907.0",
            "priceed": "538.5"
        },
        {
            "trainno": "G32",
            "type": "高铁",
            "station": "杭州东",
            "endstation": "北京南",
            "departuretime": "08:30",
            "arrivaltime": "13:28",
            "sequenceno": "1",
            "costtime": "4时58分",
            "distance": "1279",
            "isend": "1",
            "pricesw": "",
            "pricetd": "",
            "pricegr1": "",
            "

    数据信息

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

火车查询问答专区

问答专区

相关资讯

其他推荐