Feature request: crowding for multiple stations

Hello!

I’d like to suggest a feature request regarding the /Crowding API endpoints, to allow developers to get the crowding data for multiple stations within the same request.

Current behaviour

At the moment if I want to get the live crowding data for both the London Underground and Elizabeth line sections of Tottenham Court Road, this requires 2 separate requests:

api.tfl.gov.uk/crowding/940GZZLUTCR/Live
and
api.tfl.gov.uk/crowding/910GTOTCTRD/Live

And likewise for the average daily crowding, by omitting the “/Live” at the end.

What I think would be helpful is for the {Naptan} URL parameter to accept a comma-seperated list of IDs, just like with several other endpoints.

Examples in other API endpoints

Currently https://api.tfl.gov.uk/StopPoint/{ids} accepts a comma-seperated list of station IDs, and https://api.tfl.gov.uk/Line/{ids} accepts a comma-seperated list of line IDs.

So ideally, I would be able to call https://api.tfl.gov.uk/crowding/940GZZLUTCR,910GTOTCTRD/Live and get back the crowding data for both stations at once. The saving isn’t much for just 2 stations together, but if I need data for 10+ stations at once, then it would save a significant number of API calls.

Alternative solution

I’ve noticed that the /StopPoint endpoint has an optional parameter “includeCrowdingData”, however setting this true does not return any additional data as far as I have seen.

After trying multiple different stations (including hubs), it seems to occasionally add a “passengerFlows” array when includeCrowdingData is true, however this array is always empty.

If this could be resolved (and have a way of returning both average and live crowding), then this would also work as an option, as this endpoint already accepts a comma-separated list of stations.

Hi @arturs, I am completely new to this api part and trying to collect live crowd data for Shepherd’s Bush Market Station. Can u tell me how do I call in my GCP console with primary key I have and station ID

Hello @Asish, welcome to the forum.

To get the live crowding for Shepherd’s Bush Market station, you’d need to call the following endpoint, replacing YOUR_KEY with your actual key provided in the API portal:

https://api.tfl.gov.uk/crowding/940GZZLUSBM/Live?app_key=YOUR_KEY

Please note however that currently live and predicted crowding data is not available, and will forward you on to the maintenance page, as a result of actions taken to mitigate the impact of the cyber attack in early September.

You can follow the below thread for updates on this: