{"id":17141025,"url":"https://github.com/0xhjk/x12306","last_synced_at":"2026-02-26T05:54:39.454Z","repository":{"id":57429891,"uuid":"170074336","full_name":"0xHJK/x12306","owner":"0xHJK","description":"12306查票助手，一键查询沿途所有站点，先上车后补票，让你的出行更省心。","archived":false,"fork":false,"pushed_at":"2024-07-01T09:17:01.000Z","size":1037,"stargazers_count":43,"open_issues_count":3,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-22T09:23:21.479Z","etag":null,"topics":["12306","12306buyticket","12306helper","12306qiang-piao","crawler","fk12306","helper","reqeusts","spider","ticket","train","x12306"],"latest_commit_sha":null,"homepage":"https://github.com/0xHJK/x12306","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xHJK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-11T05:42:44.000Z","updated_at":"2025-09-19T14:41:55.000Z","dependencies_parsed_at":"2024-01-26T02:26:51.361Z","dependency_job_id":"379839ab-ca06-41df-b8fd-59d6eec796ad","html_url":"https://github.com/0xHJK/x12306","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":0.06451612903225812,"last_synced_commit":"8b8af6ff1ee3e132bb63f8d8ca3c46c31c876a1f"},"previous_names":["0xhjk/x12306","0xhjk/fk12306"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/0xHJK/x12306","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xHJK%2Fx12306","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xHJK%2Fx12306/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xHJK%2Fx12306/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xHJK%2Fx12306/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xHJK","download_url":"https://codeload.github.com/0xHJK/x12306/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xHJK%2Fx12306/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29849811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"online","status_checked_at":"2026-02-26T02:00:06.774Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["12306","12306buyticket","12306helper","12306qiang-piao","crawler","fk12306","helper","reqeusts","spider","ticket","train","x12306"],"created_at":"2024-10-14T20:24:07.960Z","updated_at":"2026-02-26T05:54:39.417Z","avatar_url":"https://github.com/0xHJK.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# x12306\n\n12306查票助手，主要功能是可以一键查询沿途所有站点。\n\n当全程票售罄的时候，方便查询中间站点余票，先上车后补票。\n\n工具仅用于查询余票，不支持购票，建议在12306官方平台购票。\n\n仅支持Python3，推荐Python3.7+\n\n**⚠️短时间内多次查询可能会被屏蔽，可以过一会再查询**\n\n**如果对你有帮助，可以请我喝一杯咖啡 \u003chttps://hjk.im/donate\u003e**\n\n## 安装运行\n\npip安装\n```bash\npip install x12306\n```\n\n手动安装：\n```bash\ngit clone https://github.com/0xHJK/x12306\ncd x12306 \u0026\u0026 make install\n```\n\n不安装直接运行：\n```bash\ngit clone https://github.com/0xHJK/x12306\ncd x12306\npython3 x12306.py -f \u003c出发地\u003e -t \u003c目的地\u003e -d \u003cYYYY-MM-DD\u003e\n```\n\n## 使用说明\n\n示例\n\n```bash\n# 查询2024年5月1日，上海到北京的车票\npython3 x12306.py -f 上海 -t 北京 -d \"2024-05-01\"\n\n# 查询2024年5月1日，上海到北京的车票，只看有余票\npython3 x12306.py -f 上海 -t 北京 -d \"2024-05-01\" -r\n\n# 查询2024年5月1日，上海到北京的车票，只看动车高铁\npython3 x12306.py -f 上海 -t 北京 -d \"2024-05-01\" --gcd\n\n# 查询2024年5月1日，上海到北京的车票，只看普速火车\npython3 x12306.py -f 上海 -t 北京 -d \"2024-05-01\" --ktz\n\n# 查询2024年5月1日，上海到北京的车票，只看特定车次\npython3 x12306.py -f 上海 -t 北京 -d \"2024-05-01\" -n \"G26 G28\"\n\n# 查询2024年5月1日，上海到北京的车票，只看商务座和一等座\npython3 x12306.py -f 上海 -t 北京 -d \"2024-05-01\" -s \"商务座 一等座\" -r\n\n# 查询2024年5月1日，上海到北京的车票，并查询上海出发沿途所有车站是否有票\npython3 x12306.py -f 上海 -t 北京 -d \"2024-05-01\" -z -r\n```\n\n帮助\n\n```bash\n$ python x12306.py --help\nUsage: x12306.py [OPTIONS]\n\n  12306查票助手 https://github.com/0xHJK/x12306\n\n  Usage: python3 x12306.py -f \u003c出发地\u003e -t \u003c目的地\u003e -d \u003cYYYY-MM-DD\u003e\n\n  Example: python3 x12306.py -f 上海 -t 北京 -d \"2024-05-01\"\n\nOptions:\n  --version                Show the version and exit.\n  -f, --from-station TEXT  出发地\n  -t, --to-station TEXT    目的地\n  -d, --date TEXT          日期\n  -s, --seats TEXT         限制座位，如：一等座 二等座 无座\n  -n, --trains-no TEXT     限制车次，如：G1 G2 G3\n  -z, --zmode              高级模式，查询中间站点\n  -zz, --zzmode            终极模式，查询所有中间站点\n  -r, --remaining          只看有票\n  -v, --verbose            调试模式\n  --gcd                    只看高铁动车城际\n  --ktz                    只看普快特快直达等\n  --proxies-file TEXT      代理列表文件\n  --stations-file TEXT     站点信息文件\n  --cdn-file TEXT          CDN文件\n  --help                   Show this message and exit.\n```\n\n\n![](https://github.com/0xHJK/x12306/raw/master/docs/preview.png)\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=0xHJK/x12306\u0026type=Date)](https://star-history.com/#0xHJK/x12306\u0026Date)\n\n## LICENSE\n\n[MIT License](https://github.com/0xHJK/x12306/blob/master/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xhjk%2Fx12306","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xhjk%2Fx12306","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xhjk%2Fx12306/lists"}