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

trainclaw

3-in-1 China 12306 query — tickets, route stops, transfer plans. Zero login. Filter 高铁/动车/火车 by type, time, duration. Pure Python, text/json/csv output. 火车票/余票/经停站/中转换乘.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/ai4mse/trainclaw
Or

What This Skill Does

TrainClaw is a powerful AI-driven railway assistant designed to provide seamless access to 12306 Chinese railway data. It functions as a command-line interface tool capable of querying real-time ticket availability, detailing route stop-overs for specific train numbers, and generating complex transit plans for long-distance travel. The skill excels in parsing natural language requests into structured API queries, allowing users to filter by train types (e.g., G-series high-speed rail, D-series bullet trains), define specific time windows for departure, and sort results by travel duration or departure time. Whether you need a quick availability check or a complex multi-leg journey plan, TrainClaw provides formatted outputs in text, JSON, or CSV to suit both human readability and programmatic needs.

Installation

To integrate TrainClaw into your OpenClaw ecosystem, execute the following command in your terminal:

clawhub install openclaw/skills/skills/ai4mse/trainclaw

Ensure you have Python 3.8+ and the requests library installed on your system. Upon the first execution, the tool will automatically download and cache essential railway station data locally to ensure rapid response times for future queries.

Use Cases

TrainClaw is ideal for commuters, travelers, and developers needing railway data. Common use cases include:

  1. Routine Commute Planning: Quickly finding high-speed trains between major metropolitan hubs with specific departure constraints.
  2. Route Auditing: Verifying the full list of stops and arrival/departure times for a specific train code to ensure connectivity.
  3. Complex Journey Planning: Calculating optimal transfer points when direct trains are unavailable or fully booked.
  4. Data Integration: Exporting travel schedules into JSON or CSV formats for use in external personal dashboards or travel expense tracking systems.

Example Prompts

  1. "Check for G-series high-speed train tickets from Beijing to Shanghai for tomorrow morning, and sort the results by the shortest travel time."
  2. "What are all the stops for G1033 departing today?"
  3. "I need to get from Shenzhen to Lhasa by train; please provide me with 5 possible transfer options."

Tips & Limitations

  • Date Constraints: The skill is restricted to querying tickets for the current day and the upcoming 15-day window as per 12306 railway regulations.
  • Efficiency: The tool uses a local cache for station data to optimize performance; ensure the cache/ directory remains accessible.
  • Format Flexibility: Use -o json when piping output to other software, or use the default -o text for direct interaction within your chat window.
  • Network Dependence: An active internet connection is required to fetch real-time ticket statuses from the railway servers.

Metadata

Author@ai4mse
Stars4473
Views2
Updated2026-05-01
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-ai4mse-trainclaw": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#travel#train#12306#productivity#transport
Safety Score: 4/5

Flags: network-access, file-write, file-read