• 79
  • 2695
  • 103

火车时刻表

360搜索 免费 支持HTTPS

由360搜索提供的火车时刻表

  • 免费会员100次/天
  • 高级会员500次/天
  • 钻石会员无限次/天

免费 (根据会员等级不同,每日可调用次数不同)

  • API文档
  • 错误码参照
  • 示例代码
  • 联系我们
立即调用
接口地址:http://op.juhe.cn/onebox/train/query_ab
返回格式:json
请求方式:http get
请求示例:http://op.juhe.cn/onebox/train/query_ab.php?key=您的APPKEY&from=%E4%B8%8A%E6%B5%B7&to=%E8%A5%BF%E5%AE%89
接口备注:站到站列车信息检索

请求参数说明:

名称 必填 类型 说明
  from string 出发站名称,如:北京
  to string 到达站名称,如:上海
  key string 在个人中心->我的数据,接口名称上方查看

返回参数说明:

名称 类型 说明
  error_code int 返回码
  reason string 返回说明
  result string 返回结果集

JSON返回示例:

{
    "reason": "查询成功",
    "result": {
        "list": [ /*列次列表*/
            {
                "train_no": "D311",	/*列次*/
                "train_type": "动车",	/*列车类型*/
                "start_station": "苏州",	/*出发站*/
                "start_station_type": "过",	/*出发站类型*/
                "end_station": "上海",	/*到达站*/
                "end_station_type": "终",	/*到达站类型*/
                "start_time": "08:09",	/*发车时间*/
                "end_time": "08:58",	/*到达时间*/
                "run_time": "49分",	/*历时*/
                "run_distance": "",	/*里程*/
                "price_list": [	/*价格列表*/
                    {
                        "price_type": "无座",
                        "price": "24.5"
                    },
                    {
                        "price_type": "软卧",
                        "price": "189.5"
                    }
                ]
            },
            {
                "train_no": "T54",
                "train_type": "特快",
                "start_station": "苏州",
                "start_station_type": "过",
                "end_station": "上海",
                "end_station_type": "终",
                "start_time": "13:37",
                "end_time": "14:31",
                "run_time": "54分",
                "run_distance": "",
                "price_list": [
                    {
                        "price_type": "无座",
                        "price": "14.5"
                    },
                    {
                        "price_type": "硬座",
                        "price": "14.5"
                    },
                    {
                        "price_type": "硬卧上",
                        "price": "60.5"
                    },
                    {
                        "price_type": "硬卧中",
                        "price": "25"
                    },
                    {
                        "price_type": "硬卧下",
                        "price": "68.5"
                    },
                    {
                        "price_type": "软卧上",
                        "price": "60.5"
                    },
                    {
                        "price_type": "软卧下",
                        "price": "39"
                    }
                ]
            },
            {
                "train_no": "T109",
                "train_type": "特快",
                "start_station": "苏州",
                "start_station_type": "过",
                "end_station": "上海",
                "end_station_type": "终",
                "start_time": "09:52",
                "end_time": "10:44",
                "run_time": "52分",
                "run_distance": "",
                "price_list": [
                    {
                        "price_type": "无座",
                        "price": "14.5"
                    },
                    {
                        "price_type": "硬座",
                        "price": "14.5"
                    },
                    {
                        "price_type": "高级软卧",
                        "price": "167.5"
                    },
                    {
                        "price_type": "硬卧上",
                        "price": "60.5"
                    },
                    {
                        "price_type": "硬卧中",
                        "price": "65.5"
                    },
                    {
                        "price_type": "硬卧下",
                        "price": "68.5"
                    },
                    {
                        "price_type": "软卧上",
                        "price": "60.5"
                    },
                    {
                        "price_type": "软卧下",
                        "price": "96.5"
                    }
                ]
            },
            {
                "train_no": "T134",
                "train_type": "特快",
                "start_station": "苏州",
                "start_station_type": "过",
                "end_station": "上海",
                "end_station_type": "终",
                "start_time": "11:57",
                "end_time": "12:52",
                "run_time": "55分",
                "run_distance": "",
                "price_list": [
                    {
                        "price_type": "无座",
                        "price": "14.5"
                    },
                    {
                        "price_type": "硬座",
                        "price": "14.5"
                    },
                    {
                        "price_type": "硬卧上",
                        "price": "60.5"
                    },
                    {
                        "price_type": "硬卧中",
                        "price": "65.5"
                    },
                    {
                        "price_type": "硬卧下",
                        "price": "68.5"
                    },
                    {
                        "price_type": "软卧上",
                        "price": "60.5"
                    },
                    {
                        "price_type": "软卧下",
                        "price": "96.5"
                    }
                ]
            },
            {
                "train_no": "T140",
                "train_type": "特快",
                "start_station": "苏州",
                "start_station_type": "过",
                "end_station": "上海",
                "end_station_type": "终",
                "start_time": "12:20",
                "end_time": "13:13",
                "run_time": "53分",
                "run_distance": "",
                "price_list": [
                    {
                        "price_type": "无座",
                        "price": "14.5"
                    },
                    {
                        "price_type": "硬座",
                        "price": "14.5"
                    },
                    {
                        "price_type": "硬卧上",
                        "price": "60.5"
                    },
                    {
                        "price_type": "硬卧中",
                        "price": "65.5"
                    },
                    {
                        "price_type": "硬卧下",
                        "price": "68.5"
                    },
                    {
                        "price_type": "软卧上",
                        "price": "60.5"
                    },
                    {
                        "price_type": "软卧下",
                        "price": "96.5"
                    }
                ]
            }
        ]
    },
    "error_code": 0
}

服务级错误码参照(error_code):

  错误码 说明
  207901 火车班次不能为空
  207902 查询不到火车该班次相关信息
  207903 网络错误,请重试
  207904 火车始发终点站不能为空
  207905 查询不到火车始发站相关信息

系统级错误码参照:

  错误码 说明 旧版本(resultcode)
  10001 错误的请求KEY 101
  10002 该KEY无请求权限 102
  10003 KEY过期 103
  10004 错误的OPENID 104
  10005 应用未审核超时,请提交认证 105
  10007 未知的请求源 107
  10008 被禁止的IP 108
  10009 被禁止的KEY 109
  10011 当前IP请求超过限制 111
  10012 请求超过次数限制 112
  10013 测试KEY超过请求限制 113
  10014 系统内部异常(调用充值类业务时,请务必联系客服或通过订单查询接口检测订单,避免造成损失) 114
  10020 接口维护 120
  10021 接口停用 121

错误码格式说明(示例:200201):

  2 002 01
  服务级错误(1为系统级错误) 服务模块代码(即数据ID) 具体错误代码

完整教学代码示例:

  语言 标题 提供者 时间

常见问题:

  内容 详细
  常见问题: http://www.juhe.cn/qa/index/1545163568

联系我们

  内容 详细
  接口测试: API测试工具
  技术支持: info@juhe.cn
  联系电话: 400-8827-715
  在线客服QQ: 800076065

猜你喜欢

现在注册,百款接口免费测试

免费注册