← Back to Skills Marketplace
kirorab

12306 Train Query

by kirorab · GitHub ↗ · v1.0.2
cross-platform ✓ Security Clean
3754
Downloads
8
Stars
38
Active Installs
3
Versions
Install in OpenClaw
/install 12306
Description
Query China Railway 12306 for train schedules, remaining tickets, and station info. Use when user asks about train/高铁/火车 tickets, schedules, or availability...
Usage Guidance
Before installing, expect the skill to contact official 12306 websites, send the stations and date you query to those services, cache station metadata locally, and create HTML output files by default. Use a specific output path only when you intend to write there, and review future updates because publisher provenance is limited.
Capability Analysis
Type: OpenClaw Skill Name: 12306 Version: 1.0.2 The skill bundle is a functional tool for querying China Railway 12306 train schedules and ticket availability. The code in `query.mjs` and `stations.mjs` interacts exclusively with official 12306 API endpoints (kyfw.12306.cn and www.12306.cn) and uses standard Node.js built-in modules for file I/O and network requests. There is no evidence of data exfiltration, malicious command execution, or prompt injection attempts in the documentation or scripts.
Capability Assessment
Purpose & Capability
The stated purpose is querying China Railway 12306 schedules, ticket availability, and station information; the scripts implement only that workflow.
Instruction Scope
The skill exposes user-directed Node CLI commands and a documented custom HTML output path, so it can write or overwrite the file path the user provides.
Install Mechanism
Installation is documented through the skills CLI and requires Node; the artifact shows no dependency installer, postinstall hook, or hidden setup, though the publisher is not a trusted @openclaw publisher.
Credentials
Network requests are limited to 12306 domains, with route, station, and travel-date parameters sent to those services; no credentials, environment secrets, broad local files, or unrelated endpoints are used.
Persistence & Privilege
The skill caches public station metadata for 7 days under its data directory and saves HTML query output by default, but shows no background service, privilege escalation, credential persistence, or autonomous execution.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install 12306
  3. After installation, invoke the skill by name or use /12306
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.2
- Added documentation file: README.md - Removed cached station data file: data/stations.json - Updated documentation to include new output format option (`-f, --format <html|md>`) for markdown table output - Clarified usage examples and output modes in the documentation
v1.0.1
# Changelog ## 1.0.1 ### EN - Query train schedules and remaining tickets from China Railway 12306 - Output as a clean HTML page (Apple-style design), saved to file - Station data uses official city mapping from 12306 (field `[7]`), no more regex guessing - Station cache with 7-day TTL, auto-refreshes from 12306 - Train type filter: G/D/Z/T/K, combinable (e.g. `GD`) - Time range filters: `--depart` and `--arrive` (e.g. `08:00-12:00`) - Duration filter: `--max-duration` (e.g. `2h`, `90m`, `1h30m`) - Availability filter: `--available` for bookable trains only - Seat type filter: `--seat` to show trains with specific seat availability (e.g. `ze,zy`) - Duration displayed as human-readable format (`1h30m` instead of `01:30`) - Color-coded train types: G blue, D green, Z purple, T orange, K grey - Color-coded seat availability: green = available, red = sold out, grey = N/A - JSON output mode with `--json` - Custom output path with `-o` ### 中文 - 查询中国铁路 12306 列车时刻表和余票信息 - 输出为简洁的 HTML 页面(Apple 风格设计),保存为文件 - 站点数据使用 12306 官方城市字段(`[7]`),不再用正则猜测城市名 - 站点缓存 7 天有效期,过期自动从 12306 刷新 - 车次类型筛选:G/D/Z/T/K,可组合(如 `GD`) - 时间范围筛选:`--depart` 和 `--arrive`(如 `08:00-12:00`) - 耗时筛选:`--max-duration`(如 `2h`、`90m`、`1h30m`) - 可购票筛选:`--available` 仅显示可购买的车次 - 座位类型筛选:`--seat` 按指定座位有票过滤(如 `ze,zy`) - 耗时显示为易读格式(`1h30m` 而非 `01:30`) - 车次类型颜色区分:G 蓝、D 绿、Z 紫、T 橙、K 灰 - 余票状态颜色区分:绿色有票、红色售罄、灰色不适用 - JSON 输出模式 `--json` - 自定义输出路径 `-o`
v1.0.0
Initial release: query train schedules, remaining tickets, station lookup from China Railway 12306
Metadata
Slug 12306
Version 1.0.2
License
All-time Installs 38
Active Installs 38
Total Versions 3
Frequently Asked Questions

What is 12306 Train Query?

Query China Railway 12306 for train schedules, remaining tickets, and station info. Use when user asks about train/高铁/火车 tickets, schedules, or availability... It is an AI Agent Skill for Claude Code / OpenClaw, with 3754 downloads so far.

How do I install 12306 Train Query?

Run "/install 12306" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 12306 Train Query free?

Yes, 12306 Train Query is completely free (open-source). You can download, install and use it at no cost.

Which platforms does 12306 Train Query support?

12306 Train Query is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 12306 Train Query?

It is built and maintained by kirorab (@kirorab); the current version is v1.0.2.

💬 Comments