This is getting daft now - the TfLRail API data is totally screwed. I just did the following enquiry, which should return every arrival on the TfL Rail line between Shenfield and Liverpool Street, and as far as I know, no other lines:
https://api.tfl.gov.uk/mode/tflrail/arrivals
However, the first few arrivals are as follows:
[
{
“$type”:“Tfl.Api.Presentation.Entities.Prediction, Tfl.Api.Presentation.Entities”,
“id”:”-1551819708”,
“operationType”:1,“vehicleId”:"pq2tWeKchumJSGhDC7Ep5A==“,
“naptanId”:"910GGOSPLOK”,
“stationName”:"Gospel Oak Rail Station”,
“lineId”:"tfl-rail”,
“lineName”:“TfL Rail”,
“platformName”:“Unknown”,
“direction”:”“,
“bearing”:”“,
“destinationNaptanId”:"910GSHENFLD”,
“destinationName”:“Shenfield Rail Station”,
“timestamp”:“2017-09-11T10:18:54Z”,
“timeToStation”:21,“currentLocation”:”“,
“towards”:”“,
“expectedArrival”:"2017-09-11T10:19:15Z”,
“timeToLive”:"2017-09-11T10:19:15Z”,
“modeName”:"tflrail”,
“timing”:{
“$type”:"Tfl.Api.Presentation.Entities.PredictionTiming, Tfl.Api.Presentation.Entities”,
“countdownServerAdjustment”:"00:00:00”,
“source”:"0001-01-01T00:00:00”,
“insert”:"0001-01-01T00:00:00”,
“read”:"0001-01-01T00:00:00Z”,
“sent”:"2017-09-11T10:18:54Z”,
“received”:“0001-01-01T00:00:00”
}
},
{
“$type”:“Tfl.Api.Presentation.Entities.Prediction, Tfl.Api.Presentation.Entities”,
“id”:”-1423392052”,
“operationType”:1,“vehicleId”:"pq2tWeKchumJSGhDC7Ep5A==“,
“naptanId”:"910GEMRSPKH”,
“stationName”:"Emerson Park Rail Station”,
“lineId”:"tfl-rail”,
“lineName”:“TfL Rail”,
“platformName”:“4”,
“direction”:”“,
“bearing”:”“,
“destinationNaptanId”:"910GSHENFLD”,
“destinationName”:“Shenfield Rail Station”,
“timestamp”:“2017-09-11T10:18:54Z”,
“timeToStation”:24,“currentLocation”:”“,
“towards”:”“,
“expectedArrival”:"2017-09-11T10:19:18Z”,
“timeToLive”:"2017-09-11T10:19:18Z”,
“modeName”:"tflrail”,
“timing”:{
“$type”:"Tfl.Api.Presentation.Entities.PredictionTiming, Tfl.Api.Presentation.Entities”,
“countdownServerAdjustment”:"00:00:00”,
“source”:"0001-01-01T00:00:00”,
“insert”:"0001-01-01T00:00:00”,
“read”:"0001-01-01T00:00:00Z”,
“sent”:"2017-09-11T10:18:54Z”,
“received”:“0001-01-01T00:00:00”
}
},
{
“$type”:"Tfl.Api.Presentation.Entities.Prediction, Tfl.Api.Presentation.Entities”,
“id”:"868586617”,
“operationType”:1,“vehicleId”:"pq2tWeKchumJSGhDC7Ep5A==“,
“naptanId”:"910GHGHMSPK”,
“stationName”:"Highams Park Rail Station”,
“lineId”:"tfl-rail”,
“lineName”:“TfL Rail”,
“platformName”:“4”,
“direction”:”“,
“bearing”:”“,
“destinationNaptanId”:"910GSHENFLD”,
“destinationName”:“Shenfield Rail Station”,
“timestamp”:“2017-09-11T10:18:54Z”,
“timeToStation”:24,“currentLocation”:”“,
“towards”:”“,
“expectedArrival”:"2017-09-11T10:19:18Z”,
“timeToLive”:"2017-09-11T10:19:18Z”,
“modeName”:"tflrail”,
“timing”:{
“$type”:"Tfl.Api.Presentation.Entities.PredictionTiming, Tfl.Api.Presentation.Entities”,
“countdownServerAdjustment”:"00:00:00”,
“source”:"0001-01-01T00:00:00”,
“insert”:"0001-01-01T00:00:00”,
“read”:"0001-01-01T00:00:00Z”,
“sent”:"2017-09-11T10:18:54Z”,
“received”:“0001-01-01T00:00:00”
}
}
You can see from this that the vehicle ID is the same, however, this train seems to be going from Gospel Oak at 10:19:15Z, then to Emerson Park at 10:19:18Z, then to Highams Park at 10:19:18Z. It has an eventual destination of Shenfield. Normally, Gospel Oak to Emerson Park would take over 1 hour and three trains - it would be lovely to be able to get on a train at Gospel Oak and three seconds later get off at Emerson Park. It would also be great to have a direct service from both places to Shenfield! As for stepping on the train at Emerson Park and then stepping straight back off again and finding yourself at Highams Park, even the likes of Doctor Who couldn’t manage that one!!!
The rest of the data, without all the “noise” shows trains that have a final destination of either Shenfield or Liverpool Street from Denmark Hill, Dalston Kingsland, Camden Road, Hamstead Heath, Goodmayes, Finchley Road and Frognal, Forest Gate, Richmond, Crouch Hill, Honor Oak Park, Clapton, Kensington Olympia, Kilburn High Road, Chadwell Heath, Kensal Rise, Kensal Green, Harold Wood, Manor Park, Peckham Rye, Norwood Junction, Hackney Wick, Cheshunt, Acton Central, Shenfield, Leyton Midland Road, Caledonian Road and Barnsbury, Harrow & Wealdstone, Brondesbury, Shadwell, Carpenters Park, South Tottenham, Stonebridge Park, and Hoxton.
There is something clearly wrong here, and this may explain why my original query of the vehicle ID is happening - because the data is corrupt and meaningless, the data is unable to be used in its current form.