I’m trying to utilise the Open Data API in a project to retrieve the sequence of stops for each route on the Overground (https://api.tfl.gov.uk/Line/london-overground/Route/Sequence/all), then periodically get the arrival/departure predictions for the identified stops on that route using the returned NaPTAN ID’s.
I’ve noticed an interesting oddity surrounding the ID’s used to represent Clapham Junction, that I’m yet to find mentioned here.
I’m aware of the convention that NaPTAN ID’s follow, with a single station potentially having multiple ID’s that identify different entrances, or other modes of transport nearby. Recent posts on the forum (Watford Junction Naptan code, suggested to me as I created this topic), demonstrate that these ID’s can change with little warning.
gov.uk data on NaPTAN ID’s seems to show that Clapham Junction has 5 associated ID’s, although I appreciate that not all of these may not be relevant within TFL’s Open Data.
Auditing on the document suggests that these ID’s have not changed in some time, however.
When retrieving the sequence of stops for all routes, the API returns an array of NaPTAN ID’s. For the Highbury & Islington - Clapham Junction branch of the East London Line, Clapham Junction is shown to have a NaPTAN ID of “910GCLPHMJ1” in both directions.
For the North London Line in the inbound direction, this ID is identical, but for outbound journeys is represented with “910GCLPHMJC”.
The fact that this is only in one direction of a single branch is especially strange, as I would at the very least understand if each branch had its own code for simplicity (although that may not adhere to the conventions of the ID’s themselves).
This oddity is compounded with the fact that the former is recognised by the API as a valid NaPTAN ID when requesting arrival and departure predictions (https://api.tfl.gov.uk/StopPoint/910GCLPHMJ1/ArrivalDepartures?lineIds=london-overground), but produces no results.
Instead, the latter ID, 910GCLPHMJC, must be used instead in order to get this information for this station.
Given that both trains on both branches depart from and arrive at the same end of the station, share an entrance/exit, and are operated from their respective platforms solely by the same operating company, I’m at a loss as to why this would be the case.
Is there a reason as to why this occurs, or why the API behaves in this manner?