Introduction
Welcome to the beta of the True Tube Status API. This API provides access to our statuses and data for the London Underground. The data provided is real-time and suitable for inclusion in commuter-facing, business or government applications.
Getting Started
The first step is to familiarize yourself with the interface and concept. The user guide, methodology and FAQ may be useful in learning about the concept.
When you're ready, sign up for a developer account here (you'll need a Google account to register). Accounts are automatically set up on the free Sandbox plan. You'll be able to retrieve your API key and start making requests immediately.
Authentication
To authorise, use this code:
# With shell, you can just pass the correct header with each request
curl "https://apis.truetubestatus.com/real-time/beta/statusUpdates" \
-H "x-api-key: EXAMPLE_KEY"
var request = require('request');
request.get({
url: 'https://apis.truetubestatus.com/real-time/beta/statusUpdates',
headers: { 'x-api-key': 'EXAMPLE_KEY' },
json: true
}, function(err, response, body) {
...
Make sure to replace
EXAMPLE_KEYwith your API key.
To access the API you'll need to authorise requests with your API key. (You can retrieve your API from the developer interface.) Add your API token as a header parameter as follows:
x-api-key: EXAMPLE_KEY
All API requests must be made over HTTPS. Requests made over HTTP will not be accepted. Do not make requests in HTTP as you will transmit your API key in plaintext over the network.
As you make requests to the API you'll draw down on your monthly quota of requests. You can view your quota and the number of requests you have made in the developer interface.
Status Updates
The status update object
Example status update object:
{
"id": "626ac447e4607580cf7ea1b5",
"line": "hammersmith-city",
"lineName": "Hammersmith & City",
"type": "tts",
"typeReason": "data_available",
"description": "Minor Delays",
"officialReasons": [],
"isConfirmation": false,
"isCorrection": true,
"correction": {
"original": "Good Service",
"new": "Minor Delays",
"confidence": "high"
},
"outbound": "Minor Delays",
"inbound": "Minor Delays",
"created": 1651248860127,
"expires": 1651249167285
}
The status update object describes the status of a Tube line at a moment in time. Attributes are as follows.
id string
The ID of the status update.
line string
The TfL ID of the line. Can be bakerloo, central, circle, district, hammersmith-city, jubilee, metropolitan, northern, piccadilly, victoria or waterloo-city.
lineName string
A human readable version of the line attribute.
type string
Can be either tts, tfl or n/a.
| Value | Meaning |
|---|---|
| tts | True Tube Status |
| tfl | Transport for London |
| n/a | Not available |
The system always tries to return objects of the tts type. When it isn't possible (see the typeReason codes below), tfl type objects based on the official status are returned. If even that isn't possible, objects of type n/a are returned.
typeReason string
This field is a code that explains why the type of the status update object was selected. Available options are as follows.
| Value | Meaning |
|---|---|
| data_available | The system has sufficient data to confirm or correct the official status. |
| insufficient_data | The system has insufficient data to return a confirmation or correction. (There could be an issue with the TfL data source or the service level could be too sparse to compute a status update.) |
| status_unsupported | The system doesn't support calculations about the situation reported by TfL. |
| line_unsupported | The line isn't currently supported. |
| other | Other unclassified reason. |
description string
A human readable string suitable for display in a UI listing line statuses. May be a single status (e.g. Good Service) or a severity-ordered, comma-separated list of two statuses (e.g. Severe Delays, Good Service).
officialReasons array
An array of human readable strings with further information about disruption statuses declared by TfL. Copied verbatim from the TfL open data API.
isConfirmation boolean
Applicable for type tts objects only. Indicates whether or not this status update confirms the official status.
isCorrection boolean
Applicable for type tts objects only. Indicates whether or not this status update corrects the official status.
correction object
Applicable for type tts objects only in cases where isCorrection is true. A hash describing the correction with the original and new values and a confidence label.
For example, { "original": "Good Service", "new": "Minor Delays", "confidence": "high" }.
| key | explanation |
|---|---|
| original | The original status. E.g. 'Good Service'. |
| new | The new, correct status. E.g. 'Minor Delays'. |
| confidence | A description of how confident the system is about the correction ('high', 'medium' or 'low'). |
outbound string
Applicable for type tts objects only. Similar to description but in the outbound direction only. A human readable string (e.g. Good Service) applicable to the line's outbound service only. See the table below for compass direction equivalents of the outbound direction for each Tube line.
| line id | outbound | inbound |
|---|---|---|
| bakerloo | Northbound | Southbound |
| central | Eastbound | Westbound |
| circle | Clockwise | Anti-clockwise |
| district | Eastbound | Westbound |
| hammersmith-city | Eastbound | Westbound |
| jubilee | Southbound | Northbound |
| metropolitan | Southbound | Northbound |
| northern | Northbound | Southbound |
| piccadilly | Eastbound | Westbound |
| victoria | Northbound | Southbound |
inbound string
Applicable for type tts objects only. Similar to description but in the inbound direction only. A human readable string (e.g. Good Service) applicable to the line's inbound service only. See the table above for compass direction equivalents of the inbound direction for each Tube line.
created timestamp
The date the status update object was created. Stored as the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
expires timestamp
The date at which to re-poll the endpoint for a new status update object. Stored as the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
List all status updates
Example request:
curl "https://apis.truetubestatus.com/real-time/beta/statusUpdates" \
-H "x-api-key: EXAMPLE_KEY"
var request = require('request');
request.get({
url: 'https://apis.truetubestatus.com/real-time/beta/statusUpdates',
headers: { 'x-api-key': 'EXAMPLE_KEY' },
json: true
}, function(err, response, body) {
...
Example response:
[
{
"id": "626adf917b58e026f77680d1",
"line": "central",
"lineName": "Central",
"type": "tts",
"typeReason": "data_available",
"description": "Good Service",
"officialReasons": [],
"isConfirmation": true,
"isCorrection": false,
"correction": {},
"outbound": "Good Service",
"inbound": "Good Service",
"created": 1651248860127,
"expires": 1651249167285
},
{
"id": "626adf917b58e026f77680d3",
"line": "district",
"lineName": "District",
"type": "tts",
"typeReason": "data_available",
"description": "Good Service",
"officialReasons": [
"DISTRICT LINE: Minor delays between Tower Hill and West Ham due to a faulty train."
],
"isConfirmation": false,
"isCorrection": true,
"correction": {
"original": "Minor Delays",
"new": "Good Service",
"confidence": "high"
},
"outbound": "Good Service",
"inbound": "Good Service",
"created": 1651248860127,
"expires": 1651249167285
},
{
"id": "626adf917b58e026f77680d0",
"line": "circle",
"lineName": "Circle",
"type": "tts",
"typeReason": "data_available",
"description": "Good Service",
"officialReasons": [],
"isConfirmation": true,
"isCorrection": false,
"correction": {},
"outbound": "Good Service",
"inbound": "Good Service",
"created": 1651248860127,
"expires": 1651249167285
},
{
"id": "626adf917b58e026f77680d5",
"line": "bakerloo",
"lineName": "Bakerloo",
"type": "tts",
"typeReason": "data_available",
"description": "Good Service",
"officialReasons": [],
"isConfirmation": true,
"isCorrection": false,
"correction": {},
"outbound": "Good Service",
"inbound": "Good Service",
"created": 1651248860127,
"expires": 1651249167285
},
{
"id": "626adf917b58e026f77680d7",
"line": "hammersmith-city",
"lineName": "Hammersmith & City",
"type": "tts",
"typeReason": "data_available",
"description": "Good Service",
"officialReasons": [],
"isConfirmation": true,
"isCorrection": false,
"correction": {},
"outbound": "Good Service",
"inbound": "Minor Delays",
"created": 1651248860127,
"expires": 1651249167285
},
{
"id": "626adf917b58e026f77680d8",
"line": "jubilee",
"lineName": "Jubilee",
"type": "tts",
"typeReason": "data_available",
"description": "Good Service",
"officialReasons": [],
"isConfirmation": true,
"isCorrection": false,
"correction": {},
"outbound": "Good Service",
"inbound": "Good Service",
"created": 1651248860127,
"expires": 1651249167285
},
{
"id": "626adf917b58e026f77680d6",
"line": "metropolitan",
"lineName": "Metropolitan",
"type": "tts",
"typeReason": "data_available",
"description": "Good Service",
"officialReasons": [],
"isConfirmation": true,
"isCorrection": false,
"correction": {},
"outbound": "Good Service",
"inbound": "Good Service",
"created": 1651248860127,
"expires": 1651249167285
},
{
"id": "626adf917b58e026f77680d9",
"line": "northern",
"lineName": "Northern",
"type": "tts",
"typeReason": "data_available",
"description": "Good Service",
"officialReasons": [],
"isConfirmation": true,
"isCorrection": false,
"correction": {},
"outbound": "Good Service",
"inbound": "Good Service",
"created": 1651248860127,
"expires": 1651249167285
},
{
"id": "626adf917b58e026f77680da",
"line": "piccadilly",
"lineName": "Piccadilly",
"type": "tts",
"typeReason": "data_available",
"description": "Minor Delays",
"officialReasons": [],
"isConfirmation": false,
"isCorrection": true,
"correction": {
"original": "Good Service",
"new": "Minor Delays",
"confidence": "high"
},
"outbound": "Severe Delays",
"inbound": "Good Service",
"created": 1651248860127,
"expires": 1651249167285
},
{
"id": "626adf917b58e026f77680d2",
"line": "victoria",
"lineName": "Victoria",
"type": "tts",
"typeReason": "data_available",
"description": "Good Service",
"officialReasons": [],
"isConfirmation": true,
"isCorrection": false,
"correction": {},
"outbound": "Good Service",
"inbound": "Good Service",
"created": 1651248860127,
"expires": 1651249167285
},
{
"id": "626ac447e4607580cf7ea1b5",
"line": "waterloo-city",
"lineName": "Waterloo & City",
"type": "tfl",
"typeReason": "line_unsupported",
"description": "Good Service",
"officialReasons": [],
"isConfirmation": false,
"isCorrection": false,
"correction": {},
"created": 1651248860127,
"expires": 1651249167285
}
]
This endpoint retrieves all status updates.
HTTP Request
GET https://apis.truetubestatus.com/real-time/beta/statusUpdates
Parameters
A query parameter of line will return a status update for the appropriate line only. For example, GET https://apis.truetubestatus.com/real-time/beta/statusUpdates?line=metropolitan will only return a status update object corresponding to the Metropolitan line.
Data Queries
Get data
Example request:
curl "https://apis.truetubestatus.com/real-time/beta/data?lines=central%2Cdistrict&metrics=journeyDelayPercent" \
-H "x-api-key: EXAMPLE_KEY"
var request = require('request');
var url = 'https://apis.truetubestatus.com/real-time/beta/data?lines=' + encodeURIComponent('central,district') + '&metrics=journeyDelayPercent'
request.get({
url: url,
headers: { 'x-api-key': 'EXAMPLE_KEY' },
json: true
}, function(err, response, body) {
...
Example response:
{ "query":
{ "lines": "central,district",
"segments": null,
"metrics": "journeyDelayPercent",
"startDate": 1653319867215,
"endDate": 1653321067215,
"period": "minute" },
"results":
[ { "timestamp": 1653319920000,
"line": "district",
"journeyDelayPercent": 16.984685642297976 },
{ "timestamp": 1653319920000,
"line": "central",
"journeyDelayPercent": 17.324615944586142 },
{ "timestamp": 1653319980000,
"line": "central",
"journeyDelayPercent": 16.15692659041457 },
{ "timestamp": 1653319980000,
"line": "district",
"journeyDelayPercent": 16.177244795631537 },
{ "timestamp": 1653320040000,
"line": "district",
"journeyDelayPercent": 13.732211644933784 },
{ "timestamp": 1653320040000,
"line": "central",
"journeyDelayPercent": 17.389651424032422 },
{ "timestamp": 1653320100000,
"line": "central",
"journeyDelayPercent": 18.122668345402744 },
{ "timestamp": 1653320160000,
"line": "central",
"journeyDelayPercent": 16.308938889450843 },
{ "timestamp": 1653320160000,
"line": "district",
"journeyDelayPercent": 13.117197025594066 },
{ "timestamp": 1653320220000,
"line": "district",
"journeyDelayPercent": 14.651950497662526 },
{ "timestamp": 1653320220000,
"line": "central",
"journeyDelayPercent": 15.194338228882344 },
{ "timestamp": 1653320280000,
"line": "district",
"journeyDelayPercent": 16.169074896565732 },
{ "timestamp": 1653320280000,
"line": "central",
"journeyDelayPercent": 14.530245458409908 },
{ "timestamp": 1653320340000,
"line": "district",
"journeyDelayPercent": 16.684552659997195 },
{ "timestamp": 1653320340000,
"line": "central",
"journeyDelayPercent": 16.439251619305665 },
{ "timestamp": 1653320400000,
"line": "central",
"journeyDelayPercent": 15.530805132235614 },
{ "timestamp": 1653320400000,
"line": "district",
"journeyDelayPercent": 14.659113040093956 },
{ "timestamp": 1653320460000,
"line": "central",
"journeyDelayPercent": 15.040720451740114 },
{ "timestamp": 1653320460000,
"line": "district",
"journeyDelayPercent": 12.351789550268506 },
{ "timestamp": 1653320520000,
"line": "central",
"journeyDelayPercent": 16.431055651252734 },
{ "timestamp": 1653320520000,
"line": "district",
"journeyDelayPercent": 13.632456492020026 },
{ "timestamp": 1653320580000,
"line": "district",
"journeyDelayPercent": 13.400540836443085 },
{ "timestamp": 1653320580000,
"line": "central",
"journeyDelayPercent": 17.38526280087575 },
{ "timestamp": 1653320640000,
"line": "central",
"journeyDelayPercent": 12.812449862869911 },
{ "timestamp": 1653320640000,
"line": "district",
"journeyDelayPercent": 12.75628532902509 },
{ "timestamp": 1653320700000,
"line": "district",
"journeyDelayPercent": 12.587892328559661 },
{ "timestamp": 1653320700000,
"line": "central",
"journeyDelayPercent": 12.50572565201513 },
{ "timestamp": 1653320760000,
"line": "district",
"journeyDelayPercent": 14.466093020137109 },
{ "timestamp": 1653320760000,
"line": "central",
"journeyDelayPercent": 13.369067086624199 },
{ "timestamp": 1653320820000,
"line": "central",
"journeyDelayPercent": 11.327467198317791 },
{ "timestamp": 1653320820000,
"line": "district",
"journeyDelayPercent": 14.358144733874227 },
{ "timestamp": 1653320880000,
"line": "central",
"journeyDelayPercent": 11.513722896198985 },
{ "timestamp": 1653320880000,
"line": "district",
"journeyDelayPercent": 13.663414479023501 },
{ "timestamp": 1653320940000,
"line": "district",
"journeyDelayPercent": 12.671727911896696 },
{ "timestamp": 1653320940000,
"line": "central",
"journeyDelayPercent": 12.218845820718613 },
{ "timestamp": 1653321000000,
"line": "district",
"journeyDelayPercent": 12.104669365665828 },
{ "timestamp": 1653321000000,
"line": "central",
"journeyDelayPercent": 11.341470236357736 },
{ "timestamp": 1653321060000,
"line": "district",
"journeyDelayPercent": 12.853522273312862 } ]
}
This endpoint lets you query performance data for lines and line segments (subsections of lines).
HTTP Request
GET https://apis.truetubestatus.com/real-time/beta/data?lines={lines}&metrics={metrics}
Replace {lines} with a comma-separated list of lines and {metrics} with a comma-separated list of metrics. (See below for the metrics currently available.)
Parameters reference
The following query parameters can be passed to this endpoint.
lines required
A comma-separated list of lines (e.g. bakerloo,central or bakerloo%2Ccentral when percent-encoded)
Valid line values are bakerloo, central, circle, district, hammersmith-city, jubilee, metropolitan, northern, piccadilly or victoria. (waterloo-city isn't currently supported.)
segments optional
A comma-separated list of line segment numbers (e.g. 1,2 or 1%2C2 when percent-encoded), or all. Line segment numbers are positive integers corresponding to subsections of Tube lines. You can learn more about line segments and how to retrieve them below.
Use this parameter to retrieve data at the line segment level. Exclude this parameter from your request to retrieve data at the line level.
metrics required
A comma-separated list of metrics (e.g. journeyDelayPercent,waitDelayPercent or journeyDelayPercent%2CwaitDelayPercent when percent-encoded).
Valid metric values are as follows:
| Value | Meaning |
|---|---|
| journeyDelayPercent | Overall journey delay in percentage points. A lookback window of 12.5 minutes is used to estimate the running delay component of the journey delay. For more information see the methodology. |
| outboundJourneyDelayPercent | Same as journeyDelayPercent but in the outbound direction only. (See below for what 'outbound' means as a compass direction for each line.) |
| inboundJourneyDelayPercent | Same as journeyDelayPercent but in the inbound direction only. (See below for what 'inbound' means as a compass direction for each line.) |
| waitDelayPercent | Delay to the wait portion of the journey in percentage points. For more information see the methodology. |
| outboundWaitDelayPercent | Same as waitDelayPercent but in the outbound direction only. (See below for what 'outbound' means as a compass direction for each line.) |
| inboundWaitDelayPercent | Same as waitDelayPercent but in the inbound direction only. (See below for what 'inbound' means as a compass direction for each line.) |
| runningDelayPercent | Delay to the running time portion of the journey in percentage points. A lookback window of 12.5 minutes is used to estimate the running delay component of the journey delay. For more information see the methodology. (Note: If you query this metric along with journeyDelayPercent, and only get back a value for journeyDelayPercent, it means the system hasn't seen running time activity during the lookback window.) |
| outboundRunningDelayPercent | Same as runningDelayPercent but in the outbound direction only. (See below for what 'outbound' means as a compass direction for each line.) |
| inboundRunningDelayPercent | Same as runningDelayPercent but in the inbound direction only. (See below for what 'inbound' means as a compass direction for each line.) |
More metrics to be added soon.
See the below table for how inbound and outbound directions map to compass directions:
| line id | outbound | inbound |
|---|---|---|
| bakerloo | Northbound | Southbound |
| central | Eastbound | Westbound |
| circle | Clockwise | Anti-clockwise |
| district | Eastbound | Westbound |
| hammersmith-city | Eastbound | Westbound |
| jubilee | Southbound | Northbound |
| metropolitan | Southbound | Northbound |
| northern | Northbound | Southbound |
| piccadilly | Eastbound | Westbound |
| victoria | Northbound | Southbound |
startDate optional
The start of the date range to retrieve data points for, formatted as the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC (e.g. 1651248860127).
endDate optional
The end of the date range to retrieve data points for, formatted as the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC (e.g. 1653321067215).
period optional
The length of time that returned data points refer to (e.g. minute for minutely data points).
Response object
Example query response object:
{ "query":
{ "lines": "central,district",
"segments": null,
"metrics": "journeyDelayPercent",
"startDate": 1653319867215,
"endDate": 1653321067215,
"period": "minute" },
"results":
[ { "timestamp": 1653319920000,
"line": "district",
"journeyDelayPercent": 16.984685642297976 },
{ "timestamp": 1653319920000,
"line": "central",
"journeyDelayPercent": 17.324615944586142 },
{ "timestamp": 1653319980000,
"line": "central",
"journeyDelayPercent": 16.15692659041457 },
{ "timestamp": 1653319980000,
"line": "district",
"journeyDelayPercent": 16.177244795631537 },
{ "timestamp": 1653320040000,
"line": "district",
"journeyDelayPercent": 13.732211644933784 },
{ "timestamp": 1653320040000,
"line": "central",
"journeyDelayPercent": 17.389651424032422 },
{ "timestamp": 1653320100000,
"line": "central",
"journeyDelayPercent": 18.122668345402744 },
{ "timestamp": 1653320160000,
"line": "central",
"journeyDelayPercent": 16.308938889450843 },
{ "timestamp": 1653320160000,
"line": "district",
"journeyDelayPercent": 13.117197025594066 },
{ "timestamp": 1653320220000,
"line": "district",
"journeyDelayPercent": 14.651950497662526 },
{ "timestamp": 1653320220000,
"line": "central",
"journeyDelayPercent": 15.194338228882344 },
{ "timestamp": 1653320280000,
"line": "district",
"journeyDelayPercent": 16.169074896565732 },
{ "timestamp": 1653320280000,
"line": "central",
"journeyDelayPercent": 14.530245458409908 },
{ "timestamp": 1653320340000,
"line": "district",
"journeyDelayPercent": 16.684552659997195 },
{ "timestamp": 1653320340000,
"line": "central",
"journeyDelayPercent": 16.439251619305665 },
{ "timestamp": 1653320400000,
"line": "central",
"journeyDelayPercent": 15.530805132235614 },
{ "timestamp": 1653320400000,
"line": "district",
"journeyDelayPercent": 14.659113040093956 },
{ "timestamp": 1653320460000,
"line": "central",
"journeyDelayPercent": 15.040720451740114 },
{ "timestamp": 1653320460000,
"line": "district",
"journeyDelayPercent": 12.351789550268506 },
{ "timestamp": 1653320520000,
"line": "central",
"journeyDelayPercent": 16.431055651252734 },
{ "timestamp": 1653320520000,
"line": "district",
"journeyDelayPercent": 13.632456492020026 },
{ "timestamp": 1653320580000,
"line": "district",
"journeyDelayPercent": 13.400540836443085 },
{ "timestamp": 1653320580000,
"line": "central",
"journeyDelayPercent": 17.38526280087575 },
{ "timestamp": 1653320640000,
"line": "central",
"journeyDelayPercent": 12.812449862869911 },
{ "timestamp": 1653320640000,
"line": "district",
"journeyDelayPercent": 12.75628532902509 },
{ "timestamp": 1653320700000,
"line": "district",
"journeyDelayPercent": 12.587892328559661 },
{ "timestamp": 1653320700000,
"line": "central",
"journeyDelayPercent": 12.50572565201513 },
{ "timestamp": 1653320760000,
"line": "district",
"journeyDelayPercent": 14.466093020137109 },
{ "timestamp": 1653320760000,
"line": "central",
"journeyDelayPercent": 13.369067086624199 },
{ "timestamp": 1653320820000,
"line": "central",
"journeyDelayPercent": 11.327467198317791 },
{ "timestamp": 1653320820000,
"line": "district",
"journeyDelayPercent": 14.358144733874227 },
{ "timestamp": 1653320880000,
"line": "central",
"journeyDelayPercent": 11.513722896198985 },
{ "timestamp": 1653320880000,
"line": "district",
"journeyDelayPercent": 13.663414479023501 },
{ "timestamp": 1653320940000,
"line": "district",
"journeyDelayPercent": 12.671727911896696 },
{ "timestamp": 1653320940000,
"line": "central",
"journeyDelayPercent": 12.218845820718613 },
{ "timestamp": 1653321000000,
"line": "district",
"journeyDelayPercent": 12.104669365665828 },
{ "timestamp": 1653321000000,
"line": "central",
"journeyDelayPercent": 11.341470236357736 },
{ "timestamp": 1653321060000,
"line": "district",
"journeyDelayPercent": 12.853522273312862 } ]
}
The response object has a query hash and a results array (consisting of data point objects).
query object
This object shows the parameters in the request, or the defaults used.
results array
An array of data point objects. Data point objects are populated with properties in the metrics field of the query hash (e.g. property journeyDelayPercent with value 14), as well as the following:
| Property | Explanation |
|---|---|
| timestamp | The date that the data point object corresponds to, stored as the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC. |
| line | The line that the data point object corresponds to (see possible values above). |
| segment | The segment number of the line segment that the data point object corresponds to (see below for more about line segments). If not present or null, the data point object refers to the entire line. |
Line Segments
The line segment object
Example line segment object:
{
"id": "central-1",
"line": "central",
"number": 1,
"startStation": "West Ruislip",
"endStation": "Northolt",
"prev": [],
"next": [2]
}
Line segment objects describe subsections of Tube lines. The number attribute of the line segment object can be used in data queries. You can expect line segment objects to be stable over time. Attributes are as follows.
id string
The ID of the line segment. The ID consists of the TfL ID of the Tube line followed by a dash (-), followed by the number attribute of the segment (for example bakerloo-1).
line string
The TfL ID of the line. Can be bakerloo, central, circle, district, hammersmith-city, jubilee, metropolitan, northern, piccadilly, victoria. (waterloo-city isn't currently supported.)
number number
A positive integer representing the number of the line segment (e.g. 1).
startStation string
The name of the start station of the line segment (e.g. West Ruislip). Line segments are oriented in the outbound direction of the line. See above for what 'outbound' means for each Tube line.
endStation string
The name of the end station of the line segment (e.g. Northolt). Line segments are oriented in the outbound direction of the line. See above for what 'outbound' means for each Tube line.
prev array
An array of line segment numbers. These refer to the line segments that precede the line segment object (if any). The endStation of the line segments referred to will match the startStation of this line segment.
next array
An array of line segment numbers. These refer to the line segments that succeed the line segment object (if any). The startStation of the line segments referred to will match the endStation of this line segment.
List all line segments
Example request:
curl "https://apis.truetubestatus.com/real-time/beta/lineSegments?line=central" \
-H "x-api-key: EXAMPLE_KEY"
var request = require('request');
request.get({
url: 'https://apis.truetubestatus.com/real-time/beta/lineSegments?line=central',
headers: { 'x-api-key': 'EXAMPLE_KEY' },
json: true
}, function(err, response, body) {
...
Example response:
[
{
"id": "central-1",
"line": "central",
"number": 1,
"startStation": "West Ruislip",
"endStation": "Northolt",
"prev": [],
"next": [
2
]
},
{
"id": "central-2",
"line": "central",
"number": 2,
"startStation": "Northolt",
"endStation": "North Acton",
"prev": [
1
],
"next": [
4
]
},
{
"id": "central-3",
"line": "central",
"number": 3,
"startStation": "Ealing Broadway",
"endStation": "North Acton",
"prev": [],
"next": [
4
]
},
{
"id": "central-4",
"line": "central",
"number": 4,
"startStation": "North Acton",
"endStation": "Notting Hill Gate",
"prev": [
2,
3
],
"next": [
5
]
},
{
"id": "central-5",
"line": "central",
"number": 5,
"startStation": "Notting Hill Gate",
"endStation": "Tottenham Court Road",
"prev": [
4
],
"next": [
6
]
},
{
"id": "central-6",
"line": "central",
"number": 6,
"startStation": "Tottenham Court Road",
"endStation": "Liverpool Street",
"prev": [
5
],
"next": [
7
]
},
{
"id": "central-7",
"line": "central",
"number": 7,
"startStation": "Liverpool Street",
"endStation": "Leytonstone",
"prev": [
6
],
"next": [
8,
9
]
},
{
"id": "central-8",
"line": "central",
"number": 8,
"startStation": "Leytonstone",
"endStation": "Hainault",
"prev": [
7
],
"next": []
},
{
"id": "central-9",
"line": "central",
"number": 9,
"startStation": "Leytonstone",
"endStation": "Woodford",
"prev": [
7
],
"next": [
10,
12
]
},
{
"id": "central-10",
"line": "central",
"number": 10,
"startStation": "Woodford",
"endStation": "Loughton",
"prev": [
9
],
"next": [
11
]
},
{
"id": "central-11",
"line": "central",
"number": 11,
"startStation": "Loughton",
"endStation": "Epping",
"prev": [
10
],
"next": []
},
{
"id": "central-12",
"line": "central",
"number": 12,
"startStation": "Woodford",
"endStation": "Hainault",
"prev": [
9
],
"next": []
}
]
This endpoint retrieves all line segments.
HTTP Request
GET https://apis.truetubestatus.com/real-time/beta/lineSegments
Parameters
A query parameter of line will return the line segment objects for the appropriate line only. For example, GET https://apis.truetubestatus.com/real-time/beta/lineSegments?line=metropolitan will only return line segment objects corresponding to the Metropolitan line.
Errors
The API uses the following error codes:
| Error Code | Meaning |
|---|---|
| 400 | Bad Request -- Your request is invalid. |
| 403 | Forbidden -- Insufficient permissions to retrieve the requested resource. |
| 404 | Not Found -- The specified resource could not be found. |
| 429 | Too Many Requests -- You've exceeded the requests per second rate included in your plan. |
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
