I’m using the above link for naptanId to feed into my other endpoints to get other data such as live crowding but I’ve noticed that most of these naptanId codes aren’t useful. Is there a way to get simple naptanId for all tube stations?
example: 0400ZZLUAMS0 - Amersham Underground Station
https://api.tfl.gov.uk/crowding/0400ZZLUAMS0/Live gets no results
Hello, and welcome to the forum!
The data returned by that first URL contains many types of StopPoint, including station entrances and platforms, for which crowding data are not available.
What you could do is filter the StopPoints and only look at those with a
stopPoint => stopPoint.stopType == "NaptanMetroStation")
I have filtered down to NaptanMetroEntrance codes only. But they are still not helpful when I plug them into the crowding endpoint.
Apologies. I meant
NaptanMetroStation rather than
NaptanMetroEntrance. I’ve fixed my code.