China Train Prices and Schedules API

China Train Prices and Schedules API

Be able to retrieve the status of future train travels and their estimated prices. Also, check the schedule of a given train.

API description

About the API:

This API will provide information about ticket prices and future schedules for a given train number. 

 

What this API receives and what your API provides (input/output)?

 

You will be able to search for train tickets based on your queries. Select the origin station, the destination, and the date and get all the possible prices for that journey. 

Also, be able to receive a timetable for a selected train. Be able to recognize the arrival and departure schedule for that train. 

 

What are the most common uses cases of this API?

 

This API will allow you to get information about the train schedules. You will be able to create an app to provide your users with information about train timetables and possible ticket prices. 

This API is ideal for travel agencies that want to provide additional information to the users. 

Also, be able to recognize what could be the estimated arrival for a given train. 

 

Are there any limitations to your plans?

Besides API call limitations per month, there are no other limitations. 

API Documentation

Endpoints


Search trains tickets by Departure city, Arrival city, and the date.

Return ticket prices, duration times, departure time, and arrival time. 



                                                                            
GET https://zylalabs.com/api/446/china+train+prices+and+schedules+api/343/search+train+tickets
                                                                            
                                                                        

Search Train Tickets - Endpoint Features
Object Description
depCityEN [Required] departure station name
arrCityEN [Required] arrival station name
depDate [Required] Format YYYY-MM-DD. Departure date, no earlier than current date
Test Endpoint

API EXAMPLE RESPONSE

       
                                                                                                        
                                                                                                                                                                                                                            {"Status":"200","DepDate":"2022-10-13","TrainList":[{"TrainNo":"K21","BooAvailable":"true","DepStationCN":"","DepStationEN":"Beijing West","ArrStationCN":"","ArrStationEN":"Guilin North","DepTime":"08:18","ArrTime":"12:49","Duration":"28h31m","ServiceFee":"","PaperTicket":"0","SeatList":[{"SeatCN":"","SeatEN":"Soft Sleeper","PriceRMB":701.92,"PriceWB":108,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"Hard Sleeper","PriceRMB":457.96,"PriceWB":71,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"Hard Seat","PriceRMB":236.0,"PriceWB":37,"Num":"31","BooBook":"true"}],"DepDaysMemo":null},{"TrainNo":"G529","BooAvailable":"true","DepStationCN":"","DepStationEN":"Beijing West","ArrStationCN":"","ArrStationEN":"Guilin North","DepTime":"08:34","ArrTime":"17:01","Duration":"8h27m","ServiceFee":"","PaperTicket":"0","SeatList":[{"SeatCN":"","SeatEN":"Second Class Seat","PriceRMB":804.0,"PriceWB":124,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"First Class Seat","PriceRMB":1286.5,"PriceWB":198,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"Business Class Seat","PriceRMB":2523.0,"PriceWB":389,"Num":"31","BooBook":"true"}],"DepDaysMemo":null},{"TrainNo":"G421","BooAvailable":"true","DepStationCN":"","DepStationEN":"Beijing West","ArrStationCN":"","ArrStationEN":"Guilin North","DepTime":"09:05","ArrTime":"19:38","Duration":"10h33m","ServiceFee":"","PaperTicket":"0","SeatList":[{"SeatCN":"","SeatEN":"Second Class Seat","PriceRMB":804.0,"PriceWB":124,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"First Class Seat","PriceRMB":1286.5,"PriceWB":198,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"Business Class Seat","PriceRMB":2523.0,"PriceWB":389,"Num":"31","BooBook":"true"}],"DepDaysMemo":null},{"TrainNo":"Z5","BooAvailable":"true","DepStationCN":"","DepStationEN":"Beijing West","ArrStationCN":"","ArrStationEN":"Guilin North","DepTime":"16:09","ArrTime":"11:23","Duration":"19h14m","ServiceFee":"","PaperTicket":"0","SeatList":[{"SeatCN":"","SeatEN":"Soft Sleeper","PriceRMB":701.92,"PriceWB":108,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"Hard Sleeper","PriceRMB":457.96,"PriceWB":71,"Num":"31","BooBook":"true"}],"DepDaysMemo":null},{"TrainNo":"K157","BooAvailable":"true","DepStationCN":"","DepStationEN":"Beijing West","ArrStationCN":"","ArrStationEN":"Guilin North","DepTime":"18:12","ArrTime":"21:20","Duration":"27h8m","ServiceFee":"","PaperTicket":"0","SeatList":[{"SeatCN":"","SeatEN":"Soft Sleeper","PriceRMB":701.92,"PriceWB":108,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"Hard Sleeper","PriceRMB":457.96,"PriceWB":71,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"Hard Seat","PriceRMB":236.0,"PriceWB":37,"Num":"31","BooBook":"true"}],"DepDaysMemo":null},{"TrainNo":"Z285","BooAvailable":"true","DepStationCN":"","DepStationEN":"Beijing West","ArrStationCN":"","ArrStationEN":"Guilin North","DepTime":"21:08","ArrTime":"16:17","Duration":"19h9m","ServiceFee":"","PaperTicket":"0","SeatList":[{"SeatCN":"","SeatEN":"Soft Sleeper","PriceRMB":701.92,"PriceWB":108,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"Hard Sleeper","PriceRMB":457.96,"PriceWB":71,"Num":"31","BooBook":"true"},{"SeatCN":"","SeatEN":"Hard Seat","PriceRMB":236.0,"PriceWB":37,"Num":"31","BooBook":"true"}],"DepDaysMemo":null}]}
                                                                                                                                                                                                                    
                                                                                                    

