Transport for London API: Plan a London journey
Plans a London public transport journey between two places, stations, addresses or postcodes with the TfL Journey Planner, leaving or arriving at a given time. Returns journey options in TfL order with leg directions and an adult pay-as-you-go fare when available.
Unofficial. Not affiliated with or endorsed by Transport for London.
Inputs
Values from the run on Oct 31, 2026, shown under Output.
- Modes optional
modes Transport modes to include; omit for all public transport. Example: ["tube", "bus"].
- bus
List of text. One of
tube,bus,overground,elizabeth_line,dlr,national_rail.- Origin, required
origin From: London address, station, place or postcode. Example: King's Cross.
SW1A 1AA
- Time Is optional
time_is Whether the specified time is when you leave or arrive. Example: departing.
arriving
One of
departing,arriving. Defaultdeparting.- Date Time optional
date_time London local departure or arrival date and time as ISO 8601, or now. Example: 2026-09-30T12:00:00+01:00.
now
Default
now.- Destination, required
destination To: London address, station, place or postcode. Example: Brixton.
SE1 7PB
- Max Results optional
max_results Most journey options to show, in TfL order. Example: 3.
2
Whole number from 1 to 10. Default
3.
Input as JSON
{ "modes": [ "bus" ], "origin": "SW1A 1AA", "time_is": "arriving", "date_time": "now", "destination": "SE1 7PB", "max_results": 2}Output
{ "journeys": [ { "legs": [ { "mode": "walking", "to_stop": "St James's Park Station", "leg_time": "10 min", "from_stop": "SW1A 1AA", "line_name": null, "instruction": "Walk to St James's Park Station", "time_minutes": 10 }, { "mode": "bus", "to_stop": "St Thomas' Hospital / County Hall", "leg_time": "0 min", "from_stop": "St James's Park Station", "line_name": "148", "instruction": "Take 148 bus to St Thomas' Hospital / County Hall", "time_minutes": 0 }, { "mode": "walking", "to_stop": "SE1 7PB", "leg_time": "5 min", "from_stop": "St Thomas' Hospital / County Hall", "line_name": null, "instruction": "Walk to SE1 7PB", "time_minutes": 5 } ], "page_link": "https://tfl.gov.uk/plan-a-journey/results?InputFrom=SW1A+1AA&InputTo=SE1+7PB&Date=20260930&Time=1200&TimeIs=arriving" , "total_time": "15 min", "arrival_time": "2026-09-30T11:40:00+01:00", "time_minutes": 15, "fare_currency": "GBP", "departure_time": "2026-09-30T11:25:00+01:00", "adult_pay_as_you_go_fare_gbp": 1.75 }, { "legs": [ { "mode": "walking", "to_stop": "St James's Park Station", "leg_time": "10 min", "from_stop": "SW1A 1AA", "line_name": null, "instruction": "Walk to St James's Park Station", "time_minutes": 10 }, { "mode": "bus", "to_stop": "St Thomas' Hospital / County Hall", "leg_time": "2 min", "from_stop": "St James's Park Station", "line_name": "11", "instruction": "Take 11 bus to St Thomas' Hospital / County Hall", "time_minutes": 2 }, { "mode": "walking", "to_stop": "SE1 7PB", "leg_time": "5 min", "from_stop": "St Thomas' Hospital / County Hall", "line_name": null, "instruction": "Walk to SE1 7PB", "time_minutes": 5 } ], "page_link": "https://tfl.gov.uk/plan-a-journey/results?InputFrom=SW1A+1AA&InputTo=SE1+7PB&Date=20260930&Time=1200&TimeIs=arriving" , "total_time": "17 min", "arrival_time": "2026-09-30T11:42:00+01:00", "time_minutes": 17, "fare_currency": "GBP", "departure_time": "2026-09-30T11:25:00+01:00", "adult_pay_as_you_go_fare_gbp": 1.75 } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"tfl.gov.uk/plan_journey","input":{"modes":["bus"],"origin":"SW1A 1AA","time_is":"arriving","date_time":"now","destination":"SE1 7PB","max_results":2}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "tfl.gov.uk/plan_journey" , "input": { "modes": [ "bus" ], "origin": "SW1A 1AA", "time_is": "arriving", "date_time": "now", "destination": "SE1 7PB", "max_results": 2 }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "tfl.gov.uk/plan_journey" , "input": { "modes": [ "bus" ], "origin": "SW1A 1AA", "time_is": "arriving", "date_time": "now", "destination": "SE1 7PB", "max_results": 2 } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run tfl.gov.uk/plan_journey# with {"modes":["bus"],"origin":"SW1A 1AA","time_is":"arriving","date_time":"now","destination":"SE1 7PB","max_results":2}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "origin", "destination" ], "properties": { "modes": { "type": "array", "items": { "enum": [ "tube", "bus", "overground", "elizabeth_line", "dlr", "national_rail" ], "type": "string" }, "description": "Transport modes to include; omit for all public transport. Example: [\"tube\", \"bus\"]." }, "origin": { "type": "string", "description": "From: London address, station, place or postcode. Example: King's Cross." }, "time_is": { "enum": [ "departing", "arriving" ], "type": "string", "default": "departing", "description": "Whether the specified time is when you leave or arrive. Example: departing." }, "date_time": { "type": "string", "default": "now", "description": "London local departure or arrival date and time as ISO 8601, or now. Example: 2026-09-30T12:00:00+01:00." }, "destination": { "type": "string", "description": "To: London address, station, place or postcode. Example: Brixton." }, "max_results": { "type": "integer", "default": 3, "maximum": 10, "minimum": 1, "description": "Most journey options to show, in TfL order. Example: 3." } }}Output schema
{ "type": "object", "required": [ "journeys" ], "properties": { "journeys": { "type": "array", "items": { "type": "object", "required": [ "departure_time", "arrival_time", "total_time", "adult_pay_as_you_go_fare_gbp", "fare_currency", "legs", "page_link", "time_minutes" ], "properties": { "legs": { "type": "array", "items": { "type": "object", "required": [ "mode", "line_name", "from_stop", "to_stop", "leg_time", "instruction", "time_minutes" ], "properties": { "mode": { "type": [ "string", "null" ] }, "to_stop": { "type": [ "string", "null" ] }, "leg_time": { "type": "string" }, "from_stop": { "type": [ "string", "null" ] }, "line_name": { "type": [ "string", "null" ] }, "instruction": { "type": [ "string", "null" ] }, "time_minutes": { "type": "integer" } }, "additionalProperties": false } }, "page_link": { "type": "string" }, "total_time": { "type": "string" }, "arrival_time": { "type": "string" }, "time_minutes": { "type": "integer" }, "fare_currency": { "enum": [ "GBP" ], "type": "string" }, "departure_time": { "type": "string" }, "adult_pay_as_you_go_fare_gbp": { "type": [ "number", "null" ] } }, "additionalProperties": false } } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
tfl.gov.uk/plan_journey- Returns
- departure and arrival times, total time, adult pay-as-you-go fare, legs with mode, line, stops, time and instruction, TfL results link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method tfl.gov.uk/plan_journey with the inputs above.
Ask your agent
- How do I get from Paddington to Canary Wharf right now, and what's the pay-as-you-go fare?
- I need to arrive at SE1 9SG by 9:15am on 14 October 2025, starting from Walthamstow Central. Show me up to 4 options using only tube and bus.
- Use the TfL Journey Planner to find routes from Heathrow Terminal 5 to Liverpool Street leaving at 6pm this Friday, Elizabeth line preferred.
- On tfl.gov.uk, plan a trip from 221B Baker Street to the O2 Arena in Greenwich, departing 2025-11-08T19:30:00Z, with step-by-step leg directions.
- Fastest way from Clapham Junction to Stratford by Overground or DLR only, need to be there by 10am tomorrow — give me just the top option and how long it takes.
See more
All Transport for London methodsGets the current or future-day service status for London Tube, Elizabeth line, DLR, Overground, tram or a named bus route. Multiple notices on one line are combined into the most disruptive status.
tfl.gov.uk/get_line_statusGets up to three Google Maps routes between two places, with distances, travel times and step-by-step directions.
google.com/get_directionsFinds dated FlixBus trip options between two cities, with stops, local times, availability and displayed per-person prices, including partner operators on some routes.
flixbus.com/search_bus_tripsFinds priced flights between two cities or airports on Trip.com for the chosen dates, cheapest first; round trips pair each outbound flight with its available returns.
trip.com/search_flightsFinds Google Flights options for a route and date with prices, local times, stops and emissions. Round-trip searches list outbound choices with their displayed round-trip fares.
google.com/search_flightsConverts a meeting time in one city to local times in other cities, with time zones and 09:00-17:00 working-hours status. Supports dates from 1970 to 2030; ambiguous clock-change times use the first occurrence.
timeanddate.com/convert_time_between_citiesCompares living costs in two Numbeo cities: six price and purchasing-power differences, plus the monthly take-home salary needed in the destination for a similar standard of living (rent assumed in both cities).
numbeo.com/compare_cost_of_livingFinds Expedia flights between cities or airports on selected dates, with per-traveler USD prices. Round trips combine outbound and return choices; for round trips only the cheapest outbound choices are paired with their returns.
expedia.com/search_flights