火车票的查询接口(1)

火车票查询:

查询1: 获取所有火车:时间,从,去 GET /otn/leftTicket/queryT?leftTicketDTO.train_date=2015-02-16&leftTicketDTO.from_station=SZQ&leftTicketDTO.to_station=WHN&purpose_codes=ADULT HTTP/1.1

查询2: 获取某量火车的线路:火车车次,从,去,时间 GET /otn/czxx/queryByTrainNo?train_no=6i000G100405&from_station_telecode=IOQ&to_station_telecode=WHN&depart_date=2015-02-16 HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; 
_jc_save_toDate=2015-01-16; _jc_save_wfdc_flag=dc Connection keep-alive
{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{"data":[{"start_station_name":"深圳北","arrive_time":"---
-","station_train_code":"G1004","station_name":"深圳北","train_class_name":"高速","service_type":"2","start_time":"08:26","stopover_time":"---
-","end_station_name":"武汉","station_no":"01","isEnabled":true},{"arrive_time":"08:43","station_name":"虎门","start_time":"08:45","stopover_time":"2分
钟","station_no":"02","isEnabled":true},{"arrive_time":"09:02","station_name":"广州南","start_time":"09:07","stopover_time":"5分
钟","station_no":"03","isEnabled":true},{"arrive_time":"10:24","station_name":"郴州西","start_time":"10:26","stopover_time":"2分
钟","station_no":"04","isEnabled":true},{"arrive_time":"11:00","station_name":"衡阳东","start_time":"11:02","stopover_time":"2分
钟","station_no":"05","isEnabled":true},{"arrive_time":"11:43","station_name":"长沙南","start_time":"11:49","stopover_time":"6分
钟","station_no":"06","isEnabled":true},{"arrive_time":"12:22","station_name":"岳阳东","start_time":"12:24","stopover_time":"2分
钟","station_no":"07","isEnabled":true},{"arrive_time":"12:54","station_name":"咸宁北","start_time":"12:56","stopover_time":"2分
钟","station_no":"08","isEnabled":true},{"arrive_time":"13:22","station_name":"武汉","start_time":"13:22","stopover_time":"---
-","station_no":"09","isEnabled":true}]},"messages":[],"validateMessages":{}}
查询3: 所有火车余票查询:时间,从,去 GET /otn/lcxxcx/query?purpose_codes=ADULT&queryDate=2015-02-16&from_station=SZQ&to_station=WHN HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; 
_jc_save_toDate=2015-01-16; _jc_save_wfdc_flag=dc Connection keep-alive
{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{"datas":
[{"train_no":"65000K424000","station_train_code":"K4240","start_station_telecode":"SZQ","start_station_name":"深
圳","end_station_telecode":"WCN","end_station_name":"武昌","from_station_telecode":"SZQ","from_station_name":"深
圳","to_station_telecode":"WCN","to_station_name":"武
昌","start_time":"04:20","arrive_time":"20:56","day_difference":"0","train_class_name":"","lishi":"16:36","canWebBuy":"N","lishiValue":"996","yp_info":
"101525000010152530002028550000","control_train_day":"20991231","start_train_date":"20150216","seat_feature":"W31323","yp_ex":"101020","train_seat_feat
ure":"3","seat_types":"112","location_code":"Q7","from_station_no":"01","to_station_no":"03","control_day":19,"sale_time":"0930","is_support_card":"0",
"note":"1月28日<br/>9点30分起

查询4 要查询某辆车在哪两个站点之间的余票得先查询两个站点之间所有的车次再选择自己的车次
带硬座的余票查询 GET /otn/lcxxcx/query?purpose_codes=ADULT&queryDate=2015-02-16&from_station=SZQ&to_station=WHN HTTP/1.1 JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; current_captcha_type=C; 
_jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; _jc_save_toDate=2015-01-16; 
_jc_save_wfdc_flag=dc
查询4.1 余票查询:时间,从,去 (Request-Line) GET /otn/lcxxcx/query?purpose_codes=ADULT&queryDate=2015-02-16&from_station=SZQ&to_station=WHN HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; _jc_save_toDate=; 
_jc_save_wfdc_flag=dc; _jc_save_czxxcx_toStation=%u6DF1%u5733%2CSZQ; _jc_save_czxxcx_fromDate=2015-02-16 Connection keep-alive

查询5 票价查询:时间,从,去,ASULT (Request-Line) GET /otn/leftTicketPrice/query?leftTicketDTO.train_date=2015-02-
16&leftTicketDTO.from_station=SZQ&leftTicketDTO.to_station=WHN&purpose_codes=ADULT&randCode=dyhb HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; _jc_save_toDate=; 
_jc_save_wfdc_flag=dc Connection keep-alive
查询5.1 票价查询:车次,从01,到02,座位类型,时间 (Request-Line) GET /otn/leftTicket/queryTicketPrice?train_no=63000T83520E&from_station_no=01&to_station_no=02&seat_types=11&train_date=2015-02-16 
HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u5E7F%u5DDE%u5357%2CIZQ; _jc_save_toStation=%u5E7F%u5DDE%u5317%2CGBQ; _jc_save_fromDate=2015-02-16; 
_jc_save_toDate=; _jc_save_wfdc_flag=dc; _jc_save_czxxcx_toStation=%u6DF1%u5733%2CSZQ; _jc_save_czxxcx_fromDate=2015-02-16 Connection keep-alive
查询6 车站车次查询,可以返回车站进出站的列车:时间,车站名称,车站代码,randCode=t6wg (Request-Line) GET /otn/czxx/query?train_start_date=2015-01-16&train_station_name=%E6%B7%B1%E5%9C%B3&train_station_code=SZQ&randCode=t6wg HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; _jc_save_toDate=; 
_jc_save_wfdc_flag=dc; _jc_save_czxxcx_toStation=%u6DF1%u5733%2CSZQ; _jc_save_czxxcx_fromDate=2015-01-16 Connection keep-alive

火车票的查询接口(1)

火车票查询:

查询1: 获取所有火车:时间,从,去 GET /otn/leftTicket/queryT?leftTicketDTO.train_date=2015-02-16&leftTicketDTO.from_station=SZQ&leftTicketDTO.to_station=WHN&purpose_codes=ADULT HTTP/1.1

查询2: 获取某量火车的线路:火车车次,从,去,时间 GET /otn/czxx/queryByTrainNo?train_no=6i000G100405&from_station_telecode=IOQ&to_station_telecode=WHN&depart_date=2015-02-16 HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; 
_jc_save_toDate=2015-01-16; _jc_save_wfdc_flag=dc Connection keep-alive
{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{"data":[{"start_station_name":"深圳北","arrive_time":"---
-","station_train_code":"G1004","station_name":"深圳北","train_class_name":"高速","service_type":"2","start_time":"08:26","stopover_time":"---
-","end_station_name":"武汉","station_no":"01","isEnabled":true},{"arrive_time":"08:43","station_name":"虎门","start_time":"08:45","stopover_time":"2分
钟","station_no":"02","isEnabled":true},{"arrive_time":"09:02","station_name":"广州南","start_time":"09:07","stopover_time":"5分
钟","station_no":"03","isEnabled":true},{"arrive_time":"10:24","station_name":"郴州西","start_time":"10:26","stopover_time":"2分
钟","station_no":"04","isEnabled":true},{"arrive_time":"11:00","station_name":"衡阳东","start_time":"11:02","stopover_time":"2分
钟","station_no":"05","isEnabled":true},{"arrive_time":"11:43","station_name":"长沙南","start_time":"11:49","stopover_time":"6分
钟","station_no":"06","isEnabled":true},{"arrive_time":"12:22","station_name":"岳阳东","start_time":"12:24","stopover_time":"2分
钟","station_no":"07","isEnabled":true},{"arrive_time":"12:54","station_name":"咸宁北","start_time":"12:56","stopover_time":"2分
钟","station_no":"08","isEnabled":true},{"arrive_time":"13:22","station_name":"武汉","start_time":"13:22","stopover_time":"---
-","station_no":"09","isEnabled":true}]},"messages":[],"validateMessages":{}}
查询3: 所有火车余票查询:时间,从,去 GET /otn/lcxxcx/query?purpose_codes=ADULT&queryDate=2015-02-16&from_station=SZQ&to_station=WHN HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; 
_jc_save_toDate=2015-01-16; _jc_save_wfdc_flag=dc Connection keep-alive
{"validateMessagesShowId":"_validatorMessage","status":true,"httpstatus":200,"data":{"datas":
[{"train_no":"65000K424000","station_train_code":"K4240","start_station_telecode":"SZQ","start_station_name":"深
圳","end_station_telecode":"WCN","end_station_name":"武昌","from_station_telecode":"SZQ","from_station_name":"深
圳","to_station_telecode":"WCN","to_station_name":"武
昌","start_time":"04:20","arrive_time":"20:56","day_difference":"0","train_class_name":"","lishi":"16:36","canWebBuy":"N","lishiValue":"996","yp_info":
"101525000010152530002028550000","control_train_day":"20991231","start_train_date":"20150216","seat_feature":"W31323","yp_ex":"101020","train_seat_feat
ure":"3","seat_types":"112","location_code":"Q7","from_station_no":"01","to_station_no":"03","control_day":19,"sale_time":"0930","is_support_card":"0",
"note":"1月28日<br/>9点30分起

查询4 要查询某辆车在哪两个站点之间的余票得先查询两个站点之间所有的车次再选择自己的车次
带硬座的余票查询 GET /otn/lcxxcx/query?purpose_codes=ADULT&queryDate=2015-02-16&from_station=SZQ&to_station=WHN HTTP/1.1 JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; current_captcha_type=C; 
_jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; _jc_save_toDate=2015-01-16; 
_jc_save_wfdc_flag=dc
查询4.1 余票查询:时间,从,去 (Request-Line) GET /otn/lcxxcx/query?purpose_codes=ADULT&queryDate=2015-02-16&from_station=SZQ&to_station=WHN HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; _jc_save_toDate=; 
_jc_save_wfdc_flag=dc; _jc_save_czxxcx_toStation=%u6DF1%u5733%2CSZQ; _jc_save_czxxcx_fromDate=2015-02-16 Connection keep-alive

查询5 票价查询:时间,从,去,ASULT (Request-Line) GET /otn/leftTicketPrice/query?leftTicketDTO.train_date=2015-02-
16&leftTicketDTO.from_station=SZQ&leftTicketDTO.to_station=WHN&purpose_codes=ADULT&randCode=dyhb HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; _jc_save_toDate=; 
_jc_save_wfdc_flag=dc Connection keep-alive
查询5.1 票价查询:车次,从01,到02,座位类型,时间 (Request-Line) GET /otn/leftTicket/queryTicketPrice?train_no=63000T83520E&from_station_no=01&to_station_no=02&seat_types=11&train_date=2015-02-16 
HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u5E7F%u5DDE%u5357%2CIZQ; _jc_save_toStation=%u5E7F%u5DDE%u5317%2CGBQ; _jc_save_fromDate=2015-02-16; 
_jc_save_toDate=; _jc_save_wfdc_flag=dc; _jc_save_czxxcx_toStation=%u6DF1%u5733%2CSZQ; _jc_save_czxxcx_fromDate=2015-02-16 Connection keep-alive
查询6 车站车次查询,可以返回车站进出站的列车:时间,车站名称,车站代码,randCode=t6wg (Request-Line) GET /otn/czxx/query?train_start_date=2015-01-16&train_station_name=%E6%B7%B1%E5%9C%B3&train_station_code=SZQ&randCode=t6wg HTTP/1.1 Host kyfw.12306 User-Agent Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 Accept */* Accept-Language zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding gzip, deflate If-Modified-Since 0 Cache-Control no-cache X-Requested-With XMLHttpRequest Referer Cookie JSESSIONID=ADBEC8A6FA06DF6D205684013959E86D; BIGipServerportal=3067347210.16671.0000; BIGipServerotn=1608057098.64545.0000; 
current_captcha_type=C; _jc_save_fromStation=%u6DF1%u5733%2CSZQ; _jc_save_toStation=%u6B66%u6C49%2CWHN; _jc_save_fromDate=2015-02-16; _jc_save_toDate=; 
_jc_save_wfdc_flag=dc; _jc_save_czxxcx_toStation=%u6DF1%u5733%2CSZQ; _jc_save_czxxcx_fromDate=2015-01-16 Connection keep-alive