New Here Getting Started

Hi new here.
Just been having a look at the feeds and have experience working with the Network Rail open data platform where you get a cif schedule file which lists all trains at a specific station on a specific date.

Now it seems this API is far from that.

I’ve had a look at StopPoint arrivals and that’s the sort of thing I’m after, but I have a few questions:

  • How can I specify extension to the timeframe displayed, IE plus one hour? So that a user can see further in the schedule ? I requested a timetable via the get timetable API but it doesn’t show booked services
  • Unless I’m missing something there is no Leading Car ID on the StopPoint arrivals API, only on PredictionsDetailed, but when I specify a line and station on PredictionsDetailed it doesn’t show anything about when a train is actually due? Departure Time seems to apply to the station the train is currently at, nothing about what station I’m getting Predictions for?

Would be great if anyone can point me in the right direction, I’m looking to create a departure board page for a given station and platform. Ideally thereafter as well, future call points for a specific service

Does anyone know which API I’m looking for? I’ve had a look but it seems I need bits of this and bits of that, stick it all together. Thanks

Hello and welcome to the forum!

The Arrivals endpoint will return all available predictions. For London Underground, this typically spans the next 30 minutes only, and is based on the distance between the train and the target station.

To access schedule information, you can query the API like so:
https://api.tfl.gov.uk/Line/jubilee/Timetable/940GZZLUSTD
You will then find the times by navigating timetableResponse->timetable->routes->schedules->knownJourneys.
Alternatively, you can download the timetables in bulk in TransXChange format using the Journey Planner timetables dataset.

With PredictionDetailed, you can use the SecondsTo attribute of the T (train) element to calculate the predicted arrival time, by adding it to the CurTime attribute of the S (station) element. Take the following example:

<S Code="BNK" Mess="" N="Bank." CurTime="10:17:46">
  <P N="Westbound - Platform 5" Num="5" TrackCode="TC4710" NextTrain="false">
    <T TrainId="1014724" LCID="37" SetNo="025" TripNo="5" SecondsTo="136" TimeTo="2:30" Location="At Liverpool Street" Destination="West Ruislip" InputDest="1001" DestCode="547" Order="0" ArrivalTime="" DepartTime="10:17:35" DepartInterval="136" Departed="0" Direction="0" IsStalled="0" TrackCode="TC5020" LN="C" LeadingCarNo="91283"/>
  </P>
</S>

CurTime is 10:17:46. If we add 136 seconds to it, that means the train is predicted to arrive at 10:20:02.

For further information on the Trackernet API, please refer to the documentation:

Thanks for replying. This is probably what I was after, and I’ll check the PDF out as well.

I was using a site called Intertube at the weekend, and it picked up on some trains without a timetable. Turning out to be train 545 battery locos with an engineer train, I’m guessing these get shown in the arrivals / predictions with limited information?