Status API - two statuses for Metropolitan

Hi,
I’m trying to use this API to get line statuses:
https://api.tfl.gov.uk/Line/Mode/tube/Status

Right now, the metropolitan has ‘Part Suspended’ and ‘Special Service’ in the lineStatuses array. They’re both current (‘isNow’ is true), and there’s nothing to distinguish one over the other. The ‘reason’ value is identical for both.

My code picked the first one, which is Part Suspended. But I see that https://tfl.gov.uk/tube-dlr-overground/status/# shows Special Service and not Part Suspended.

So, what logic should I use in my app? If I was just to show one of the statuses, how do I choose which one?

Rob

Here’s a screen grab from the feed right now with the two statuses:

@dev_rob

Welcome!

There are two overlapping statuses being shown “Part Suspend” and “Special Service”. They are not mutically exclusive as the “Met Line” can be thought of as three overlapping services (Baker Street to Watford, Algate to Chesham/Amersham, Uxbridge to Aldgate) .

image

from http://www.arrivaraillondon.co.uk/downloads/ARL-PIDD-Local-Delivery-Plan-issue-1-(Nov.-16)-v2.pdf

“Special Service” means something not following the published timetable. https://tfl.gov.uk/corporate/publications-and-reports/working-timetables

Hi,
Thanks for this. The feed doesn’t distinguish between the 3 services, but I can show both statuses anyway. But I’m still confused though, as:

  1. the ‘reason’ for both is the same, so one of them seems redundant
  2. TFL’s own web page only shows one of the statuses, and not both. So either that is using a different data source, or has some logic applied to show one status and not the other.

If I show both statuses then it’s not consistent with TFL’s web site. I’d like to be consistent with that rather than display two statuses for one line. (And as there’s 3 services on the line as you mentioned, then surely there should be 3 statuses in the feed and not 2 - that would make more sense logically. Having 2 isn’t consistent from either POV).

Cheers,
Rob

Hi Rob

Welcome to the forum.

I made what I thought was an arbitrary decision to show the single message with the lowest severity number (i.e. the most severe) but this seems to have resulted in selecting the same message as TfL show. I’m inclined to believe they take the same approach but have no proof of this…

HTH
Daniel

1 Like

Hi Daniel,

Thanks, I’ll give that a go.

Rob

1 Like