Google transit results schema - cloro

Google

Google transit results schema

Schema for Google’s train and bus block from the Google Search endpoint: route, fastest trip, cheapest fare, departures, and EU booking and transport sites.

The

Google Search endpoint

returns Google’s train and bus block, shown on queries for a route (“train tickets london to manchester”, “bus paris lyon”) and on some flight queries (“Consider taking the train”), as

result.transitResults

, on desktop and mobile, with no flag and at no extra cost.

transitResults

is omitted when the SERP has no transit block.

Values are text as Google shows them, in the language of the SERP (

06:29

,

5:10 am

,

2h 15m

,

0 changes

,

Ohne Umsteigen

). Google uses the same block for trains and buses, and the result does not say which.

departures

holds every departure the page has, in page order: the ones it shows, and the ones it shows only after a click (“N earlier trains”, “More options”, a closed booking site), with

expanded: false

.

Navigate to header: Layouts Layouts

Google shows the block in four layouts, and each returns the fields it shows. Each example below is the result for the page in its screenshot, shortened with

// …

.

Navigate to header: Route block Route block

On a train or bus query: a route form (

origin

,

destination

,

date

), a summary (

fastest

,

cheapest

,

dailyDepartures

) and the departures.

departures

has every departure of the day: the 3 the block shows, the earlier train and the ones under “More options”, with

expanded: false

.

Route block in Google Search

A response to

train tickets london to manchester

in the United Kingdom, on desktop:

{

"success"

:

true

,

"result"

: {

"transitResults"

: {

"title"

:

"Trains from London to Manchester"

,

"origin"

:

"Euston"

,

"destination"

:

"Manchester Piccadilly"

,

"date"

:

"Sat 24 Oct"

,

"fastest"

:

"2h 6m"

,

"cheapest"

: {

"value"

:

31

,

"currency"

:

"£"

,

"raw"

:

"£31"

},

"dailyDepartures"

:

49

,

"departures"

: [

{

"position"

:

1

,

"departureTime"

:

"00:39"

,

"arrivalTime"

:

"07:43"

,

"duration"

:

"7h 4m"

,

"changes"

:

"2 changes"

,

"price"

: {

"value"

:

80

,

"currency"

:

"£"

,

"raw"

:

"£80"

},

"operator"

:

"Multiple trains"

,

"expanded"

:

false

},

{

"position"

:

2

,

"departureTime"

:

"06:10"

,

"arrivalTime"

:

"08:59"

,

"duration"

:

"2h 49m"

,

"changes"

:

"1 change"

,

"price"

: {

"value"

:

32

,

"currency"

:

"£"

,

"raw"

:

"£32"

},

"operator"

:

"Multiple trains"

,

"expanded"

:

true

},

// …

{

"position"

:

49

,

"departureTime"

:

"21:01"

,

"arrivalTime"

:

"23:35"

,

"duration"

:

"2h 34m"

,

"changes"

:

"0 changes"

,

"price"

: {

"value"

:

75

,

"currency"

:

"£"

,

"raw"

:

"£75"

},

"operator"

:

"Avanti West Coast"

,

"expanded"

:

false

}

]

}

}

}

Navigate to header: Short block Short block

On some flight queries: a

title

(“Consider taking the train”) and the departures. A departure without a fare on the page (”—”) has no

price

.

Short block on a flight query in Google Search

flights london to paris

in the United Kingdom:

"transitResults"

: {

"title"

:

"Consider taking the train"

,

"departures"

: [

{

"position"

:

1

,

"departureTime"

:

"07:31"

,

"arrivalTime"

:

"10:59"

,

"duration"

:

"2h 28m"

,

"changes"

:

"0 changes"

,

"operator"

:

"Eurostar 9006"

,

"expanded"

:

true

},

{

"position"

:

2

,

"departureTime"

:

"10:31"

,

"arrivalTime"

:

"13:58"

,

"duration"

:

"2h 27m"

,

"changes"

:

"0 changes"

,

"price"

: {

"value"

:

289

,

"currency"

:

"£"

,

"raw"

:

"£289"

},

"operator"

:

"Eurostar 9018"

,

"expanded"

:

true

}

]

}

Navigate to header: EU route unit EU route unit

In the EU, a list of booking sites (Google, Trainline, Trip.com, …), each with its own summary and departures. The departures of every site come in one list, each with its

supplier

, as in the

EU places unit

: the site’s

fastest

and

cheapest

are in

supplier

. The transport websites next to the unit (the operators of the route) come as

websites

. No

origin

or

destination

.

EU route unit in Google Search: Google open, the other booking sites collapsed

train paris lyon

in France: Google’s 3 departures, open on the page, then those of the 6 other booking sites, 21 in all.

"transitResults"

