Live crowding data not working when app key prvoided

When I try to access live crowding data making a request in the format https://api.tfl.gov.uk/crowding/{Naptan}/Live?app_key={applicationKey},
the data given to me is from 12:46 on March 7th, a day behind the live data.

However when removing the app key query and requesting in the format
https://api.tfl.gov.uk/crowding/{Naptan}/Live,
the data I receive is closer to live, being from 18:41 on March 8th (tested at 19:01 on March 8th with NaptanId 940GZZLUSWC)
Is there any reason for this?

Welcome @jamieholloway

The crowding data us a set of values broken into 15 minutes, one per day of the week.

It’s much more efficient to just collect the whole dataset by using, say

https://api.tfl.gov.uk/crowding/940GZZLUGDG

and storing it in your backend database as 7x96 records.

This is a single static dataset that was generated once. Here is using a Postgress real[] array…

This means I can get it back with a simple query.

Which means I can show the whole current crowding data for the whole of the tube map.

Thank you for the fast response @briantist. Is the data there an average of historical records that will predict how crowded the station will be in a given timeslot? If that is the case would it be potentially less accurate than the live feed? Thanks for the help

@jamieholloway Sorry, I should have made it clear! There is no live feed, only the historical data presented for the current time.

@briantist I see, that clears everything up for me. Thanks for the help!

1 Like