Hello,
Navigating to:
https://api.tfl.gov.uk/StopPoint/490001341G/Arrivals?app_id=xxx&app_key=xxx
Returns the following:
$type: "Tfl.Api.Presentation.Entities.Prediction, Tfl.Api.Presentation.Entities",
id: "654406327",
operationType: 1,
vehicleId: "SN13CGZ",
naptanId: "490001341G",
stationName: "Woodgrange Park Station",
lineId: "425",
lineName: "425",
platformName: "G",
direction: "outbound",
bearing: "243",
destinationNaptanId: "",
destinationName: "Clapton, Nightingale Road",
timestamp: "2020-04-27T13:51:42.1974035Z",
timeToStation: 522,
currentLocation: "",
towards: "Forest Gate",
expectedArrival: "2020-04-27T14:00:24Z",
timeToLive: "2020-04-27T14:00:54Z",
modeName: "bus",
timing: {
$type: "Tfl.Api.Presentation.Entities.PredictionTiming, Tfl.Api.Presentation.Entities",
countdownServerAdjustment: "00:00:05.2251553",
source: "2020-04-26T16:32:19.313Z",
insert: "2020-04-27T13:51:58.881Z",
read: "2020-04-27T13:52:04.101Z",
sent: "2020-04-27T13:51:42Z",
received: "0001-01-01T00:00:00Z"
}
Note the timestamp is for the 2020-04-27
However if I perform the same request via the HttpClient in C# , I receive a response with time stamps of 2020-04-24 :
{
"$type": "Tfl.Api.Presentation.Entities.Prediction, Tfl.Api.Presentation.Entities",
"id": "1395977545",
"operationType": 1,
"vehicleId": "SK19FCJ",
"naptanId": "490001341G",
"stationName": "Woodgrange Park Station",
"lineId": "25",
"lineName": "25",
"platformName": "G",
"direction": "inbound",
"bearing": "243",
"destinationNaptanId": "",
"destinationName": "City Thameslink",
"timestamp": "2020-04-24T14:52:23.4782183Z",
"timeToStation": 127,
"currentLocation": "",
"towards": "Forest Gate",
"expectedArrival": "2020-04-24T14:54:30Z",
"timeToLive": "2020-04-24T14:55:00Z",
"modeName": "bus",
"timing": {
"$type": "Tfl.Api.Presentation.Entities.PredictionTiming, Tfl.Api.Presentation.Entities",
"countdownServerAdjustment": "00:00:04.8854978",
"source": "2020-04-24T12:37:46.33Z",
"insert": "2020-04-24T14:52:56.768Z",
"read": "2020-04-24T14:53:01.636Z",
"sent": "2020-04-24T14:52:23Z",
"received": "0001-01-01T00:00:00Z"
}
}
I can correct the issue in code by adding a cookie to the request (Copied from the request sent via the browser). However this is not an ideal solution.
Curiously it only appears to happen to a small set of Stop Codes that I am using (May be more that I don’t know):
Norwood Junction Station:
490001216E
490001216P
490010448S
490001216T
Woodgrange Park Station:
490001341G
490001341H
Could someone please investigate as to why I receive out of date information.
Kind Regards,
Ywain