: {

"title"

:

"Trains de Paris à Lyon"

,

"date"

:

"25 oct."

,

"dailyDepartures"

:

30

,

"departures"

: [

{

"position"

:

1

,

"departureTime"

:

"06:24"

,

"arrivalTime"

:

"08:40"

,

"duration"

:

"2h 16min"

,

"changes"

:

"0 changement"

,

"price"

: {

"value"

:

59

,

"currency"

:

"€"

,

"raw"

:

"59 €"

},

"operator"

:

"Trenitalia"

,

"expanded"

:

true

,

"supplier"

: {

"name"

:

"Google"

,

"expanded"

:

true

,

"domain"

:

"google.com"

,

"link"

:

"https://www.google.com/search?…"

,

"fastest"

:

"1h 53min"

,

"cheapest"

: {

"value"

:

59

,

"currency"

:

"€"

,

"raw"

:

"59 €"

}

}

},

// …

{

"position"

:

4

,

"departureTime"

:

"06:24"

,

"arrivalTime"

:

"08:40"

,

"duration"

:

"2h 16min"

,

"changes"

:

"0 changement"

,

"price"

: {

"value"

:

59

,

"currency"

:

"€"

,

"raw"

:

"59 €"

},

"operator"

:

"Trenitalia"

,

"expanded"

:

false

,

"supplier"

: {

"name"

:

"Trainline"

,

"expanded"

:

false

,

"domain"

:

"thetrainline.com"

,

"link"

:

"https://www.google.com/travel/clk/tr?pcurl=https://thetrainline.com&…"

,

"fastest"

:

"1h 53min"

,

"cheapest"

: {

"value"

:

59

,

"currency"

:

"€"

,

"raw"

:

"59 €"

}

}

}

// …

],

"websites"

: [

{

"operator"

:

"Trenitalia"

,

"price"

: {

"value"

:

59

,

"currency"

:

"€"

,

"raw"

:

"59 €"

},

"duration"

:

"2h 16min"

,

"changes"

:

"0 changement"

,

"link"

:

"https://www.google.com/travel/clk/tr?pcurl=http://www.trenitalia.com/&…"

}

// …

]

}

Navigate to header: EU schedule EU schedule

In the EU, a summary and the departures, without a route form or booking sites. Google shows the route and the date in one line of text under the title (“De Paris (Toutes les stations) à Nantes · sam. 24 oct.”), which is not returned: no

origin

,

destination

or

date

.

EU schedule in Google Search

paris nantes en train

in France:

"transitResults"

: {

"title"

:

"Trains de Paris à Nantes"

,

"fastest"

:

"1h 58min"

,

"cheapest"

: {

"value"

:

35

,

"currency"

:

"€"

,

"raw"

:

"35 €"

},

"dailyDepartures"

:

30

,

"departures"

: [

{

"position"

:

1

,

"departureTime"

:

"06:06"

,

"arrivalTime"

:

"09:50"

,

"duration"

:

"3h 44min"

,

"changes"

:

"1 changement"

,

"price"

: {

"value"

:

90

,

"currency"

:

"€"

,

"raw"

:

"90 €"

},

"operator"

:

"Plusieurs trains"

,

"expanded"

:

true

},

// …

{

"position"

:

3

,

"departureTime"

:

"07:12"

,

"arrivalTime"

:

"11:09"

,

"duration"

:

"3h 57min"

,

"changes"

:

"0 changement"

,

"price"

: {

"value"

:

59

,

"currency"

:

"€"

,

"raw"

:

"59 €"

},

"operator"

:

"OUIGO 4071"

,

"expanded"

:

true

}

]

}

Navigate to header: Transit results structure Transit results structure

All fields are included only when Google shows them.

Field Type Description
title string Heading of the block (“Trains from London to Manchester”, “Consider taking the train”)
origin string Origin in the route form, a station or a city (“Euston”, “London (all stations)“)
destination string Destination in the route form (“Manchester Piccadilly”)
date string Date of the departures as shown (“Sat 24 Oct”)
fastest string Duration of the fastest trip as shown (“2h 6m”). On the EU route unit, in each supplier
cheapest object Cheapest fare. See Price . On the EU route unit, in each supplier
dailyDepartures number Number of departures a day
departures array The departures, in page order. See below
websites array EU route unit: the transport websites, one per operator. See below

Navigate to header: Departure Departure

position

,

departureTime

,

arrivalTime

and

expanded

are always present.

Field Type Description
position number Position in page order (1-indexed), across the booking sites of the EU route unit
departureTime string Departure time as shown (“06:29”, “5:10 am”)
arrivalTime string Arrival time as shown
arrivalDayOffset number Days after the departure day, when the trip arrives on a later day ( 1 )
duration string Duration as shown (“2h 15m”)
changes string Changes as shown (“0 changes”, “1 change”)
price object Fare, or the low end of a fare range. See Price
maxPrice object High end of a fare range (“₹728 - ₹4,331”)
operator string Company or train as shown (“Avanti West Coast”, “Eurostar 9018”), or “Multiple trains”
expanded boolean true if the page shows the departure without a click
supplier object EU route unit: the booking site of the departure. See below

Navigate to header: Supplier Supplier

The booking site of a departure in the EU route unit, with its own summary: the fastest trip and the cheapest fare differ between sites.

name

and

expanded

are always present.

Field Type Description
name string Booking site ( "OMIO" )
expanded boolean true if this booking site is open on the page
domain string Booking site’s domain ( "omio.com" )
link string The booking site’s “See more on …” page
fastest string Duration of the fastest trip on this site as shown
cheapest object Cheapest fare on this site. See Price

Navigate to header: Website Website

Field Type Description
operator string Operator (“Trenitalia”)
price object Lowest fare. See Price
duration string Duration of that trip as shown
changes string Changes of that trip as shown
link string Google’s link to the operator’s site

Navigate to header: Price Price

value

,

currency

and

raw

are always present. A fare is returned only when its currency and its number parse.

Field Type Description
value number Numeric fare
currency string Currency symbol ( £ , € , ₹ )
raw string Fare text as shown ( "£38" )

Was this page helpful?

Ask a question...

Google Search endpoint

EU places unit

Navigate to header: Price

Navigate to header: Layouts

Navigate to header: Route block

Navigate to header: Short block

Navigate to header: EU route unit

Navigate to header: EU schedule

Navigate to header: Transit results structure

Navigate to header: Departure

Navigate to header: Supplier

Navigate to header: Website