Do you mean in the Unified API or in the user interface?
In the Unified API, a Leg object looks like the following (to keep this concise, I’ve used empty objects and arrays for properties that aren’t relevant to this):
{
"$type": "Tfl.Api.Presentation.Entities.JourneyPlanner.Leg, Tfl.Api.Presentation.Entities",
"duration": 1,
"instruction": {},
"obstacles": [],
"departureTime": "2023-06-09T08:16:00",
"arrivalTime": "2023-06-09T08:17:00",
"departurePoint": {},
"arrivalPoint": {},
"path": {},
"routeOptions": [],
"mode": {},
"disruptions": [],
"plannedWorks": [],
"isDisrupted": false,
"hasFixedLocations": true,
"scheduledDepartureTime": "2023-06-09T08:15:00",
"scheduledArrivalTime": "2023-06-09T08:16:00"
}
Note that there are two sets of timestamps. scheduledDepartureTime
and scheduledArrivalTime
are always the scheduled departure and arrival timestamps for that leg, without being affected by live data.
departureTime
and arrivalTime
, on the other hand, are affected by live data. If live data is available, they will reflect that data. If live data is not available, however, they will fall back on schedule data and be equal to scheduledDepartureTime
and scheduledArrivalTime
.
That said, from this data, it’s not currently possible to tell whether a given leg is using live data or not. If departureTime
is different to scheduledDepartureTime
or arrivalTime
is different to scheduledArrivalTime
, then you can tell. However, if the bus/train is running exactly on time, you won’t be able to tell if the timestamps are based on live data or not.
Would anyone find it useful for us to provide a flag to tell you whether live data is being used or not? If there is any interest, please let me know.
As for the user interface (UI), we have explored this quite extensively. Of course, we show the live data in the UI where available, but we don’t currently indicate that it is live data. So far we haven’t found a good way to indicate this. We did have the idea that if a bus is running late, we could provide some kind of indicator of that. However, for high frequency bus routes, passengers don’t tend to care if a bus is running late or not – it’s the frequency of service that’s important. There’s little point in confusing users by saying their bus is running late if it doesn’t actually make any difference to them. In some cases, a late-running bus would actually be beneficial to a given user (because they may be able to catch a bus they’d have otherwise missed).
Although we could simply add some sort of “Live” indicator in the UI, we don’t want to confuse users into thinking that the time will automatically update on their screen. The live times in Journey Planner are only live at the time that the journey is calculated, so calling them “live” in the UI could be deceptive.
TfL Go now has a feature where if you plan a journey, you may see a “Live buses at this stop” button that takes you to the live arrivals board for that stop. This is more the kind of information we would describe as “live” in the UI, because it updates on your screen. In the future, we would like to integrate this display of automatically updating information into Journey Planner a bit more seamlessly.