Ctrip Train Ticket API Funny Edition

Ctrip Train Ticket API

1) Request address

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) Calling method: HTTP get

3) Interface description:

  • Interface description details

4) Request parameters:

GET parameters:

Field Name Field description Types of Required Remarks
departureStation   string AND -
arrivalStation   string AND -
departDateStr   string AND -

5) Request to return result:

{
    "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) Request return result parameter description:

Field Name Field description Types of Required Remarks
status   string AND -
message   string AND -
data   string AND -
transferList   string AND -
departStation   string AND -
arriveStation   string AND -
transferStation   string AND -
transferTakeTime   string AND -
showPriceText   string AND -
trainTransferInfos   string AND -
sequence   string AND -
trainNo   string AND -
trainNumber   string AND -
departStationPy   string AND -
arriveStationPy   string AND -
departDate   string AND -
departTime   string AND -
arriveDate   string AND -
arriveTime   string AND -
isStartStation   string AND -
isEndStation   string AND -
runTime   string AND -
preSaleTime   string AND -
takeDays   string AND -
isBookable   string AND -
seatList   string AND -
seatName   string AND -
showSeatName   string AND -
price   string AND -
orderPrice   string AND -
inventory   string AND -
inventoryStr   string AND -
buttonDisplayName   string AND -
buttonType   string AND -
curSeatIndex   string AND -
totalRuntime   string AND -
totalRuntimeValue   string AND -
index   string AND -
tagList   string AND -
extendInfo   string AND -
departStationList   string AND -
endStationList   string AND -
departStationFilterMap   string AND -
endStationFilterMap   string Y -
departCityName   string Y -
arriveCityName   string Y -
gtMinPrice   string Y -

Guess you like

Origin blog.csdn.net/qq_36664772/article/details/108254039