12306 API guide

kyfw.12306.cn

Use 12306 to check train departures, seat availability, and fares by class, and review in-progress ticket orders.

Actions and inputs

trains

List departures and seat availability by class.

Inputs origin, destination, travel date, optional limit

train

Show stops, arrival and departure times, and stopover durations for a train segment.

Inputs train ID, origin, destination, travel date

price

Show fares in CNY by seat class for a train segment.

Inputs train ID, origin, destination, travel date

orders

View in-progress ticket orders for your signed-in account.

Saved passengers

Create

Add an authorized traveler to your account's passenger list, subject to 12306 identity verification.

Inputs Traveler consent and identity details entered through the official site

Read

Review your saved passengers and their verification status without displaying full identity numbers.

Inputs Signed-in account and optional passenger selection

Update

Update editable passenger details without altering verified identity records or existing tickets.

Inputs Passenger selection and permitted field changes

Delete

Remove a saved passenger if 12306 allows it; this does not cancel any tickets.

Inputs Passenger selection and confirmation