Search train solutions (SSE stream)

Initiate a train search and stream normalised solutions back as Server-Sent Events. Each data: event is a JSON-encoded train solution object. The stream ends with event: done.

The party is passengers (anonymous seat counts per age band) plus travelers (selected people by userId). Each named traveler's own saved railcard — the signed-in traveler's or a colleague's — is applied to that traveler's seat and carried through the inbound search, fare search, and fare build; book the colleague with passengers[].colleagueId to apply it on the booking. Anonymous seats carry no railcard. Guests cannot name travelers (422).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

POST body for /v1/trains/search.

itinerary
array of objects
required
length ≥ 1

One leg for one-way, two for round-trip, more for multi-leg.

Itinerary*
passengers
object

Anonymous seat counts per age band (no railcards).

travelers
array of objects
length ≤ 9

Selected travelers, one seat each. Each traveler's own saved railcard is applied to their seat.

Travelers
enum

Preferred travel class. Fares not matching this class are suppressed by Mercury when travelClass is also provided to /trains/fares.

enum

Booking profile context. personal for non-business bookings, business for business bookings.

Responses

401

Missing or invalid authentication

422

Invalid search parameters

503

Train search provider unavailable

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/event-stream