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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/kirorab/12306What 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
- "I need to go from Beijing to Shanghai on March 1st. Can you show me all available high-speed G-trains?"
- "Find me a morning train from Shanghai to Hangzhou departing between 6:00 and 12:00 that has second-class seats available."
- "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
--typeand--max-durationflags 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-oflag. - 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
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-kirorab-12306": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, file-write, file-read, external-api, code-execution
Related Skills
serpapi-flights
Query Google Flights via SerpApi for flight schedules, prices, and cabin class info. Use when user asks about flight/机票/航班 prices, schedules, or comparisons.
flights
Query flight offers (price, schedule, availability) via Amadeus API. Use when user asks about flight/机票/航班 prices, schedules, or availability.
md-table-image
Render markdown tables as PNG images. Use whenever you need to send a table in chat — render it as an image instead of raw markdown text.