Query China Railway 12306 train tickets (direct + transfer) with remaining seats, prices, and route (stops). Use when the user asks to check train availability/remaining seats/prices or wants to see a train’s stop list. Low-volume queries only; NOT for purchasing, login, captcha, or high-frequency scraping.
station_name.js parsing.python3 scripts/update_stations.py
Examples:
python3 scripts/query_tickets.py --date 2026-03-01 --from 上海 --to 杭州
python3 scripts/query_tickets.py --from 上海 --to 杭州 # date omitted → defaults to tomorrow
python3 scripts/query_tickets.py --date 2026-03-01 --from SHH --to HGH
python3 scripts/query_tickets.py --date 2026-03-01 --from 上海虹桥 --to 杭州东 --purpose ADULT --limit 15
Use this when the user asks “经停/途经哪些站”.
# If you know the train code
python3 scripts/query_route_stations.py --date 2026-03-01 --from 北京朝阳 --to 锦州南 --train-code K4409
# If you already have train_no
python3 scripts/query_route_stations.py --date 2026-03-01 --from 北京朝阳 --to 锦州南 --train-no 24000K44090U
python3 scripts/query_transfer.py --date 2026-02-25 --from 密云 --to 锦州 --limit 10
python3 scripts/query_transfer.py --date 2026-02-25 --from 密云 --to 锦州 --middle 承德南 --limit 10
scripts/stations.py --search and ask a clarification.python3 scripts/update_stations.py.