携程火车票API 搞笑版

携程火车票API

1) 请求地址

https://trains.ctrip.com/pages/booking/getTransferList?departureStation=%2525E9%252587%25258D%2525E5%2525BA%252586&arrivalStation=%2525E5%25258C%252597%2525E4%2525BA%2525AC&departDateStr=2020-08-27

2) 调用方式:HTTP get

3) 接口描述:

  • 接口描述详情

4) 请求参数:

GET参数:

字段名称 字段说明 类型 必填 备注
departureStation   string Y -
arrivalStation   string Y -
departDateStr   string Y -

5) 请求返回结果:

{
    "status": 0,
    "message": "Success",
    "data": {
        "transferList": [
            {
                "departStation": "重庆西",
                "arriveStation": "北京西",
                "transferStation": "西安北",
                "transferTakeTime": "38分钟",
                "showPriceText": "¥797起",
                "trainTransferInfos": [
                    {
                        "sequence": 1,
                        "trainNo": "D1961",
                        "trainNumber": "D1961",
                        "departStation": "重庆西",
                        "departStationPy": "chongqingxi",
                        "arriveStation": "西安北",
                        "arriveStationPy": "xianbei",
                        "departDate": "2020-08-27",
                        "departTime": "12:15",
                        "arriveDate": "2020-08-27",
                        "arriveTime": "17:46",
                        "isStartStation": true,
                        "isEndStation": false,
                        "runTime": "5小时31分钟",
                        "preSaleTime": null,
                        "takeDays": 0,
                        "isBookable": true,
                        "seatList": [
                            {
                                "seatName": "二等座",
                                "showSeatName": "二等座",
                                "price": "281.5",
                                "orderPrice": 281.5,
                                "inventory": 99,
                                "inventoryStr": "有票",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            },
                            {
                                "seatName": "一等座",
                                "showSeatName": "一等座",
                                "price": "452",
                                "orderPrice": 452,
                                "inventory": 99,
                                "inventoryStr": "有票",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            },
                            {
                                "seatName": "特等座",
                                "showSeatName": "特等座",
                                "price": "509",
                                "orderPrice": 509,
                                "inventory": 99,
                                "inventoryStr": "有票",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            },
                            {
                                "seatName": "无座",
                                "showSeatName": "无  座",
                                "price": "281.5",
                                "orderPrice": 281.5,
                                "inventory": 0,
                                "inventoryStr": "余<em>0</em>张",
                                "isBookable": false,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            }
                        ],
                        "curSeatIndex": 0
                    },
                    {
                        "sequence": 2,
                        "trainNo": "G90",
                        "trainNumber": "G90",
                        "departStation": "西安北",
                        "departStationPy": "xianbei",
                        "arriveStation": "北京西",
                        "arriveStationPy": "beijingxi",
                        "departDate": "2020-08-27",
                        "departTime": "18:24",
                        "arriveDate": "2020-08-27",
                        "arriveTime": "22:52",
                        "isStartStation": false,
                        "isEndStation": true,
                        "runTime": "4小时28分钟",
                        "preSaleTime": null,
                        "takeDays": 0,
                        "isBookable": true,
                        "seatList": [
                            {
                                "seatName": "二等座",
                                "showSeatName": "二等座",
                                "price": "515.5",
                                "orderPrice": 515.5,
                                "inventory": 99,
                                "inventoryStr": "有票",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            },
                            {
                                "seatName": "一等座",
                                "showSeatName": "一等座",
                                "price": "824.5",
                                "orderPrice": 824.5,
                                "inventory": 11,
                                "inventoryStr": "余11张",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            },
                            {
                                "seatName": "商务座",
                                "showSeatName": "商务座",
                                "price": "1627.5",
                                "orderPrice": 1627.5,
                                "inventory": 10,
                                "inventoryStr": "余<em>10</em>张",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            }
                        ],
                        "curSeatIndex": 0
                    }
                ],
                "totalRuntime": "10小时37分钟",
                "totalRuntimeValue": 637,
                "index": 1,
                "tagList": null
            },
            {
                "departStation": "重庆西",
                "arriveStation": "北京西",
                "transferStation": "西安北",
                "transferTakeTime": "42分钟",
                "showPriceText": "¥924.5起",
                "trainTransferInfos": [
                    {
                        "sequence": 1,
                        "trainNo": "G1710",
                        "trainNumber": "G1710",
                        "departStation": "重庆西",
                        "departStationPy": "chongqingxi",
                        "arriveStation": "西安北",
                        "arriveStationPy": "xianbei",
                        "departDate": "2020-08-27",
                        "departTime": "10:49",
                        "arriveDate": "2020-08-27",
                        "arriveTime": "16:19",
                        "isStartStation": true,
                        "isEndStation": false,
                        "runTime": "5小时30分钟",
                        "preSaleTime": null,
                        "takeDays": 0,
                        "isBookable": true,
                        "seatList": [
                            {
                                "seatName": "二等座",
                                "showSeatName": "二等座",
                                "price": "409",
                                "orderPrice": 409,
                                "inventory": 99,
                                "inventoryStr": "有票",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            },
                            {
                                "seatName": "一等座",
                                "showSeatName": "一等座",
                                "price": "654.5",
                                "orderPrice": 654.5,
                                "inventory": 99,
                                "inventoryStr": "有票",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            },
                            {
                                "seatName": "商务座",
                                "showSeatName": "商务座",
                                "price": "1227",
                                "orderPrice": 1227,
                                "inventory": 19,
                                "inventoryStr": "余19张",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            }
                        ],
                        "curSeatIndex": 0
                    },
                    {
                        "sequence": 2,
                        "trainNo": "G438",
                        "trainNumber": "G438",
                        "departStation": "西安北",
                        "departStationPy": "xianbei",
                        "arriveStation": "北京西",
                        "arriveStationPy": "beijingxi",
                        "departDate": "2020-08-27",
                        "departTime": "17:01",
                        "arriveDate": "2020-08-27",
                        "arriveTime": "21:42",
                        "isStartStation": false,
                        "isEndStation": true,
                        "runTime": "4小时41分钟",
                        "preSaleTime": null,
                        "takeDays": 0,
                        "isBookable": true,
                        "seatList": [
                            {
                                "seatName": "二等座",
                                "showSeatName": "二等座",
                                "price": "515.5",
                                "orderPrice": 515.5,
                                "inventory": 99,
                                "inventoryStr": "有票",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            },
                            {
                                "seatName": "一等座",
                                "showSeatName": "一等座",
                                "price": "824.5",
                                "orderPrice": 824.5,
                                "inventory": 3,
                                "inventoryStr": "余<em>3</em>张",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            },
                            {
                                "seatName": "商务座",
                                "showSeatName": "商务座",
                                "price": "1627.5",
                                "orderPrice": 1627.5,
                                "inventory": 3,
                                "inventoryStr": "余<em>3</em>张",
                                "isBookable": true,
                                "buttonDisplayName": null,
                                "buttonType": 0
                            }
                        ],
                        "curSeatIndex": 0
                    }
                ],
                "totalRuntime": "10小时53分钟",
                "totalRuntimeValue": 653,
                "index": 2,
                "tagList": null
            }
}

6) 请求返回结果参数说明:

字段名称 字段说明 类型 必填 备注
status   string Y -
message   string Y -
data   string Y -
transferList   string Y -
departStation   string Y -
arriveStation   string Y -
transferStation   string Y -
transferTakeTime   string Y -
showPriceText   string Y -
trainTransferInfos   string Y -
sequence   string Y -
trainNo   string Y -
trainNumber   string Y -
departStationPy   string Y -
arriveStationPy   string Y -
departDate   string Y -
departTime   string Y -
arriveDate   string Y -
arriveTime   string Y -
isStartStation   string Y -
isEndStation   string Y -
runTime   string Y -
preSaleTime   string Y -
takeDays   string Y -
isBookable   string Y -
seatList   string Y -
seatName   string Y -
showSeatName   string Y -
price   string Y -
orderPrice   string Y -
inventory   string Y -
inventoryStr   string Y -
buttonDisplayName   string Y -
buttonType   string Y -
curSeatIndex   string Y -
totalRuntime   string Y -
totalRuntimeValue   string Y -
index   string Y -
tagList   string Y -
extendInfo   string Y -
departStationList   string Y -
endStationList   string Y -
departStationFilterMap   string Y -
endStationFilterMap   string Y -
departCityName   string Y -
arriveCityName   string Y -
gtMinPrice   string Y -

猜你喜欢

转载自blog.csdn.net/qq_36664772/article/details/108254039