TfL London Transit
Real-time London TfL transit data — Tube arrivals, bus predictions, line status, disruptions, journey planning, and route information. Uses TfL's single unified REST API for all modes. API key optional (free, recommended for higher rate limits).
When to Use
- User asks about the Tube, London Underground, TfL, or London public transport
- User mentions specific Tube lines (Bakerloo, Central, Circle, District, Hammersmith & City, Jubilee, Metropolitan, Northern, Piccadilly, Victoria, Waterloo & City)
- User asks "is the Northern line running" or "when's the next Tube"
- User mentions London stations (King's Cross, Oxford Circus, Waterloo, Victoria, Paddington, etc.)
- User asks about London buses, DLR, Overground, Elizabeth line, or trams
- User asks about TfL service status, delays, disruptions, or planned closures
- User asks about Oyster, contactless, or TfL fares
- User asks about journey planning in London
Data Sources
TfL has a single unified REST API (api.tfl.gov.uk) that returns JSON for ALL modes — Tube, bus, DLR, Overground, Elizabeth line, trams, river bus, cable car. No protobuf, no SIRI, no multiple feed formats. Just one clean REST API with consistent JSON responses.
API key: Register for a free app_key at https://api-portal.tfl.gov.uk/ — append ?app_key={KEY} to requests. The API works without a key for basic usage but is rate-limited; with a key you get 500 requests per minute.
Key Endpoints
| Endpoint |
Description |
/Line/Mode/tube/Status |
All Tube line statuses |
/Line/{lineId}/Status |
Specific line status |
/StopPoint/{naptanId}/Arrivals |
Arrivals at a stop |
/Line/{lineId}/Arrivals/{stopPointId} |
Arrivals filtered by line |
/StopPoint/Search/{query} |
Search stops by name |
/StopPoint?lat=&lon=&radius= |
Stops near location |
/Line/{lineId}/StopPoints |
Stops on a line |
/Line/{lineId}/Route/Sequence/{dir} |
Route stop sequence |
/Line/{lineId}/Disruption |
Disruptions on a line |
/Journey/JourneyResults/{from}/to/{to} |
Journey planning |
/Line/Mode/bus |
All bus routes |
All endpoints return JSON. Append ?app_key={KEY} for authenticated requests.
Implementation
Quick Start: Use the helper scripts
The scripts in this skill's scripts/ directory handle fetching, parsing, and presenting TfL data.
Script: scripts/tfl.mjs
Main entry point. Supports these commands:
# Tube line status
node scripts/tfl.mjs status
node scripts/tfl.mjs status --all
node scripts/tfl.mjs status --line victoria
# Arrivals at a station
node scripts/tfl.mjs arrivals --station "Oxford Circus"
node scripts/tfl.mjs arrivals --stop 940GZZLUOXC
node scripts/tfl.mjs arrivals --stop-search "kings cross"
node scripts/tfl.mjs arrivals --stop-search "kings cross" --line piccadilly
# Bus arrivals
node scripts/tfl.mjs bus-arrivals --stop 490005183E
node scripts/tfl.mjs bus-arrivals --stop-search "oxford circus"
node scripts/tfl.mjs bus-arrivals --stop-search "oxford circus" --route 24
# Disruptions
node scripts/tfl.mjs disruptions
node scripts/tfl.mjs disruptions --line northern
# Routes and stops
node scripts/tfl.mjs routes
node scripts/tfl.mjs routes --all
node scripts/tfl.mjs bus-routes
node scripts/tfl.mjs stops --search "waterloo"
node scripts/tfl.mjs stops --near 51.5074,-0.1278 --radius 500
node scripts/tfl.mjs stops --line victoria
node scripts/tfl.mjs route-info --line bakerloo
node scripts/tfl.mjs route-info --route 24
# Journey planning
node scripts/tfl.mjs journey --from "waterloo" --to "kings cross"
node scripts/tfl.mjs journey --from "51.5031,-0.1132" --to "51.5308,-0.1238"
Setup: API Key (Optional, Recommended)
Basic functionality works without a key (rate-limited). For 500 requests/minute:
- Register at https://api-portal.tfl.gov.uk/
- Set environment variable:
TFL_API_KEY
Tube Lines Reference
| Line ID |
Line Name |
Emoji |
Terminals |
| bakerloo |
Bakerloo |
brown |
Harrow & Wealdstone <-> Elephant & Castle |
| central |
Central |
red |
Epping / Ealing Broadway <-> West Ruislip |
| circle |
Circle |
yellow |
Hammersmith (loop via Liverpool Street) |
| district |
District |
green |
Richmond / Ealing Broadway <-> Upminster |
| hammersmith-city |
Hammersmith & City |
pink |
Hammersmith <-> Barking |
| jubilee |
Jubilee |
silver |
Stanmore <-> Stratford |
| metropolitan |
Metropolitan |
magenta |
Chesham / Amersham / Uxbridge <-> Aldgate |
| northern |
Northern |
black |
Edgware / High Barnet <-> Morden / Battersea |
| piccadilly |
Piccadilly |
dark blue |
Heathrow T5 / Uxbridge <-> Cockfosters |
| victoria |
Victoria |
light blue |
Walthamstow Central <-> Brixton |
| waterloo-city |
Waterloo & City |
teal |
Waterloo <-> Bank |
Other TfL Rail Modes
| Line ID |
Name |
Type |
| dlr |
DLR |
Docklands Light Railway |
| liberty |
Liberty |
Overground (Romford — Upminster) |
| lioness |
Lioness |
Overground (Watford — Euston) |
| mildmay |
Mildmay |
Overground (Stratford — Richmond/Clapham) |
| suffragette |
Suffragette |
Overground (Gospel Oak — Barking) |
| weaver |
Weaver |
Overground (Liverpool St — Enfield/Cheshunt/Chingford) |
| windrush |
Windrush |
Overground (Highbury — Crystal Palace/Clapham/W Croydon) |
| elizabeth |
Elizabeth line |
Crossrail |
| tram |
London Trams |
Croydon Tramlink |
TfL Fares Reference (from March 2025)
| Fare Type |
Price |
| Tube Zone 1 (Oyster/contactless, peak) |
£2.80 |
| Tube Zone 1 (Oyster/contactless, off-peak) |
£2.70 |
| Tube Zones 1-2 (peak) |
£2.80 |
| Tube Zones 1-2 (off-peak) |
£2.70 |
| Tube Zones 1-3 (peak) |
£3.50 |
| Tube Zones 1-3 (off-peak) |
£2.80 |
| Bus & Tram (any journey) |
£1.75 |
| Hopper fare (unlimited bus/tram within 1 hour) |
£1.75 total |
| Daily cap Zones 1-2 |
£8.90 |
| Weekly cap Zones 1-2 |
£44.70 |
| Cash single (ticket machine) |
£6.70 (Zone 1) |
Peak: Mon-Fri 6:30-9:30am and 4:00-7:00pm (except public holidays).
Tips for Users
- NaPTAN IDs are the station identifiers — Tube stations use
940GZZLU{code} format
- Use
--station or --stop-search for name-based lookups; use --stop for exact NaPTAN IDs
- Times are shown in 24-hour format (London convention)
- The
arrivals command uses timeToStation (seconds) from the TfL API for ETA
- Bus stops have their own NaPTAN IDs in
490{code} format
- Journey planning returns fare estimates when available
Error Handling
- If
TFL_API_KEY is not set, requests still work but are rate-limited — a note is printed
- 429 rate limit responses print a helpful message with the key signup URL
- Invalid station/stop searches show "No matching station found" with suggestions
- Network errors and API error responses produce friendly messages
- Station closed or no service shows an appropriate message
Response Formatting
When presenting transit info to the user:
- Lead with the most actionable info (next arrival time, line status)
- Show line name with color emoji (e.g., "🔴 Central: Good Service")
- Show times in 24-hour format (London convention)
- For arrivals: show line + destination + minutes (from
timeToStation / 60)
- Show platform name when available
- For journey planning: show step-by-step with mode, line, duration, and fare
- Always mention disruptions for queried lines
External Endpoints
| Endpoint |
Data Sent |
Data Received |
api.tfl.gov.uk/Line/*/Status |
API key (query param, optional) |
Line status (JSON) |
api.tfl.gov.uk/StopPoint/*/Arrivals |
API key (query param, optional) |
Arrivals (JSON) |
api.tfl.gov.uk/StopPoint/Search/* |
API key (query param, optional) |
Stop search results (JSON) |
api.tfl.gov.uk/StopPoint?lat=&lon= |
API key (query param, optional) |
Nearby stops (JSON) |
api.tfl.gov.uk/Line/*/StopPoints |
API key (query param, optional) |
Stops on line (JSON) |
api.tfl.gov.uk/Line/*/Route/Sequence/* |
API key (query param, optional) |
Route sequence (JSON) |
api.tfl.gov.uk/Line/*/Disruption |
API key (query param, optional) |
Disruptions (JSON) |
api.tfl.gov.uk/Journey/JourneyResults/* |
API key (query param, optional) |
Journey results (JSON) |
api.tfl.gov.uk/Line/Mode/bus |
API key (query param, optional) |
Bus routes (JSON) |
API key is passed as a query parameter to TfL's official API. No other user data is transmitted.
Security & Privacy
- API key optional — TfL Unified API works without a key (rate-limited); with a free key you get 500 req/min
- No user data transmitted — requests contain only the optional API key and route/stop identifiers, no personal information
- No local storage — this skill does not write any files to disk (no GTFS cache needed — TfL is all live API)
- No telemetry — this skill does not phone home or collect usage data
- Input handling — stop names and route IDs from user input are URL-encoded in API queries, never interpolated into shell commands
Trust Statement
This skill reads publicly available transit data from TfL's official Unified API. The optional API key is used only for TfL API rate-limit authentication. The skill does not access, store, or transmit any personal information beyond the API key configured by the user.
1---
2name: tfl
3description: London TfL transit — real-time Tube arrivals, bus predictions, line status, service disruptions, journey planning, and route info for the London Underground, DLR, Overground, Elizabeth line, and buses. Use when the user asks about London public transport, Tube times, bus arrivals, or TfL service status.
4homepage: "https://github.com/brianleach/tfl-skill"
5license: MIT
6metadata:
7 source: https://skillmd.com/skills/modbender/tfl
8 openclaw:
9 emoji: "\U0001F1EC\U0001F1E7"
10 tags: [transit, london, tfl, transportation, tube, underground, bus, train, schedule]
11 primaryEnv: TFL_API_KEY
12 requires:
13 bins: ["node"]
14 files: ["scripts/tfl.mjs"]
15---
16
17# TfL London Transit
18
19Real-time London TfL transit data — Tube arrivals, bus predictions, line status, disruptions, journey planning, and route information. Uses TfL's single unified REST API for all modes. API key optional (free, recommended for higher rate limits).
20
21## When to Use
22
23- User asks about the Tube, London Underground, TfL, or London public transport
24- User mentions specific Tube lines (Bakerloo, Central, Circle, District, Hammersmith & City, Jubilee, Metropolitan, Northern, Piccadilly, Victoria, Waterloo & City)
25- User asks "is the Northern line running" or "when's the next Tube"
26- User mentions London stations (King's Cross, Oxford Circus, Waterloo, Victoria, Paddington, etc.)
27- User asks about London buses, DLR, Overground, Elizabeth line, or trams
28- User asks about TfL service status, delays, disruptions, or planned closures
29- User asks about Oyster, contactless, or TfL fares
30- User asks about journey planning in London
31
32## Data Sources
33
34TfL has a **single unified REST API** (`api.tfl.gov.uk`) that returns JSON for ALL modes — Tube, bus, DLR, Overground, Elizabeth line, trams, river bus, cable car. No protobuf, no SIRI, no multiple feed formats. Just one clean REST API with consistent JSON responses.
35
36**API key:** Register for a free `app_key` at https://api-portal.tfl.gov.uk/ — append `?app_key={KEY}` to requests. The API works without a key for basic usage but is rate-limited; with a key you get 500 requests per minute.
37
38### Key Endpoints
39
40| Endpoint | Description |
41|----------|-------------|
42| `/Line/Mode/tube/Status` | All Tube line statuses |
43| `/Line/{lineId}/Status` | Specific line status |
44| `/StopPoint/{naptanId}/Arrivals` | Arrivals at a stop |
45| `/Line/{lineId}/Arrivals/{stopPointId}` | Arrivals filtered by line |
46| `/StopPoint/Search/{query}` | Search stops by name |
47| `/StopPoint?lat=&lon=&radius=` | Stops near location |
48| `/Line/{lineId}/StopPoints` | Stops on a line |
49| `/Line/{lineId}/Route/Sequence/{dir}` | Route stop sequence |
50| `/Line/{lineId}/Disruption` | Disruptions on a line |
51| `/Journey/JourneyResults/{from}/to/{to}` | Journey planning |
52| `/Line/Mode/bus` | All bus routes |
53
54All endpoints return JSON. Append `?app_key={KEY}` for authenticated requests.
55
56## Implementation
57
58### Quick Start: Use the helper scripts
59
60The scripts in this skill's `scripts/` directory handle fetching, parsing, and presenting TfL data.
61
62### Script: `scripts/tfl.mjs`
63
64Main entry point. Supports these commands:
65
66```bash
67# Tube line status
68node scripts/tfl.mjs status
69node scripts/tfl.mjs status --all
70node scripts/tfl.mjs status --line victoria
71
72# Arrivals at a station
73node scripts/tfl.mjs arrivals --station "Oxford Circus"
74node scripts/tfl.mjs arrivals --stop 940GZZLUOXC
75node scripts/tfl.mjs arrivals --stop-search "kings cross"
76node scripts/tfl.mjs arrivals --stop-search "kings cross" --line piccadilly
77
78# Bus arrivals
79node scripts/tfl.mjs bus-arrivals --stop 490005183E
80node scripts/tfl.mjs bus-arrivals --stop-search "oxford circus"
81node scripts/tfl.mjs bus-arrivals --stop-search "oxford circus" --route 24
82
83# Disruptions
84node scripts/tfl.mjs disruptions
85node scripts/tfl.mjs disruptions --line northern
86
87# Routes and stops
88node scripts/tfl.mjs routes
89node scripts/tfl.mjs routes --all
90node scripts/tfl.mjs bus-routes
91node scripts/tfl.mjs stops --search "waterloo"
92node scripts/tfl.mjs stops --near 51.5074,-0.1278 --radius 500
93node scripts/tfl.mjs stops --line victoria
94node scripts/tfl.mjs route-info --line bakerloo
95node scripts/tfl.mjs route-info --route 24
96
97# Journey planning
98node scripts/tfl.mjs journey --from "waterloo" --to "kings cross"
99node scripts/tfl.mjs journey --from "51.5031,-0.1132" --to "51.5308,-0.1238"
100```
101
102### Setup: API Key (Optional, Recommended)
103
104Basic functionality works without a key (rate-limited). For 500 requests/minute:
105
1061. Register at https://api-portal.tfl.gov.uk/
1072. Set environment variable: `TFL_API_KEY`
108
109### Tube Lines Reference
110
111| Line ID | Line Name | Emoji | Terminals |
112|---------|-----------|-------|-----------|
113| bakerloo | Bakerloo | brown | Harrow & Wealdstone <-> Elephant & Castle |
114| central | Central | red | Epping / Ealing Broadway <-> West Ruislip |
115| circle | Circle | yellow | Hammersmith (loop via Liverpool Street) |
116| district | District | green | Richmond / Ealing Broadway <-> Upminster |
117| hammersmith-city | Hammersmith & City | pink | Hammersmith <-> Barking |
118| jubilee | Jubilee | silver | Stanmore <-> Stratford |
119| metropolitan | Metropolitan | magenta | Chesham / Amersham / Uxbridge <-> Aldgate |
120| northern | Northern | black | Edgware / High Barnet <-> Morden / Battersea |
121| piccadilly | Piccadilly | dark blue | Heathrow T5 / Uxbridge <-> Cockfosters |
122| victoria | Victoria | light blue | Walthamstow Central <-> Brixton |
123| waterloo-city | Waterloo & City | teal | Waterloo <-> Bank |
124
125### Other TfL Rail Modes
126
127| Line ID | Name | Type |
128|---------|------|------|
129| dlr | DLR | Docklands Light Railway |
130| liberty | Liberty | Overground (Romford — Upminster) |
131| lioness | Lioness | Overground (Watford — Euston) |
132| mildmay | Mildmay | Overground (Stratford — Richmond/Clapham) |
133| suffragette | Suffragette | Overground (Gospel Oak — Barking) |
134| weaver | Weaver | Overground (Liverpool St — Enfield/Cheshunt/Chingford) |
135| windrush | Windrush | Overground (Highbury — Crystal Palace/Clapham/W Croydon) |
136| elizabeth | Elizabeth line | Crossrail |
137| tram | London Trams | Croydon Tramlink |
138
139### TfL Fares Reference (from March 2025)
140
141| Fare Type | Price |
142|-----------|-------|
143| Tube Zone 1 (Oyster/contactless, peak) | £2.80 |
144| Tube Zone 1 (Oyster/contactless, off-peak) | £2.70 |
145| Tube Zones 1-2 (peak) | £2.80 |
146| Tube Zones 1-2 (off-peak) | £2.70 |
147| Tube Zones 1-3 (peak) | £3.50 |
148| Tube Zones 1-3 (off-peak) | £2.80 |
149| Bus & Tram (any journey) | £1.75 |
150| Hopper fare (unlimited bus/tram within 1 hour) | £1.75 total |
151| Daily cap Zones 1-2 | £8.90 |
152| Weekly cap Zones 1-2 | £44.70 |
153| Cash single (ticket machine) | £6.70 (Zone 1) |
154
155Peak: Mon-Fri 6:30-9:30am and 4:00-7:00pm (except public holidays).
156
157### Tips for Users
158
159- **NaPTAN IDs** are the station identifiers — Tube stations use `940GZZLU{code}` format
160- Use `--station` or `--stop-search` for name-based lookups; use `--stop` for exact NaPTAN IDs
161- Times are shown in 24-hour format (London convention)
162- The `arrivals` command uses `timeToStation` (seconds) from the TfL API for ETA
163- Bus stops have their own NaPTAN IDs in `490{code}` format
164- Journey planning returns fare estimates when available
165
166### Error Handling
167
168- If `TFL_API_KEY` is not set, requests still work but are rate-limited — a note is printed
169- 429 rate limit responses print a helpful message with the key signup URL
170- Invalid station/stop searches show "No matching station found" with suggestions
171- Network errors and API error responses produce friendly messages
172- Station closed or no service shows an appropriate message
173
174### Response Formatting
175
176When presenting transit info to the user:
177- Lead with the most actionable info (next arrival time, line status)
178- Show line name with color emoji (e.g., "🔴 Central: Good Service")
179- Show times in 24-hour format (London convention)
180- For arrivals: show line + destination + minutes (from `timeToStation / 60`)
181- Show platform name when available
182- For journey planning: show step-by-step with mode, line, duration, and fare
183- Always mention disruptions for queried lines
184
185## External Endpoints
186
187| Endpoint | Data Sent | Data Received |
188|----------|-----------|---------------|
189| `api.tfl.gov.uk/Line/*/Status` | API key (query param, optional) | Line status (JSON) |
190| `api.tfl.gov.uk/StopPoint/*/Arrivals` | API key (query param, optional) | Arrivals (JSON) |
191| `api.tfl.gov.uk/StopPoint/Search/*` | API key (query param, optional) | Stop search results (JSON) |
192| `api.tfl.gov.uk/StopPoint?lat=&lon=` | API key (query param, optional) | Nearby stops (JSON) |
193| `api.tfl.gov.uk/Line/*/StopPoints` | API key (query param, optional) | Stops on line (JSON) |
194| `api.tfl.gov.uk/Line/*/Route/Sequence/*` | API key (query param, optional) | Route sequence (JSON) |
195| `api.tfl.gov.uk/Line/*/Disruption` | API key (query param, optional) | Disruptions (JSON) |
196| `api.tfl.gov.uk/Journey/JourneyResults/*` | API key (query param, optional) | Journey results (JSON) |
197| `api.tfl.gov.uk/Line/Mode/bus` | API key (query param, optional) | Bus routes (JSON) |
198
199API key is passed as a query parameter to TfL's official API. No other user data is transmitted.
200
201## Security & Privacy
202
203- **API key optional** — TfL Unified API works without a key (rate-limited); with a free key you get 500 req/min
204- **No user data transmitted** — requests contain only the optional API key and route/stop identifiers, no personal information
205- **No local storage** — this skill does not write any files to disk (no GTFS cache needed — TfL is all live API)
206- **No telemetry** — this skill does not phone home or collect usage data
207- **Input handling** — stop names and route IDs from user input are URL-encoded in API queries, never interpolated into shell commands
208
209## Trust Statement
210
211This skill reads publicly available transit data from TfL's official Unified API. The optional API key is used only for TfL API rate-limit authentication. The skill does not access, store, or transmit any personal information beyond the API key configured by the user.