之前有很多人和我要火车票余票接口的api,铁道部频繁升级程序,导致余票的数据一直失败,参看文章: 快春运了,做个火车余票查询接口,余票来源12306,图是百度地图, 这个虽然叫做火车余票接口,但是我要说的是非常抱歉目前这个接口还是没有获取到余票数据
之前有很多人和我要火车票余票接口的api,铁道部频繁升级程序,导致余票的数据一直失败,参看文章:
快春运了,做个火车余票查询接口,余票来源12306,图是百度地图,
这个虽然叫做火车余票接口,但是我要说的是非常抱歉目前这个接口还是没有获取到余票数据,不过这个接口可以获取到一些常规的火车信息(详见下面说明)
API使用方法
版权声明:火车票数据来源于12306.cn,如果有侵权,请及时联系,我会第一时间删除。
交流QQ群:153856687,198110186
接口说明:
支持POST/GET方式提交数据,返回JSON格式数据。另外请保持参数UTF8格式
-
余票火车信息查询
查询URL格式:
12306.php10086.com/yupiao.php?act=remain&arriveStation=上海&date=2012-02-02&startStation=杭州
参数格式:
act,是查询类型,remain表示为余票查询类型
date: [yyyy-mm-dd格式]
startStation: 发站[中文 UTF8]
arriveStation: 到站[中文 UTF8]
json数据说明:
title: 信息标题
station: 车站信息
item: 车次信息列表
trainCode: 序号
trainCode: 车次
startStation: 发站
arriveStation: 到站
startTime: 发时
endTime: 到时
takeTime: 历时
mileage: 里程
hard_seat_prc: 硬座(价格)
soft_seat_prc: 软座(价格)
hard_sleeper1_prc: 硬卧上(价格)
hard_sleeper2_prc: 硬卧中(价格)
hard_sleeper3_prc: 硬卧下(价格)
soft_sleeper1_prc: 软卧上(价格)
soft_sleeper2_prc: 软卧下(价格)
one_seat_prc: 一等座(价格)
two_seat_prc: 二等座(价格)
vag_sleeper1_prc: 高级软卧上(价格)
vag_sleeper2_prc: 高级软卧下(价格)
trainGrade: 等级
余票字段:(PS:这些数据目前无值)
********************************
hard_seat: 硬座(余票)
soft_seat: 软座(余票)
hard_sleeper1: 硬卧上(余票)
hard_sleeper2: 硬卧中(余票)
hard_sleeper3: 硬卧下(余票)
soft_sleeper1: 软卧上(余票)
soft_sleeper2: 软卧下(余票)
best_seat: 特等座(余票)
one_seat: 一等座(余票)
two_seat: 二等座(余票)
vag_sleeper1: 高级软卧上(余票)
vag_sleeper2: 高级软卧下(余票)
none_seat: 无座(余票)
**********************
火车车次查询
车次查询:
url格式: http://12306.php10086.com/yupiao.php?act=code&trainCode=D3106
act,是查询类型,code表示为车次查询类型
trainCode: 车次[字母+数字]
Json:
title: 信息标题
head: 头部标题
item: 车次信息
飞机机票查询
url格式:http://12306.php10086.com/yupiao.php?act=plane&arrivalAirport=北京&date=2012-02-19&departureAirport=上海
act,是查询类型,plane表示为机票查询类型
date: [yyyy-mm-dd]
departureAirport: 起飞[中文 UTF8]
arrivalAirport: 到达[中文 UTF8]
json数据:
title: 信息标题
item: 信息列表
flightCode: 航班号
carrierCom: 航空公司
planeType: 机型
departureTime: 起飞时间
arrivalTime: 降落时间
costTime: 飞行时间
departureAirport: 起飞机场
arrivalAirport: 降落机场
correctness: 准点率
delay: 平均延时
火车余票接口,机票接口,余票API
火车票余票接口API使用方法
联系作者: PHP淮北,交流QQ群:群1:153856687,群2:198110186
PHP10086博客网
订阅更新: 欢迎通过RSS订阅我们的内容更新

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

WebStorm Mac version
Useful JavaScript development tools
