Understand the trip() response format
mainThe trip() method returns an object containing trip details, including line information, current location, origin, destination, and stopovers.
Key Timing Behavior:
Following the Friendly Public Transport Format v2 draft spec, the returned departure and arrival times include the current delay. The departureDelay and arrivalDelay fields express the difference between the actual time and the scheduled time.
Note on realtimeDataUpdatedAt: This field is currently returned but not populated in db-vendo-client because the upstream APIs do not provide it.
{
id: '1|31431|28|86|17122017',
direction: 'S Spandau',
line: {
type: 'line',
id: '18299',
fahrtNr: '12345',
name: 'S9',
// ...
},
currentLocation: {
type: 'location',
latitude: 52.447455,
longitude: 13.522464,
},
origin: {
type: 'station',
id: '900000260005',
name: 'S Flughafen Berlin-Schönefeld',
// ...
},
departure: '2017-12-17T18:37:00+01:00',
plannedDeparture: '2017-12-17T18:37:00+01:00',
departureDelay: null,
// ...
destination: {
type: 'station',
id: '900000029101',
name: 'S Spandau',
// ...
},
arrival: '2017-12-17T19:50:30+01:00',
plannedArrival: '2017-12-17T19:49:00+01:00',
arrivalDelay: 90,
// ...
stopovers: [ /* … */ ]
}