当前所在位置:首页>数据接口>生活服务>12306火车票查询订票

12306火车票查询订票 

即日起至7月1日铁路部门执行调整列车运行图,全国列车开行密度、运行时速、停靠时刻都将发生变化

数据ID:25

接口状态:正常

连接应用数:47567

接入服务商:haoservice

/100次 购买套餐

  • API
  • 错误码参照
  • 资费套餐
  • 版本变更
  • 代码示例
  • 其他相关
接口地址: http://apis.haoservice.com/lifeservice/train/ypcx
支持格式: JSON/XML
请求方式: GET/POST
明文方式请求参数:
名称 类型 必填 说明
key string API KEY
date String 出发日期,默认今日
from String 出发站(如:上海虹桥)
to String 到达站(如:温州南)
密文方式请求参数:
名称 类型 必填 说明
IsEncrypt bool 是否密文传输方式
key string API KEY
params string 3des ECB模式 PKCS7填充模式 加密 3des("date=2015-04-27&from=上海&to=温州","openId前24位")
调用样例及调试工具:
返回字段:
名称 类型 说明
ticketpriceString火车票票价信息 A9:商务座,P:商务座,M:一等座 O:二等座,A6:,高级软卧,A4:软卧,A3:硬卧,A2:软座,A1:硬座,WZ:无座的票价
明文JSON返回示例:
{ "error_code":"0", "reason":"Success", "result":[{ "train_no": "D2287", /*车次*/ "start_station_name": "上海虹桥", /*车次始发站*/ "end_station_name": "深圳北", /*车次终点站*/ "from_station_name": "上海虹桥", /*出发站*/ "to_station_name": "温州南", /*到达站*/ "start_time": "06:25", /*出发时间*/ "arrive_time": "10:53", /*到达时间*/ "train_class_name": "动车", /*车次类型*/ "day_difference": "0", /*历时天数*/ "lishi": "04:28", /*总历时时间*/ "gr_num": "--", /*高级软卧:-- 说明无该席位*/ "qt_num": "--", /*其他*/ "rw_num": "--", /*软卧*/ "rz_num": "--", /*软座*/ "tz_num": "--", /*特等座*/ "wz_num": "无", /*无座*/ "yw_num": "--", /*硬卧*/ "yz_num": "--", /*硬座*/ "ze_num": "无", /*二等座*/ "zy_num": "无", /*一等座*/ "swz_num": "--" /*商务座*/ }, { "train_no": "D3203", "start_station_name": "上海虹桥", "end_station_name": "厦门北", "from_station_name": "上海虹桥", "to_station_name": "温州南", "start_time": "06:30", "arrive_time": "11:09", "train_class_name": "动车", "day_difference": "0", "lishi": "04:39", "gr_num": "--", "qt_num": "--", "rw_num": "--", "rz_num": "--", "tz_num": "--", "wz_num": "无", "yw_num": "--", "yz_num": "--", "ze_num": "无", "zy_num": "无", "swz_num": "--" ,"ticketprice":{"OT":[],"WZ":"¥226.0","M":"¥335.5","A9":"¥689.0","9":"6890","O":"¥226.0","train_no":"5l000G753722"}}, { "train_no": "G7501", "start_station_name": "上海虹桥", "end_station_name": "苍南", "from_station_name": "上海虹桥", "to_station_name": "温州南", "start_time": "07:00", "arrive_time": "11:00", "train_class_name": "", "day_difference": "0", "lishi": "04:00", "gr_num": "--", "qt_num": "--", "rw_num": "--", "rz_num": "--", "tz_num": "--", "wz_num": "165", "yw_num": "--", "yz_num": "--", "ze_num": "无", "zy_num": "无", "swz_num": "15","ticketprice":{"OT":[],"WZ":"¥226.0","M":"¥335.5","A9":"¥689.0","9":"6890","O":"¥226.0","train_no":"5l000G753722"} }] }
密文JSON返回示例:
hCe2pmNRFnwP3gbrGm9vnobmGI+VZPwJAFJ6xcEkeJGyOQKBipdMSDN1yb3lDI48WoqV7IJHb3tjJABrAc00igyE1dYBYQophG/6anzWjA857/YaMzKj5kfiVxyBavy4a4OudBnMncw=

推荐接口/API

  • 银行卡归属地查询

    根据银行卡号查询银行卡归属地信息

  • 常用快递

    涵盖国内主流快递及部分国际邮政、国际快递,轻松查询超过200家快递

  • 全国天气查询

    全国天气查询API

  • 手机归属地查询

    通过手机号即可知道用户所在的地区

  • 电子眼防拍

    最新电子眼api,电子狗api,通过该接口提前提醒车主电子眼或测速雷达等测速设备的存在,防止因为超速等违规而被罚款和扣分。为普通电子狗、智能电子狗、云电子狗等设备提供即时提醒。

  • 航班查询[实时动态]

    航班动态实时查询API,支持国内航班动态实时查询,国际航班动态实时查询

联系客服

010-58436659