12306列车查询API接口对接 高铁动车查询接口文档

该接口提供全国火车票车次查询, 站到站查询接口。
比如您查询"济南"到"北京", 接口会返回所有济南到北京的列车, 慢车、动车、高铁都会有, 但是不会出现票价, 适合做出行规划。

请求方式:GET

接口地址:
http://apia.yikeapi.com/train/

请求示例
http://apia.yikeapi.com/train/?start_station=烟台&stop_station=青岛&appid=43656176&appsecret=I42og6Lm

请求参数说明:

参数名 必选 类型 说明 备注(示例)
appid string 用户appid 注册开发者账号
appsecret string 用户appsecret
start_station string 出发站 示例: 烟台
stop_station string 终点站 示例: 青岛

响应JSON

{
    "errcode":0,
    "errmsg":"success",
    "api":"yikeapi.com",
    "usetime":0.10343503952026367,
    "list":[
        {
            "train_id":"16019",//列车编号,根据此编号查询列车详情
            "station_train_code":"C6520",//列车名称
            "train_from_station":"烟台",//列车始发站
            "train_to_station":"青岛",//列车终点站
            "from_station":"烟台",//出发站
            "to_station":"青岛",//到达站
            "start_time_unix":1642544460,
            "start_time":"06:21",//出发时间
            "stop_time":"08:12",//到达时间
            "day_diff":0//是否跨日, 0:否 1是
        },
        {
            "train_id":"9861",
            "station_train_code":"D2926",
            "train_from_station":"荣成",
            "train_to_station":"上海虹桥",
            "from_station":"烟台南",
            "to_station":"青岛西",
            "start_time_unix":1642546560,
            "start_time":"06:56",
            "stop_time":"08:53",
            "day_diff":0
        },
        {
            "train_id":"8173",
            "station_train_code":"D2138",
            "train_from_station":"烟台",
            "train_to_station":"上海虹桥",
            "from_station":"烟台",
            "to_station":"青岛西",
            "start_time_unix":1642548840,
            "start_time":"07:34",
            "stop_time":"09:41",
            "day_diff":0
        },
        {
            "train_id":"21837",
            "station_train_code":"C6552",
            "train_from_station":"荣成",
            "train_to_station":"青岛北",
            "from_station":"烟台南",
            "to_station":"青岛北",
            "start_time_unix":1642549080,
            "start_time":"07:38",
            "stop_time":"08:40",
            "day_diff":0
        },
        {
            "train_id":"3346",
            "station_train_code":"G5588",
            "train_from_station":"威海",
            "train_to_station":"曲阜东",
            "from_station":"烟台南",
            "to_station":"青岛北",
            "start_time_unix":1642551960,
            "start_time":"08:26",
            "stop_time":"09:44",
            "day_diff":0
        },
        {
            "train_id":"4535",
            "station_train_code":"G1850",
            "train_from_station":"烟台",
            "train_to_station":"长沙南",
            "from_station":"烟台",
            "to_station":"青岛西",
            "start_time_unix":1642556640,
            "start_time":"09:44",
            "stop_time":"11:35",
            "day_diff":0
        },
        {
            "train_id":"4880",
            "station_train_code":"G2684",
            "train_from_station":"威海",
            "train_to_station":"兰州西",
            "from_station":"烟台南",
            "to_station":"青岛西",
            "start_time_unix":1642558560,
            "start_time":"10:16",
            "stop_time":"11:57",
            "day_diff":0
        },
        {
            "train_id":"20773",
            "station_train_code":"C6546",
            "train_from_station":"烟台",
            "train_to_station":"青岛北",
            "from_station":"烟台",
            "to_station":"青岛北",
            "start_time_unix":1642558560,
            "start_time":"10:16",
            "stop_time":"11:23",
            "day_diff":0
        },
        {
            "train_id":"8746",
            "station_train_code":"D6050",
            "train_from_station":"烟台",
            "train_to_station":"青岛北",
            "from_station":"烟台",
            "to_station":"青岛北",
            "start_time_unix":1642559520,
            "start_time":"10:32",
            "stop_time":"11:40",
            "day_diff":0
        },
        {
            "train_id":"21440",
            "station_train_code":"C6508",
            "train_from_station":"荣成",
            "train_to_station":"青岛",
            "from_station":"烟台南",
            "to_station":"青岛",
            "start_time_unix":1642571760,
            "start_time":"13:56",
            "stop_time":"15:40",
            "day_diff":0
        },
        {
            "train_id":"20506",
            "station_train_code":"C6544",
            "train_from_station":"威海",
            "train_to_station":"青岛",
            "from_station":"烟台南",
            "to_station":"青岛",
            "start_time_unix":1642573680,
            "start_time":"14:28",
            "stop_time":"15:50",
            "day_diff":0
        },
        {
            "train_id":"8744",
            "station_train_code":"D6046",
            "train_from_station":"烟台",
            "train_to_station":"青岛",
            "from_station":"烟台",
            "to_station":"青岛",
            "start_time_unix":1642573980,
            "start_time":"14:33",
            "stop_time":"16:29",
            "day_diff":0
        },
        {
            "train_id":"3344",
            "station_train_code":"G5584",
            "train_from_station":"威海",
            "train_to_station":"曲阜东",
            "from_station":"烟台南",
            "to_station":"青岛西",
            "start_time_unix":1642575600,
            "start_time":"15:00",
            "stop_time":"16:39",
            "day_diff":0
        },
        {
            "train_id":"9863",
            "station_train_code":"D2930",
            "train_from_station":"威海",
            "train_to_station":"上海虹桥",
            "from_station":"烟台南",
            "to_station":"青岛西",
            "start_time_unix":1642577340,
            "start_time":"15:29",
            "stop_time":"17:06",
            "day_diff":0
        },
        {
            "train_id":"3348",
            "station_train_code":"G5592",
            "train_from_station":"烟台",
            "train_to_station":"菏泽东",
            "from_station":"烟台",
            "to_station":"青岛西",
            "start_time_unix":1642577760,
            "start_time":"15:36",
            "stop_time":"17:18",
            "day_diff":0
        },
        {
            "train_id":"21438",
            "station_train_code":"C6504",
            "train_from_station":"荣成",
            "train_to_station":"青岛",
            "from_station":"烟台南",
            "to_station":"青岛",
            "start_time_unix":1642585080,
            "start_time":"17:38",
            "stop_time":"19:17",
            "day_diff":0
        },
        {
            "train_id":"23007",
            "station_train_code":"C6582",
            "train_from_station":"威海",
            "train_to_station":"青岛北",
            "from_station":"烟台南",
            "to_station":"青岛北",
            "start_time_unix":1642586160,
            "start_time":"17:56",
            "stop_time":"18:58",
            "day_diff":0
        },
        {
            "train_id":"23009",
            "station_train_code":"C6588",
            "train_from_station":"威海",
            "train_to_station":"青岛",
            "from_station":"烟台南",
            "to_station":"青岛",
            "start_time_unix":1642586940,
            "start_time":"18:09",
            "stop_time":"20:01",
            "day_diff":0
        },
        {
            "train_id":"8768",
            "station_train_code":"D6092",
            "train_from_station":"烟台",
            "train_to_station":"青岛北",
            "from_station":"烟台",
            "to_station":"青岛北",
            "start_time_unix":1642589280,
            "start_time":"18:48",
            "stop_time":"20:00",
            "day_diff":0
        },
        {
            "train_id":"22804",
            "station_train_code":"C6578",
            "train_from_station":"烟台",
            "train_to_station":"青岛北",
            "from_station":"烟台",
            "to_station":"青岛北",
            "start_time_unix":1642592040,
            "start_time":"19:34",
            "stop_time":"20:54",
            "day_diff":0
        },
        {
            "train_id":"23945",
            "station_train_code":"C662",
            "train_from_station":"龙口市",
            "train_to_station":"青岛",
            "from_station":"烟台",
            "to_station":"青岛",
            "start_time_unix":1642593240,
            "start_time":"19:54",
            "stop_time":"22:11",
            "day_diff":0
        }
    ]
}

程序猿 发布于 2022-1-21 09:14

nohup 不输出log

执行守护程序,并且不输出log
nohup sh ./timer_hours.sh > /dev/null 2>&1 &


程序猿 发布于 2022-1-18 09:20

linux 定期删除文件夹下一周前的文件 + 定时任务

find ./ -mtime +5 -name "*.php" -exec rm -rf {} \;

find:linux的查找命令,用户查找指定条件的文件;
/data/wwwroot/log/:想要进行清理的任意目录;
-mtime:标准语句写法;
+30:查找30天前的文件,这里用数字代表天数;
".log":希望查找的数据类型,""表示查找所有文件
-exec:固定写法;
rm -rf:强制删除文件,包括目录;
{} \; :固定写法,一对大括号+空格++;


程序猿 发布于 2021-12-24 05:59

搜索