Skip to content

Trip forecast

(TRIAS TripInfoRequest)

The trip forecast is an Open Service. It is described in VDV 431 TripInfoRequest.

New Interface (TRIAS2020): The new interface has been extended to resemble the powerful new OJP protocol. You may continue using your existing API access key with the new URL

Technical description

In order to use the trip forecast a JourneyRef must be known. Unfortunately, this cannot be simply derived from the timetable (timetables available via the Timetable overview). The simplest way to generate the JourneyRef is by querying one of the other APIs (TripRequest or the arrival and departure display).

Key concepts

  • Stops: Use DiDok or stop datasets from other sources.
  • Journeys: A journey involves transporting customers along a particular route, according to a particular timetable connection, by a particular means of transport, at a particular time, in a particular direction.
  • Timetable: A timetable determines the progress of a means of transport in public short- and long-distance passenger traffic and in railway freight traffic. The information required for this includes train numbers, days of operation, routes, arrival, departure and passing times at the stops, as well as permissible speeds in individual sections of the route.
  • Forecasts: Forecasts concern a train’s running times in the future, which are calculated based on the train’s current location. This also takes into account conflicts and their currently intended settlements in the next x minutes. A less elaborate method is used to calculate future values of the forecast.
  • Means of transport (VM): Either used synonymously with vehicles (train, boat, tram, bus) from different carriers or in the sense of a “transport system” (public transport etc.).
  • DateTime in Response: It is always based on Zulu time (i.e. UTC). That means, you have to add two hours in summer and one hour in winter.

Technical aspects

API Explorer

Authorisation and Open Services

An API keyword is required to access this API. It can be obtained via the Developer Portal. The token must also be sent in the HTTP header as “Authorization”.

Access URL

API: https://api.opentransportdata.swiss/trias2020

Test-Key: 57c5dbbbf1fe4d000100001842c323fa9ff44fbba0b9b925f0c052d1

With the Authorization header and Content type= “text/XML” or “application/XML”

Authorization header

Sample request

The request is transferred as body.

Explanatory notes on the elements of the request

Relevant elements in the request:

Name Mandatory? Description Example
JourneyRef Yes(*) The JourneyRef must be generated or obtained from another source. odp:01012::H:j16:30441
OperatingDayRef No Day of operation. If no day of operation is specified, the current day of operation is used 2020-04-02T
Params No Further parameters … see table below

(*) VDV 431 features requests regarding VehicleRef and TimeOfOperation. They should not be used, TRIAS  does not use VehicleRef.

Params – further parameters:

Name Mandatory? Description Example
UseTimetabledDataOnly No Determines whether information about days of operation is to be output in the result. Boolean. Default is false. false
IncludeCalls No Determines whether the stops in the journey are to be output in the result. Boolean. Default is true.

This parameter is ignored. The system always uses true.

IncludePosition No Determines whether the current position of the means of transport is to be output in the result. Boolean. Default is true.

This parameter is ignored. The system always uses true.

IncludeService No Determines whether transport information about the journey is to be output in the result. Default is true. true
Extension No No extensions implemented

 

Explaining a response

The response has the following basic structure:

 

The key elements of the response can be found in TripInfoResultStructure:

Name Mandatory? Description Example
PreviousCall No/multiple Stops already served. Also includes the current stop if the journey is exactly at a stop. Structure of its own … see table below
CurrentPosition No Current position of the vehicle

Is not implemented.

OnwardCall No/multiple The stops still ahead in the journey Structure of its own … see table below
Service No Traffic details Structure of its own … see further below
OperatingDays No Days of operation for this route

Not implemented

OperatingDaysDescription No Machine-readable description of days of operation, e.g. “Monday to Friday” or “Sunday and public holidays”.

Not implemented

 

PreviousCall and OnwardCall have the following structure:

Name Mandatory? Description Example
StopPointRef  Yes  Reference to a code for a stop. 857000
StopPointName  Yes Name of the stop for passenger information.

NB: Language is always DE.

 

PlannedBay No Name of the platform/stop where passengers must board or alight from the vehicle (when used along with specific route information; if a general name is specified in StopPointName, it is similar to the stop name). According to plan status.

EstimatedBay No Name of the platform/stop where passengers must board or alight from the vehicle (when used along with specific route information; if a general name is specified in StopPointName, it is similar to the stop name). According to last forecast.

 

ServiceArrival  No  Arrival times

 

TimetabledTime Yes Timetabled arrival time

Always in Zulu time

2020-04-02T11:20:00Z
RecordedAtTime No Actual arrival time

Is not used

EstimatedTime No Estimated arrival time

Only if real-time data is available

In the case of sections of the journey in the past, the last forecast or actual data applies.

Currently, actual data are deleted just after departure.

2020-04-02T11:20:00Z
ServiceDeparture  No  Departure time Analogous to SeviceArrival
StopSequenceNumber Yes  Sequence number of stop 4
DemandStop No Stop on request only. The vehicle only services this stop if asked in advance. Boolean Not available
UnplannedStop No Stop not foreseen by the timetable. Boolean TODO: In discussion
NotServicedStop No Cancelled stops TODO: Example
SituationFullRef No, multiple Reference to a failure message. This message can be found in the response’s ResponseContext be retrieved in another way. Not available

Service

The “Service” structure is described here: Service (VDV 431)

Errors/Problems

The response will contain an “ErrorMessage” if there were problems executing the request:

Comments

IMPORTANT: External developers should be aware of the following points:

Further information