ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified utilities Safety 4/5

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.

Why use this skill?

Query China Railway 12306 for train schedules, ticket availability, and station info. Automate your train travel planning with real-time data.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/kirorab/12306
Or

What This Skill Does

The 12306 skill for OpenClaw provides a direct interface to China Railway's official booking API, enabling users to effortlessly search for train schedules, ticket availability, and station information. By leveraging automated scripts, the agent can parse complex travel data and present it as clean HTML reports or raw JSON, making it an essential tool for travel planning within China. Whether you need to filter by high-speed train categories, check specific departure time windows, or find trains with remaining seat inventory, this skill automates the tedious process of manual querying on the official website.

Installation

To integrate this skill into your environment, use the OpenClaw command-line interface. Run the following command in your terminal to fetch the necessary scripts and dependencies:

clawhub install openclaw/skills/skills/kirorab/12306

Ensure that you have Node.js installed in your environment, as the skill executes JavaScript-based modules to interact with the API. Once installed, the skill will automatically manage station caching, ensuring that frequently accessed station metadata is kept up-to-date locally for seven days.

Use Cases

This skill is perfect for professionals, commuters, and travelers who require real-time updates on China's massive rail network. Use it to:

  • Quickly verify if a high-speed G-train is available for a last-minute business trip.
  • Compare travel durations between various train types to optimize your schedule.
  • Filter specific seating classes like business class or soft sleepers for overnight journeys.
  • Obtain programmatic access to travel data for building custom travel dashboards or automated alert systems.

Example Prompts

  1. "I need to go from Beijing to Shanghai on March 1st. Can you show me all available high-speed G-trains?"
  2. "Find me a morning train from Shanghai to Hangzhou departing between 6:00 and 12:00 that has second-class seats available."
  3. "Check if there are any trains from Shenzhen to Changsha arriving before 6:00 PM today."

Tips & Limitations

  • Data Accuracy: The tool fetches data directly from the 12306 API, providing the most current information available.
  • Flexibility: You can combine filters; for example, use the --type and --max-duration flags simultaneously to narrow down your optimal commute.
  • Customization: By default, reports are saved to the {baseDir}/data/ folder, but you can redirect output to any preferred path using the -o flag.
  • Station Matching: The tool is robust and handles both city-wide name searches and specific station names, which are automatically cached locally to reduce network overhead.

Metadata

Author@kirorab
Stars1776
Views0
Updated2026-03-02
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-kirorab-12306": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#travel#railway#ticketing#automation#china
Safety Score: 4/5

Flags: network-access, file-write, file-read, external-api, code-execution