Search link format

For search links, partners will provide a search-specific base URL (see Partner Configuration). We support the following query parameters:

Field Name Details
from_stop_id

(Repeatable) Identifier of the stops at which the trip may start.

The values of the stop_ids of the departure stations.

to_stop_id

(Repeatable) Identifier of the stops at which the trip may end.

The values of the stop_ids of the destination stations.

search_date

(Date) Service day of the trip.

This field contains the date with the following format string:

YYYYMMDD

lang

(IETF BCP 47, Optional) Field used to indicate the selected language of the booking site.

The value of this field conforms to IETF BCP 47, e.g. en-US.

If the selected language is not available or the field is not passed, the booking site should use a fallback language.

cur

(ISO 4217, Optional) Field used to indicate the currency that prices should be displayed in.

The value of this field conforms to ISO 4217, e.g. USD.

If the selected currency cannot be shown or the field is not passed, the booking site should use a fallback currency.

utm_source

(String, Optional) Field used to indicate the high-level site that sent the traffic.

Possible values are google_search and google_maps.

All repeatable parameters are specified as a JSON array. For from_stop_id and to_stop_id, multiple values represent multiple stations at the origin and destination localities.

Examples

In this example, the user queries for trains from locality1 to locality2:

  • locality1 maps to stations with stop_ids f1 and f2.
  • locality2 maps to stations with stop_ids t1 and t2.
  • The service date is 20190716.

For this example, the base URL is https://example.com.

Given all of this information, use the following values for the parameters:

Field name Details
from_stop_id ["f1", "f2"]
to_stop_id ["t1", "t2"]
service_date 20190716

The following is the final URI after encoding:

https://example.com?from_stop_id=%5B%22f1%22,%22f2%22%5D&to_stop_id=%5B%22t1%22,%22t2%22%5D&search_date=20190716

In the landing page, the user will be able to view itineraries departing from stations f1 and f2 on 20190716 and arriving at t1 and t2. All station combinations are supported:

  • From f1 to t1
  • From f1 to t2
  • From f2 to t1
  • From f2 to t2