Returned Bus line status showing severity 10 when severity 0 requested

Hi,
There seems to be a problem obtaining the correct bus status severity level when entering the following url

https://api.tfl.gov.uk/Line/Mode/bus/Status?detail=false&severityLevel=0

The data return is as follows:

HTTP/1.1 200 OK

age: 0
api-entity-payload: Line,LineStatus
cache-control: public, must-revalidate, max-age=30, s-maxage=60
content-encoding: gzip
content-length: 7988
content-type: application/json; charset=utf-8
date: Fri, 31 Mar 2023 13:29:38 GMT
server: cloudflare
via: 1.1 varnish
x-api: Line
x-aspnet-version: 4.0.30319
x-backend: api
x-cache: MISS
x-cacheable: Yes. Cacheable
x-frame-options: deny
x-operation: Line_StatusByModeByPathModesQueryDetailQuerySeverityLevel
x-proxy-connection: unset
x-ttl: 60.000
x-ttl-rule: 0
x-varnish: 536684108

[{
“$type”: “Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities”,
“id”: “1”,
“name”: “1”,
“modeName”: “bus”,
“disruptions”: [],
“created”: “2023-03-29T12:40:19.053Z”,
“modified”: “2023-03-29T12:40:19.053Z”,
“lineStatuses”: [{
“$type”: “Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities”,
“id”: 0,
"statusSeverity": 10,
“statusSeverityDescription”: “Good Service”,
“created”: “0001-01-01T00:00:00”,
“validityPeriods”: []
}],
“routeSections”: [],
“serviceTypes”: [{
“$type”: “Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities”,
“name”: “Regular”,
“uri”: “/Line/Route?ids=1&serviceTypes=Regular”
}],
“crowding”: {
“$type”: “Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities”
}
}, {
“$type”: “Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities”,
“id”: “100”,
“name”: “100”,
“modeName”: “bus”,
“disruptions”: [],
“created”: “2023-03-29T12:40:19.053Z”,
“modified”: “2023-03-29T12:40:19.053Z”,
“lineStatuses”: [{
“$type”: “Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities”,
“id”: 0,
“statusSeverity”: 10,
“statusSeverityDescription”: “Good Service”,
“created”: “0001-01-01T00:00:00”,
“validityPeriods”: []
}],
“routeSections”: [],
“serviceTypes”: [{
“$type”: “Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities”,
“name”: “Regular”,
“uri”: “/Line/Route?ids=100&serviceTypes=Regular”
}],
“crowding”: {
“$type”: “Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities”
}
}, {

Is there a bug in the API request? or is there an alternative way for collecting the data?

Thank you in advance.

Hay @Leo

Have you seen More information about statusSeverity ?

The severity list you pointed me to is actually for disruptions not bus line statuses.

The url I entered in the example above was taken from the instructions in the api.tfl documentation.

if you enter it as a normal url on your laptop / pc the result will be the same .

So the extra severity list has nothing to do with the current problem

for url request “[https://api.tfl.gov.uk/Line/Mode/bus/Status?detail=false&severityLevel=0

Please note the end of the url states severity=0, so why am I getting severity 10 "Good Service: which is not what I want.

@Leo

I don’t think the bus services are broken down into service statuses like the other types of service are (including the River Boats). I think the status is “10” for bus services because they’re all contracted to be running, but said contracts provide no requirement for TfL to be notified electronically about disruptions - they all have iBus and that’s it.

There is no ongoing computation for each numbered bus route, just each bus.

Thank you for your reply.

I have found that using /Line/status without mode/bus does actually return all bus line statuses with statusSeverity = 0, i.e some sort of real time or planned disruption to the line services as follows:

https://api.tfl.gov.uk/line/status/0
[
{
“$type”: “Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities”,
“id”: “102”,
“name”: “102”,
“modeName”: “bus”,
“disruptions”: [],
“created”: “2023-03-29T12:40:19.037Z”,
“modified”: “2023-03-29T12:40:19.037Z”,
“lineStatuses”: [
{
“$type”: “Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities”,
“id”: 0,
“lineId”: “102”,
“statusSeverity”: 0,
“statusSeverityDescription”: “Special Service”,
“reason”: “Proposed Changes to Routes in the Brent Cross and Cricklewood areas: We are proposing changes to bus routes 102, 189, 210, 232, 266, 316, 326 and C11 in the Brent Cross and Cricklewood area. Our aim is to adapt and develop a bus network ready to serve the new Brent Cross West rail station, the growing Brent Cross Town community and other developments around Edgware Road.”,
“created”: “0001-01-01T00:00:00”,
“validityPeriods”: [
{
“$type”: “Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities”,
“fromDate”: “2023-03-08T13:26:00Z”,
“toDate”: “2023-04-17T00:29:00Z”,
“isNow”: false
}
],
“disruption”: {
“$type”: “Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities”,
“category”: “PlannedWork”,
“categoryDescription”: “PlannedWork”,
“description”: “Proposed Changes to Routes in the Brent Cross and Cricklewood areas: We are proposing changes to bus routes 102, 189, 210, 232, 266, 316, 326 and C11 in the Brent Cross and Cricklewood area. Our aim is to adapt and develop a bus network ready to serve the new Brent Cross West rail station, the growing Brent Cross Town community and other developments around Edgware Road.”,
“additionalInfo”: “Find out more and <a href="https://haveyoursay.tfl.gov.uk/brent-cross-bus-changes#7\”>let us have your views",
“created”: “2023-03-08T13:26:00Z”,
“affectedRoutes”: [],
“affectedStops”: []
}
},
{
“$type”: “Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities”,
“id”: 0,
“lineId”: “102”,
** “statusSeverity”: 0,**
“statusSeverityDescription”: “Special Service”,
“reason”: “GOLDERS GREEN ROAD: Routes 102 and 226 are on diversion from Golders Green Station to Pennine Drive/Hendon Way via Finchley Road, Cricklewood Lane and Hendon Way due to roadworks. Buses are not serving the stops Hodford Road, Dunstan Road and The Vale/Hendon Way.”,
“created”: “0001-01-01T00:00:00”,
“validityPeriods”: [
{
“$type”: “Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities”,
“fromDate”: “2023-03-28T15:01:00Z”,
“toDate”: “2023-04-02T09:29:00Z”,
“isNow”: true
}
],
“disruption”: {
“$type”: “Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities”,
“category”: “RealTime”,
“categoryDescription”: “RealTime”,
“description”: “GOLDERS GREEN ROAD: Routes 102 and 226 are on diversion from Golders Green Station to Pennine Drive/Hendon Way via Finchley Road, Cricklewood Lane and Hendon Way due to roadworks. Buses are not serving the stops Hodford Road, Dunstan Road and The Vale/Hendon Way.”,
“created”: “2023-03-28T16:01:00Z”,
“affectedRoutes”: [],
“affectedStops”: []
}
}
],
“routeSections”: [],
“serviceTypes”: [
{
“$type”: “Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities”,
“name”: “Regular”,
“uri”: “/Line/Route?ids=102&serviceTypes=Regular”
}
],
“crowding”: {
“$type”: “Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities”
}
},
{
“$type”: “Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities”,
“id”: “108”,
“name”: “108”,
“modeName”: “bus”,
“disruptions”: [],
“created”: “2023-03-29T12:40:19.037Z”,
“modified”: “2023-03-29T12:40:19.037Z”,
“lineStatuses”: [
{
“$type”: “Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities”,
“id”: 0,
“lineId”: “108”,
“statusSeverity”: 0,
“statusSeverityDescription”: “Special Service”,
“reason”: “LEWISHAM HIGH STREET, SE13: Buses are on diversion from 00:01 on Saturday 01 April until 23:59 on Sunday 02 April due to a crane operation. Routes 108 273 are diverted to stand on Molesworth Street, missing the stops Lewisham Station and Connington Road in both directions.”,
“created”: “0001-01-01T00:00:00”,
“validityPeriods”: [
{
“$type”: “Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities”,
“fromDate”: “2023-03-31T23:01:00Z”,
“toDate”: “2023-04-02T22:59:00Z”,
“isNow”: false
}
],
“disruption”: {
“$type”: “Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities”,
“category”: “PlannedWork”,
“categoryDescription”: “PlannedWork”,
“description”: “LEWISHAM HIGH STREET, SE13: Buses are on diversion from 00:01 on Saturday 01 April until 23:59 on Sunday 02 April due to a crane operation. Routes 108 273 are diverted to stand on Molesworth Street, missing the stops Lewisham Station and Connington Road in both directions.”,
“created”: “2023-03-25T04:35:00Z”,
“affectedRoutes”: [],
“affectedStops”: []
}
},
{
“$type”: “Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities”,
“id”: 0,
“lineId”: “108”,
“statusSeverity”: 0,
“statusSeverityDescription”: “Special Service”,
“reason”: “BLACKWALL TUNNEL: From 22:00 Friday 31 March to 23:45 Sunday 02 April, route 108 is operating a split service due to footbridge installation works. Buses are operating between Stratford International Station and Canning Town Station and between Lewisham and North Greenwich Station. Use the Jubilee Line to travel between North Greenwich and Stratford.”,
“created”: “0001-01-01T00:00:00”,
“validityPeriods”: [
{
“$type”: “Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities”,
“fromDate”: “2023-03-31T21:00:00Z”,
“toDate”: “2023-04-02T22:45:00Z”,
“isNow”: false
}
],
“disruption”: {
“$type”: “Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities”,
“category”: “PlannedWork”,
“categoryDescription”: “PlannedWork”,
“description”: “BLACKWALL TUNNEL: From 22:00 Friday 31 March to 23:45 Sunday 02 April, route 108 is operating a split service due to footbridge installation works. Buses are operating between Stratford International Station and Canning Town Station and between Lewisham and North Greenwich Station. Use the Jubilee Line to travel between North Greenwich and Stratford.”,
“created”: “2023-03-21T06:48:00Z”,
“affectedRoutes”: [],
“affectedStops”: []
}
}
],
“routeSections”: [],
“serviceTypes”: [
{
“$type”: “Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities”,
“name”: “Regular”,
“uri”: “/Line/Route?ids=108&serviceTypes=Regular”
}
],
“crowding”: {
“$type”: “Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities”
}
},

I can also obtain information for a particular bus line number with detailed description of each route stop affected, as follows.

https://api.tfl.gov.uk/Line/414/Status?detail=true
[
{
“$type”: “Tfl.Api.Presentation.Entities.Line, Tfl.Api.Presentation.Entities”,
“id”: “414”,
“name”: “414”,
“modeName”: “bus”,
“disruptions”: [],
“created”: “2023-03-02T12:25:01.97Z”,
“modified”: “2023-03-02T12:25:01.97Z”,
“lineStatuses”: [
{
“$type”: “Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities”,
“id”: 0,
“lineId”: “414”,
“statusSeverity”: 0,
“statusSeverityDescription”: “Special Service”,
“reason”: “CHELSEA v BORUSSIA DORTMUND: Routes 14 211 and 414 are on diversion in both directions between 18:30 and 23:15 on Tuesday 07 March due to a football match at Stamford Bridge. Buses are diverted via Harwood Road, King’s Road and Gunter Grove / Edith Grove, missing stops between Fulham Broadway Station and Hortensia Road.”,
“created”: “0001-01-01T00:00:00”,
“validityPeriods”: [
{
“$type”: “Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities”,
“fromDate”: “2023-03-04T17:38:00Z”,
“toDate”: “2023-03-07T23:15:00Z”,
“isNow”: false
}
],
“disruption”: {
“$type”: “Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities”,
“category”: “PlannedWork”,
“categoryDescription”: “PlannedWork”,
“description”: “CHELSEA v BORUSSIA DORTMUND: Routes 14 211 and 414 are on diversion in both directions between 18:30 and 23:15 on Tuesday 07 March due to a football match at Stamford Bridge. Buses are diverted via Harwood Road, King’s Road and Gunter Grove / Edith Grove, missing stops between Fulham Broadway Station and Hortensia Road.”,
“created”: “2023-02-19T18:06:00Z”,
“affectedRoutes”: [
{
“$type”: “Tfl.Api.Presentation.Entities.DisruptedRoute, Tfl.Api.Presentation.Entities”,
“id”: “826”,
“name”: “Putney Bridge Station - Marble Arch”,
“direction”: “outbound”,
“originationName”: “Putney Bridge Station”,
“destinationName”: “Marble Arch”,
“isEntireRouteSection”: true,
“routeSectionNaptanEntrySequence”: [
{
“$type”: “Tfl.Api.Presentation.Entities.RouteSectionNaptanEntrySequence, Tfl.Api.Presentation.Entities”,
“ordinal”: 0,
“stopPoint”: {
“$type”: “Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities”,
“naptanId”: “490000184Y”,
“indicator”: “Stop FB”,
“stopLetter”: “FB”,
“modes”: [],
“icsCode”: “1000184”,
“stationNaptan”: “490G00184X”,
“lines”: [],
“lineGroup”: [],
“lineModeGroups”: [],
“status”: true,
“id”: “490000184Y”,
“commonName”: “Putney Bridge Station”,
“placeType”: “StopPoint”,
“additionalProperties”: [],
“children”: [],
“lat”: 0,
“lon”: 0
}
},
{
“$type”: “Tfl.Api.Presentation.Entities.RouteSectionNaptanEntrySequence, Tfl.Api.Presentation.Entities”,
“ordinal”: 1,
“stopPoint”: {
“$type”: “Tfl.Api.Presentation.Entities.StopPoint, Tfl.Api.Presentation.Entities”,
“naptanId”: “490007051N”,
“indicator”: “Stop FJ”,
“stopLetter”: “FJ”,
“modes”: [],
“icsCode”: “1008436”,
“stationNaptan”: “490G00008436”,
“lines”: [],
“lineGroup”: [],
“lineModeGroups”: [],
“status”: true,
“id”: “490007051N”,
“commonName”: “Fulham High Street”,
“placeType”: “StopPoint”,
“additionalProperties”: [],
“children”: [],
“lat”: 0,
“lon”: 0
}
},
Conclusion
These are the results I actually wanted, leaving out mode/bus and severity=0 in the api call.

I am a little confused. If contracts provide no requirements for TFL to be notified electronically, then how is the above data provided to the TFL API?

@Leo Perhaps the API is able to derive this statuses from iBus then?

There does seem to be a Buses status updates - Transport for London page now which I don’t recall being there before.

Perhaps @jamesevans can confirm.

Brian - That’s been there for well over a year, I think. From memory it is more targeted at planned diversions and stop closures rather than real time disruptions, which would explain why it would be feasible to maintain it without any input from operators. I would have to say that it is not very reliable. One example was the 394 back in January which showed first one, then a second diversion when the actual diversion had been postponed anyway. That’s good ld GIGO in operation of course.

It is possible that some operators might feed back information to TfL even if there is no contractual obligation to do so. Anyone who travels on a bus will be aware also that there is a regular flow of information (not route specific) to the drivers and intelligence may well go back the other way but it seems that there is no mechanism for displaying these to the public. Of course in many cases the disruption would be over by the time the information was available!

Brian, I would like to point out that this discussion relates to queries about TFL API data as a developer not a consumer. The link you have provided has existed for a while as mjcarchive has pointed and is for general public viewing. My queries relate to the integrity of TFL API Json data for my mobile phone project.

Thank you.

Hi Micheal,

For research purposes I view the Line Status api almost daily to asses data using the following api call:

https://api.tfl.gov.uk/line/status/0

One surprising factor is, I would have assumed without specifying a line mode the data returned would be all mode types Bus, underground etc, but the status returned contains data for buses only. The data contains realTime data as well as plannedWork as follows:

bus route line 108 shows both RealTime and PlannedWork but with different reason explanations. The disruption descriptions echos the reason explanation.

"lineStatuses": [
  {
    "$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
    "id": 0,
    **"lineId": "108"**,
    "statusSeverity": 0,
    "**statusSeverityDescription": "Special Service",**
    "reason": "MILLENNIUM WAY: Routes 108 and 188 are on diversion via West Parkside and John Harrison Way due to Silvertown Tunnel works. Buses are not serving Boord Street (Stop MT).",
    "created": "0001-01-01T00:00:00",
    "validityPeriods": [
      {
        "$type": "Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities",
        "fromDate": "2023-04-03T07:21:00Z",
        "toDate": "2023-04-16T09:29:00Z",
        "isNow": true
      }
    ],
    "disruption": {
      "$type": "Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities",
      "**category": "RealTime",**
      "categoryDescription": "RealTime",
      "description": "MILLENNIUM WAY: Routes 108 and 188 are on diversion via West Parkside and John Harrison Way due to Silvertown Tunnel works. Buses are not serving Boord Street (Stop MT).",
      "created": "2023-04-03T08:21:00Z",
      "affectedRoutes": [],
      "affectedStops": []
    }
  },
  {
    "$type": "Tfl.Api.Presentation.Entities.LineStatus, Tfl.Api.Presentation.Entities",
    "id": 0,
    **"lineId": "108",**
    "statusSeverity": 0,
    "**statusSeverityDescription": "Special Service",**
    "reason": "MILLENNIUM WAY, SE10: Routes 108 188 are on diversion towards Stratford and Russell Square between 06:00 and 18:00 until Wednesday 05 April due to utility chamber works. Buses are diverted via Edmund Halley Way, West Parkside, John Harrison Way, and Blackwall Lane, missing the stop Boord Street.",
    "created": "0001-01-01T00:00:00",
    "validityPeriods": [
      {
        "$type": "Tfl.Api.Presentation.Entities.ValidityPeriod, Tfl.Api.Presentation.Entities",
        **"fromDate": "2023-04-03T05:00:00Z",**
        "**toDate": "2023-04-03T17:00:00Z",**
        "isNow": false
      }
    ],
    "disruption": {
      "$type": "Tfl.Api.Presentation.Entities.Disruption, Tfl.Api.Presentation.Entities",
      **"category": "PlannedWork",**
      "categoryDescription": "PlannedWork",
      "description": "MILLENNIUM WAY, SE10: Routes 108 188 are on diversion towards Stratford and Russell Square between 06:00 and 18:00 until Wednesday 05 April due to utility chamber works. Buses are diverted via Edmund Halley Way, West Parkside, John Harrison Way, and Blackwall Lane, missing the stop Boord Street.",
      "created": "2023-04-03T10:03:00Z",
      "affectedRoutes": [],
      "affectedStops": []
    }
  }
],
"routeSections": [],
"serviceTypes": [
  {
    "$type": "Tfl.Api.Presentation.Entities.LineServiceTypeInfo, Tfl.Api.Presentation.Entities",
    "name": "Regular",
    "uri": "/Line/Route?ids=108&serviceTypes=Regular"
  }
],
"crowding": {
  "$type": "Tfl.Api.Presentation.Entities.Crowding, Tfl.Api.Presentation.Entities"
}

},

Is it prudent to ask which party is responsible for TFL API data collection and how can the accuracy of data be verified?

Thank you in advance.

@Leo

I’m trying to help you as a developer - I am also a developer. This is a self-support forum.

Sorry Brian, it wasn’t meant to be an attack on your findings or expertise. I am focusing on the specific API data not links that are accessible to the public.

@Leo

I think the whole idea of the public APIs is that it surfaces already public-available data in a usable format.

Perhaps @jamesevans can clarify if there is additional data that I’ve missed from APIs: List - Transport for London - API

More confusion for me. I actually use, and have always Benn using the following link

APIs: Details - Transport for London - API

Are you aware of it?

@Leo

The above one is one @jamesevans posted on here a while ago.

Yes you are right. There are actually are 3 entries to to the TFL API.

https://api.tfl.gov.uk

Thanks for the heads up, but no one (except your finding) has answered my original (very first) question in the post regarding why I only get severity 10 for buses when mode/bus and severity query is entered with other severity types. It doesn’t make sense to me, to have a severity option for legitimate bus mode and only returns one status severity type.