Empty affectedRoutes and affectedStops

Why are affectedRoutes and affectedStops empty under lineStatuses[].disruption? I am aware that TrackerNet reports where a disruption starts and ends, so clearly this data exists (or can be worked out), but why is this data not included in the API, given the TrackerNet API is technically deprecated and its use discouraged?

Luckily there’s a partial disruption active right now that can serve as a great example, so here’s the status for the Bakerloo line from both the API (https://api.tfl.gov.uk/Line/bakerloo/Status):

{
  "$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
  "id": 0,
  "lineId": "bakerloo",
  "statusSeverity": 3,
  "statusSeverityDescription": "Part Suspended",
  "reason": "Bakerloo Line: No service between Queen's Park and Harrow & Wealdstone due to a fire alert at Willesden Junction. Tickets valid on local London Buses. ",
  "created": "0001-01-01T00:00:00",
  "validityPeriods": [
    {
      "$type": "Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities",
      "fromDate": "2021-04-06T14:37:23Z",
      "toDate": "2021-04-06T17:37:23Z",
      "isNow": true
    }
  ],
  "disruption": {
    "type": "Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities",
    "category": "RealTime",
    "categoryDescription": "RealTime",
    "description": "Bakerloo Line: No service between Queen's Park and Harrow & Wealdstone due to a fire alert at Willesden Junction. Tickets valid on local London Buses. ",
    "affectedRoutes": [
      
    ],
    "affectedStops": [
      
    ],
    "closureText": "partSuspended"
  }
}

And here’s the response from TrackerNet ( cloud.tfl.gov.uk/TrackerNet/LineStatus):

<LineStatus ID="0" StatusDetails="No service between Queen's Park and Harrow & Wealdstone due to a fire alert at Willesden Junction. Tickets valid on local London Buses.">
  <BranchDisruptions>
    <BranchDisruption>
      <StationTo ID="100" Name="Harrow & Wealdstone"/>
      <StationFrom ID="183" Name="Queen's Park"/>
      <Status ID="PS" CssClass="DisruptedService" Description="Part Suspended" IsActive="true">
        <StatusType ID="1" Description="Line"/>
      </Status>
    </BranchDisruption>
  </BranchDisruptions>
  <Line ID="1" Name="Bakerloo"/>
  <Status ID="PS" CssClass="DisruptedService" Description="Part Suspended" IsActive="true">
    <StatusType ID="1" Description="Line"/>
  </Status>
</LineStatus>

As you can see, TrackerNet says the disruption starts at Harrow & Wealdstone (<StationTo ID="100" Name="Harrow & Wealdstone"/>) and ends at Queen’s Park (<StationFrom ID="183" Name="Queen's Park"/>), but according to the API the disruption doesn’t affect any routes ("affectedRoutes": []) or stops ("affectedStops": []).

Is there a reason why these two values always empty? Would be very useful to check what parts of a line are disrupted, especially with something like the London Overground with its huge mess of statuses across several separate lines.

1 Like

@arturs

From memory, there no structured data held in the control room, these types of disruption are held a plain text.

Quite how they get made into the display https://tfl.gov.uk/tube-dlr-overground/status/

image

I have always wondered. Perhaps @jamesevans knows.

hi @arturs

It might be worth adding the detail=true switch to your calls.
e.g.
https://api.tfl.gov.uk/Line/Mode/tube,dlr,overground,tflrail,tram/Status?detail=true

Thanks,
James

Except the data is held, otherwise TrackerNet wouldn’t be able to list the start and end of the disruption.

I wasn’t aware the detail parameter was a thing - should have probably looked over the docs again, apologies. This has solved the issue.

Indeed. It would be nice for these to be converted to lists of effected stations, an array of Stop Points would make it easy for everyone. Which seem to be “affectedStops” in the https://api.tfl.gov.uk/Line/Mode/tube,dlr,overground,tflrail,tram/Status?detail=true version