Skip to content
cccskills
FreePublished on GitHub

12306

Query China Railway 12306 for train schedules, remaining tickets, and station info. Use when user asks about train/高铁/火车 tickets, schedules, or availability within China.

The English summary is being prepared. Showing the original description.

See how to install

Files included (4)

  • SKILL.md2.8 KB
  • data/stations.json777.5 KB
  • scripts/query.mjs12.6 KB
  • scripts/stations.mjs3.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

12306 Train Query

Query train schedules and remaining tickets from China Railway 12306. Output is an HTML file.

Query Tickets

node {baseDir}/scripts/query.mjs <from> <to> [options]

The command prints the output file path to stdout and query info to stderr.

Examples

# All trains from Beijing to Shanghai (defaults to today)
node {baseDir}/scripts/query.mjs 北京 上海

# Specify a date
node {baseDir}/scripts/query.mjs 北京 上海 -d 2026-03-01

# Only high-speed trains (G)
node {baseDir}/scripts/query.mjs 北京 上海 -t G

# Morning departures, 2h max, with second class available
node {baseDir}/scripts/query.mjs 上海 杭州 -t G --depart 06:00-12:00 --max-duration 1h --seat ze

# Only bookable trains arriving before 6pm
node {baseDir}/scripts/query.mjs 深圳 长沙 --available --arrive -18:00

# Custom output path
node {baseDir}/scripts/query.mjs 广州 武汉 -o /tmp/tickets.html

# JSON output (to stdout)
node {baseDir}/scripts/query.mjs 广州 武汉 --json

Options

  • -d, --date <YYYY-MM-DD>: Travel date (default: today)
  • -t, --type <G|D|Z|T|K>: Filter train types (combinable, e.g. GD)
  • --depart <HH:MM-HH:MM>: Depart time range (e.g. 08:00-12:00, 18:00-)
  • --arrive <HH:MM-HH:MM>: Arrive time range (e.g. -18:00, 14:00-20:00)
  • --max-duration <duration>: Max travel time (e.g. 2h, 90m, 1h30m)
  • --available: Only show bookable trains
  • --seat <types>: Only show trains with tickets for given seat types (comma-separated: swz,zy,ze,rw,dw,yw,yz,wz)
  • -o, --output <path>: Output HTML file path (default: {baseDir}/data/<from>-<to>-<date>.html)
  • --json: Output raw JSON to stdout

Output Columns

ColumnMeaning
商务/特等Business class / Premium (swz)
一等座First class (zy)
二等座Second class (ze)
软卧/动卧Soft sleeper / Bullet sleeper (rw/dw)
硬卧Hard sleeper (yw)
硬座Hard seat (yz)
无座Standing (wz)

Values: number = remaining seats, 有 = available (qty unknown), — = not applicable

Station Lookup

node {baseDir}/scripts/stations.mjs 杭州
node {baseDir}/scripts/stations.mjs 香港西九龙

Notes

  • Data comes directly from 12306 official API (no key needed)
  • Station data is cached for 7 days in {baseDir}/data/stations.json
  • Supports city names (resolves to main station) or exact station names
  • Works for all train types: G (高铁), D (动车), Z (直达), T (特快), K (快速)

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

name: 4d-compression-core version: 1.0.2 description: "把长内容压缩成结构化向量——节省 60-80% Token,保留核心信息" metadata: { "openclaw": { "emoji": "🌀", "requires": { "bins": ["jq", "awk"] }, "triggers": ["压缩", "4d",...

The English summary is being prepared. Showing the original description.

modbender/skill-library-mcp17Updated Sep 28, 2026

Use cheap, TEE-verified AI models from the 0G Compute Network as OpenClaw providers. Discover available models and compare pricing vs OpenRouter, verify provider integrity via hardware attestation (Intel TDX), manage your 0G wallet and sub-accounts, and configure models in OpenClaw with one workflow. Supports DeepSeek, GLM-5, Qwen, and other models available on the 0G marketplace.

The English summary is being prepared. Showing the original description.

modbender/skill-library-mcp17Updated Sep 28, 2026

Send and receive P2P messages using disposable numbers and PINs. No servers, no accounts. Use for human notifications, approval flows, and agent-to-agent communication.

The English summary is being prepared. Showing the original description.

modbender/skill-library-mcp17Updated Sep 28, 2026

Query historical crypto market data from 0xArchive across Hyperliquid, Lighter.xyz, and HIP-3. Covers orderbooks, trades, candles, funding rates, open interest, liquidations, and data quality. Use when the user asks about crypto market data, orderbooks, trades, funding rates, or historical prices on Hyperliquid, Lighter.xyz, or HIP-3.

The English summary is being prepared. Showing the original description.

modbender/skill-library-mcp17Updated Sep 28, 2026

0xwork

Free

Find and complete paid tasks on the 0xWork decentralized marketplace (Base chain, USDC escrow). Use when: the agent wants to earn money/USDC by doing work, discover available tasks, claim a bounty, submit deliverables, check earnings or wallet balance, or set up as a 0xWork worker. Task categories: Writing, Research, Social, Creative, Code, Data. NOT for: posting tasks (use the website), managing the 0xWork platform, or frontend development.

The English summary is being prepared. Showing the original description.

modbender/skill-library-mcp17Updated Sep 28, 2026

Patterns and practices that dramatically accelerate development velocity. Covers parallel execution, automation, feedback loops, workflow optimization, and anti-pattern avoidance. Use when starting projects, planning sprints, optimizing workflows, or onboarding developers.

The English summary is being prepared. Showing the original description.

modbender/skill-library-mcp17Updated Sep 28, 2026

See all skills by modbender

Report a problem with this skill