Search Train Tickets - CODE SNIPPETS


curl --location --request GET 'https://zylalabs.com/api/446/china+train+prices+and+schedules+api/343/search+train+tickets?depCityEN=beijing&arrCityEN=guilin&depDate=2022-10-13' --header 'Authorization: Bearer YOUR_API_KEY' 

    

Retrieve a schedule of a given train. Be able to know when its arriving to different stations in between of its journey. 



                                                                            
GET https://zylalabs.com/api/446/china+train+prices+and+schedules+api/344/get+train+timetable
                                                                            
                                                                        

Get Train TimeTable - Endpoint Features
Object Description
sTrainNo [Required] Train number
Test Endpoint

API EXAMPLE RESPONSE

       
                                                                                                        
                                                                                                                                                                                                                            {"Status":"200","TimeTable":[{"TrainNo":"G529","StationNo":"1","StationNameEN":"Beijing West","StationNameCN":"北京西","ArriveTime":"08:34","StartTime":"08:34","StopTime":"0min"},{"TrainNo":"G529","StationNo":"2","StationNameEN":"Shijiazhuang","StationNameCN":"石家庄","ArriveTime":"09:41","StartTime":"09:47","StopTime":"6min"},{"TrainNo":"G529","StationNo":"3","StationNameEN":"Zhengzhou East","StationNameCN":"郑州东","ArriveTime":"11:10","StartTime":"11:14","StopTime":"4min"},{"TrainNo":"G529","StationNo":"4","StationNameEN":"Wuhan","StationNameCN":"武汉","ArriveTime":"12:57","StartTime":"13:03","StopTime":"6min"},{"TrainNo":"G529","StationNo":"5","StationNameEN":"Changsha South","StationNameCN":"长沙南","ArriveTime":"14:21","StartTime":"14:24","StopTime":"3min"},{"TrainNo":"G529","StationNo":"6","StationNameEN":"Guilin North","StationNameCN":"桂林北","ArriveTime":"17:02","StartTime":"17:05","StopTime":"3min"},{"TrainNo":"G529","StationNo":"7","StationNameEN":"Liuzhou","StationNameCN":"柳州","ArriveTime":"18:17","StartTime":"18:21","StopTime":"4min"},{"TrainNo":"G529","StationNo":"8","StationNameEN":"Nanning East","StationNameCN":"南宁东","ArriveTime":"19:26","StartTime":"19:45","StopTime":"19min"},{"TrainNo":"G529","StationNo":"9","StationNameEN":"Beihai","StationNameCN":"北海","ArriveTime":"20:59","StartTime":"20:59","StopTime":"0min"}]}
                                                                                                                                                                                                                    
                                                                                                    

Get Train TimeTable - CODE SNIPPETS


curl --location --request GET 'https://zylalabs.com/api/446/china+train+prices+and+schedules+api/344/get+train+timetable?sTrainNo=G529' --header 'Authorization: Bearer YOUR_API_KEY' 

    

API Access Key & Authentication

After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the China Train Prices and Schedules API REST API, simply include your bearer token in the Authorization header.

Headers

Header Description
Authorization [Required] Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.


Simple Transparent Pricing

No long term commitments. One click upgrade/downgrade or cancellation. No questions asked.

🚀 Enterprise
Starts at $10,000/Year

  • Custom Volume
  • Dedicated account manager
  • Service-level agreement (SLA)

Customer favorite features

  • ✔︎ Only Pay for Successful Requests
  • ✔︎ Free 7-Day Trial
  • ✔︎ Multi-Language Support
  • ✔︎ One API Key, All APIs.
  • ✔︎ Intuitive Dashboard
  • ✔︎ Comprehensive Error Handling
  • ✔︎ Developer-Friendly Docs
  • ✔︎ Postman Integration
  • ✔︎ Secure HTTPS Connections
  • ✔︎ Reliable Uptime

Zyla API Hub is, in other words, an API MarketPlace. An all-in-one solution for your developing needs. You will be accessing our extended list of APIs with only your user. Also, you won't need to worry about storing API keys, only one API key for all our products is needed.

Prices are listed in USD. We accept all major debit and credit cards. Our payment system uses the latest security technology and is powered by Stripe, one of the world’s most reliable payment companies. If you have any trouble with paying by card, just contact us at [email protected]

Sometimes depending on the bank's fraud protection settings, a bank will decline the validation charge we make when we attempt to be sure a card is valid. We recommend first contacting your bank to see if they are blocking our charges. If more help is needed, please contact [email protected] and our team will investigate further

Prices are based on a recurring monthly subscription depending on the plan selected — plus overage fees applied when a developer exceeds a plan’s quota limits. In this example, you'll see the base plan amount as well as a quota limit of API requests. Be sure to notice the overage fee because you will be charged for each additional request.

Zyla API Hub works on a recurring monthly subscription system. Your billing cycle will start the day you purchase one of the paid plans, and it will renew the same day of the next month. So be aware to cancel your subscription beforehand if you want to avoid future charges.

Just go to the pricing page of that API and select the plan that you want to upgrade to. You will only be charged the full amount of that plan, but you will be enjoying the features that the plan offers right away.

Yes, absolutely. If you want to cancel your plan, simply go to your account and cancel on the Billing page. Upgrades, downgrades, and cancellations are immediate.

You can contact us through our chat channel to receive immediate assistance. We are always online from 9 am to 6 pm (GMT+1). If you reach us after that time, we will be in contact when we are back. Also you can contact us via email to [email protected]

 Service Level
100%
 Response Time
4,049ms

Useful links:


Category:


Tags:


Related APIs