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. 火车票/余票/经停站/中转换乘.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/ai4mse/trainclawWhat 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:
- Routine Commute Planning: Quickly finding high-speed trains between major metropolitan hubs with specific departure constraints.
- Route Auditing: Verifying the full list of stops and arrival/departure times for a specific train code to ensure connectivity.
- Complex Journey Planning: Calculating optimal transfer points when direct trains are unavailable or fully booked.
- Data Integration: Exporting travel schedules into JSON or CSV formats for use in external personal dashboards or travel expense tracking systems.
Example Prompts
- "Check for G-series high-speed train tickets from Beijing to Shanghai for tomorrow morning, and sort the results by the shortest travel time."
- "What are all the stops for G1033 departing today?"
- "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 jsonwhen piping output to other software, or use the default-o textfor 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
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-ai4mse-trainclaw": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, file-write, file-read
Related Skills
flyclaw (Flight N-in-1 Search Zero Login)
Multi-source flight aggregation — tickets, nonstop, round-trip, cabin. 航班机票/零登录/零API, zero login, zero account, zero API key. Pure Python, no browser. 机票价格/航班动态/直飞筛选.
navclaw
Smart driving — exhaustive route search, may outperform default navigation. 导航/自驾/极限避堵, dozens of routes. One-tap iOS/Android deep link. Supports 高德/Amap. 智能避堵,极限搜索绕行方案,一键跳转手机导航APP.