Joooook/12306-skill

This is a 12306 ticket search agent skill.

Python

49

2 commits

updated Mar 9, 2026

See the code

README

12306-skill

基于 Python 的 12306 查询 Skill,在对话中调用。支持站点查询、直达余票查询、中转查询、车次经停查询。

🚩Features

功能状态
查询城市下全部车站编码✅
查询城市代表站编码✅
查询站名对应编码✅
查询站点详情✅
查询直达余票(筛选/排序/限制)✅
查询中转余票(支持指定中转站)✅
查询车次经停信息✅

⚙️Requirements

  • Python 3.10+
  • 依赖:requests

安装依赖:

pip install requests

▶️Quick Start

在当前 Skill 目录执行:

python scripts/12306_apis.py list-tools
python scripts/12306_apis.py get-current-date
python scripts/12306_apis.py get-stations-code-in-city --city "北京"
python scripts/12306_apis.py get-tickets --date "2026-03-09" --from_station "北京" --to_station "上海" --train_filter_flags "G" --format text

💡Notes

  • date 参数格式必须是 YYYY-MM-DD,且不能早于当天(按 Asia/Shanghai 计算)。
  • 缓存文件 scripts/stations.json 与 scripts/lcquery_path 默认缓存 1 天。
  • 建议优先使用筛选参数(如 train_filter_flags、limited_num)减少输出长度。

☕️Donate

请我喝杯奶茶吧。

12306
agentskills
skill
tickets

Joooook/12306-skill

This is a 12306 ticket search agent skill.

Python

49

2 commits

updated Mar 9, 2026

See the code

README

12306-skill

基于 Python 的 12306 查询 Skill,在对话中调用。支持站点查询、直达余票查询、中转查询、车次经停查询。

🚩Features

功能状态
查询城市下全部车站编码✅
查询城市代表站编码✅
查询站名对应编码✅
查询站点详情✅
查询直达余票(筛选/排序/限制)✅
查询中转余票(支持指定中转站)✅
查询车次经停信息✅

⚙️Requirements

  • Python 3.10+
  • 依赖:requests

安装依赖:

pip install requests

▶️Quick Start

在当前 Skill 目录执行:

python scripts/12306_apis.py list-tools
python scripts/12306_apis.py get-current-date
python scripts/12306_apis.py get-stations-code-in-city --city "北京"
python scripts/12306_apis.py get-tickets --date "2026-03-09" --from_station "北京" --to_station "上海" --train_filter_flags "G" --format text

💡Notes

  • date 参数格式必须是 YYYY-MM-DD,且不能早于当天(按 Asia/Shanghai 计算)。
  • 缓存文件 scripts/stations.json 与 scripts/lcquery_path 默认缓存 1 天。
  • 建议优先使用筛选参数(如 train_filter_flags、limited_num)减少输出长度。

☕️Donate

请我喝杯奶茶吧。

12306
agentskills
skill
tickets