Book Trains with AI: 12306 and Trainline Skills
Tutorial for using AI skills to search China Railway 12306 and Trainline schedules — train numbers, classes, durations, and cheapest fares across China, the UK, and Europe.
Tutorial for using AI skills to search China Railway 12306 and Trainline schedules — train numbers, classes, durations, and cheapest fares across China, the UK, and Europe.
China Railway's 12306 platform handles more than 5,000 high-speed departures every single day, and the booking site is famously hostile to anyone who does not read Chinese. Trainline, on the other hand, aggregates 270+ rail and coach carriers across the UK and Europe — but its results page hides the cheapest fare three filters deep. Two of the world's biggest rail networks, two completely different interfaces, and the same problem: finding the right train takes more clicking than it should.
This tutorial shows you how to skip the clicking entirely. Two free browser-automation skills in the aiskill.market Travel category drive these sites for you — you describe the route in plain English, the AI agent navigates the real website, and you get structured results back with train numbers, durations, seat classes, and prices. No login, no Chinese keyboard, no guessing which fare is actually the cheapest.
Rail booking sites are some of the hardest travel sites to automate. 12306.cn uses a Chinese-language interface, station names that must match its internal database exactly, and a date picker that rejects ambiguous input. Trainline layers a DataDome bot wall on top of a results page where the headline price is rarely the cheapest available fare.
A browser-automation skill solves both problems the same way: it loads the real site in a managed browser session, fills the form the way a human would, and reads the rendered results back as clean structured data. You never see the anti-bot challenge, the foreign-language labels, or the buried filters. You see train numbers and prices.
This is the core idea behind the 26 browse.sh travel skills now in the marketplace — each one wraps a single difficult travel site so an AI agent can use it reliably. The rail pair is the most useful example because rail interfaces are exactly where manual search breaks down.
The China Railway 12306 skill takes a simple instruction. You give it two stations and a date, and it queries the live 12306 schedule.
A good prompt looks like this:
"Find trains from Beijing to Shanghai on 3 July, and show me the high-speed options with second-class availability."
The agent resolves "Beijing" and "Shanghai" to the correct station codes, submits the schedule query, and returns each matching train with:
Because the skill reads availability per class, you can ask follow-ups like "which of those still has First class seats?" without re-running the whole search. It is read-only and needs no 12306 login, so it is the fastest way to scan the schedule before you commit to buying a ticket on the official site. China Railway's own English portal is also available at china-railway.com.cn if you want to verify a result manually.
The Trainline skill works the same way but returns price-led results, which fits the deregulated European rail market where the same journey can cost wildly different amounts depending on operator and fare type.
A good prompt looks like this:
"Look up trains from London to Paris on 12 July for two adults, cheapest and first-class fares."
The agent uses Trainline's clean public locations-search API to resolve the station names, then drives a stealth browser session to pull the results. For each journey option you get:
That cheapest-plus-first-class pairing is the whole point. On a London–Edinburgh route you might see a GBP 47 Advance fare next to a GBP 180 Anytime First fare for trains leaving 20 minutes apart — exactly the comparison Trainline's own UI makes you dig for. You can confirm any result directly at trainline.com.
| Feature | China Railway 12306 | Trainline |
|---|---|---|
| aiskill.market slug | china-railway-12306-find-trains | trainline-train-times-prices |
| Coverage | All of mainland China | UK + Europe rail and coach (270+ carriers) |
| Installs | 130 | 17 |
| Login required | No | No |
| Train number returned | Yes (G/D/C/K series etc.) | Yes (operator service) |
| Seat classes | Business / First / Second + sleepers | Standard + First (cheapest + first-class price) |
| Pricing | Per-class availability focus | Cheapest fare + first-class fare |
| Changes / connections | Shown per route | Number of changes per option |
| Anti-bot handling | Built in (no login flow) | DataDome stealth session |
| Read-only | Yes | Yes |
The split is intuitive once you see it. China's network is centrally operated, so the schedule and seat-class availability matter most. Europe's network is fragmented and competitive, so price comparison across operators matters most. Each skill returns what its network actually requires.
Rail rarely travels alone. A typical multi-leg trip mixes a train with a flight and a hotel, and the marketplace has skills for each leg. Once you have your train confirmed, the full 26-skill travel guide walks through how to chain them — search a flight into your departure city, book the train, then hold a car at the other end.
For the road portion of a trip, the AI car rental search guide covers Sixt, Avis, and Costco Travel skills that surface daily and long-term rates the same way these rail skills surface fares. And when you want to weigh a rail-plus-hotel package against an all-in alternative, the Expedia and Priceline comparison guide shows how AI can shortlist bundles across both platforms.
The pattern is consistent across all of them: describe the leg in plain English, let the agent drive the real site, get structured results, decide, and book on the official page yourself.
Use the China Railway 12306 skill. You ask in English — "trains from Guangzhou to Shenzhen tomorrow morning" — and the agent handles the Chinese-language interface, station-name matching, and date entry for you. It returns train numbers, times, durations, and seat availability in plain structured output, with no 12306 account needed.
No, and that is deliberate. Both the 12306 and Trainline skills are read-only: they search and extract data but stop before any purchase or payment. You review the results the agent returns, then complete the actual booking yourself on the official site. This keeps you in control of payment and passenger details.
Yes. For every journey option, the Trainline skill returns both the cheapest available fare and the first-class fare side by side, along with the operator, duration, and number of changes. That pairing lets you weigh a cheap Advance ticket against a flexible First fare without re-running the search.
The 12306 skill covers all of mainland China's rail network, including high-speed G/D/C-series trains and overnight sleeper services. The Trainline skill covers the UK and continental Europe across 270+ rail and coach carriers, including Eurostar, SNCF, Deutsche Bahn connections, and intercity coaches like FlixBus.
Yes. Both are free browser-automation skills in the aiskill.market Travel category, built on the browse.sh framework. You install the skill, give your AI agent the route, and it drives the live site. There is no subscription for the search itself — you only pay the carrier when you book.
Explore production-ready AI skills at aiskill.market/browse or submit your own skill to the marketplace.
Query China Railway (12306.cn) for the train schedule between two stations on a given date — train number, departure/arrival station + time, journey duration, and per-class seat availability.…
Query China Railway 12306 for train schedules, remaining tickets, and station info. Use when user asks about train/高铁/火车 tickets, schedules, or availability...
AI soul and personality tracing skill — gives your AI agent a consistent persona, tone, and conversational identity across all interactions. 319.2K installs.
Web design principles, accessibility standards, visual hierarchy, and responsive layout patterns for AI coding agents. 285.6K installs.