canonical: https://jentic.com/apis/api.digital.tfl.gov.uk/tfl

# Digital Tfl Transport for London Unified API

Jentic publishes the only available OpenAPI specification for Transport for London Unified API, keeping it validated and agent-ready. The TfL Unified API is the canonical source for live London transport data: tube and bus arrivals, line statuses and disruptions, journey-planner results, BikePoint availability, air-quality readings, accident statistics, road status, taxi and minicab contacts, and station details. Travel apps, journey planners, and London-focused agents use it to answer 'when is the next Victoria-line train?' and 'how do I get from King's Cross to Heathrow right now?'. Authentication uses paired app_id and app_key query parameters issued from the TfL portal.

## For AI agents

Get live London transport data - tube and bus arrivals, line status, journey planner, BikePoints, and disruptions - from TfL's Unified API. Authenticated via app_id and app_key.

## Scope

Does not handle ticket purchase, Oyster top-up, or fare payment - use for live arrivals, journey planning, line status, and BikePoint data only.

## Capabilities

- Plan a journey between two London locations via `/Journey/JourneyResults/{from}/to/{to}`
- Get live arrival predictions for any line and stop via `/Line/{ids}/Arrivals/{stopPointId}`
- Read current line status and disruptions via `/Line/Mode/{modes}/Status` and `/Line/Mode/{modes}/Disruption`
- List BikePoint locations and availability via /BikePoint and `/BikePoint/{id}`
- Read live air quality, accident stats by year, and road status feeds
- Search lines, stops, and taxi contacts by name or postcode

## Use cases

### Live Tube and Bus Arrivals

Power a 'next train' or 'next bus' display by calling `/Line/{ids}/Arrivals/{stopPointId}` with the line and stop ids. The response carries vehicle ids, current location, predicted arrival times, and platform information. Refresh every 30 seconds for a transit-style live board, or call on demand from a chat agent that answers 'when is my next train?'.

Example prompt: Call GET `/Line/victoria/Arrivals/940GZZLUKSX` to fetch the next Victoria-line arrivals at King's Cross and surface the top 3

### Door-to-Door Journey Planning

Ask the Unified API to plan a trip between any two London locations via `/Journey/JourneyResults/{from}/to/{to}.` It accepts station names, postcodes, addresses, and lat-long pairs, and returns multi-leg itineraries with walking, tube, bus, and rail segments plus durations and disruptions. This is the same engine that powers the official TfL journey planner.

Example prompt: Plan a journey from 'Paddington Station' to 'Canary Wharf' departing now and return the fastest option with leg-by-leg directions

### Disruption-Aware Commute Assistant

Surface relevant disruptions before someone leaves the office by polling `/Line/Mode/tube/Disruption` and `/Line/Mode/tube/Status.` Filter to lines on the user's commute and push a notification only when severity is meaningful. Pair with `/AccidentStats/{year}` for longer-term safety insights into specific roads and junctions.

Example prompt: Fetch `/Line/Mode/tube/Status` and notify when the Central or Jubilee line shows severity below 'Good Service'

### BikePoint Availability Map

Build a Santander Cycles companion app by reading /BikePoint to enumerate every dock and `/BikePoint/{id}` for live nbBikes, nbDocks, and nbSpaces. Filter by walking distance from the user's location and surface the closest BikePoint that has both bikes available and free spaces at the destination.

Example prompt: List BikePoints within 500m of lat 51.5074, lon -0.1278 with at least 3 bikes available and at least 3 empty docks

### AI Agent London Travel Concierge

An AI agent uses TfL via Jentic to answer London travel questions during chat, voice, or task-based interactions. The agent searches Jentic by intent, loads the journey-planner or arrivals schema, and executes the call with parameters extracted from the conversation. Jentic injects the app_id and app_key query parameters automatically.

Example prompt: Search Jentic for 'plan a journey across London', load the schema, and return the next departure for a Bond Street to Bank trip

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/Journey/JourneyResults/{from}/to/{to}` | Plan a journey between two locations |
| GET | `/Line/{ids}/Arrivals/{stopPointId}` | Live arrival predictions at a stop |
| GET | `/Line/Mode/{modes}/Status` | Line status by mode |
| GET | `/Line/Mode/{modes}/Disruption` | Disruptions by mode |
| GET | `/BikePoint` | List all BikePoints |
| GET | `/BikePoint/{id}` | Get a BikePoint with live availability |
| GET | `/AirQuality` | Get the air-quality data feed |
| GET | `/Line/Search/{query}` | Search lines and routes by query |

## Key resources

- **Journey** — Plan multi-modal journeys between London locations
- **Line** — Line status, disruptions, routes, and arrival predictions
- **StopPoint** — Stop and station details with mode and accessibility info
- **BikePoint** — Santander Cycles dock locations and live availability
- **AirQuality, AccidentStats, Cabwise** — Air-quality feeds, accident statistics, and taxi/minicab contact search

## Why Jentic

- **Setup:** Wiring the Transport for London Unified API by hand means handling its paired app_id and app_key query credentials and mapping the journey, line, arrival, and BikePoint routes across 84 endpoints yourself. Through Jentic you install once, import the TfL Unified API from the API Directory, store the keys once, and your agent calls it.
- **Permission scoping:** TfL selects live data through path and query parameters that identify lines and stops rather than an account resource, so you limit the agent to the operations it needs, such as planning a journey or reading line status. Broader operations like arrivals or BikePoint lookups are only available if you include them in the allowed set.
- **Credential handling:** Your TfL app_id and app_key are stored once, encrypted, by your own Jentic One instance and appended to every call at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'plan a London journey' or 'next tube arrivals at a stop', and Jentic returns the matching TfL operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **TfL API (legacy)** — The legacy api.tfl.gov.uk surface - superseded by api.digital.tfl.gov.uk but still in use in some integrations.
- **Transit App API** — Transit App provides multi-city public-transport data including London - useful when you need consistent coverage beyond TfL.
- **TomTom API** — TomTom adds road traffic and routing for car journeys that TfL's tube/bus focus does not cover.

## FAQ

### Why is there no official OpenAPI spec for Transport for London Unified API?

TfL publishes Swagger UI for the Unified API but does not maintain a downloadable OpenAPI specification suitable for code generation. Jentic generates and maintains this spec so that AI agents and developers can call Transport for London Unified API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the TfL Unified API use?

TfL uses paired API-key query parameters: `app_id` and `app_key`, both issued from the TfL API portal. Both are appended to every request URL. Jentic stores the pair in the encrypted vault and injects them into each call so agents never embed credentials in code.

### Can I plan a journey between two London locations?

Yes - GET `/Journey/JourneyResults/{from}/to/{to}` accepts station names, postcodes, addresses, or lat-long pairs and returns multi-leg itineraries with walking, tube, bus, and rail segments. Optional parameters include departure or arrival time, modes filter, and accessibility preferences. This is the same engine that powers the official TfL journey planner.

### What are the rate limits for the TfL Unified API?

TfL applies a default per-developer rate limit of 500 requests per minute, with bursts handled via a sliding window. Heavy users can request higher limits via the TfL API portal. Standard `X-RateLimit` headers are returned on each response so agents can back off cleanly.

### How do I get the next tube arrivals at a station through Jentic?

Run `pip install jentic`, search for 'tube arrivals at a stop', load the GET `/Line/{ids}/Arrivals/{stopPointId}` schema, and execute with the line id (for example 'victoria') and stop NaPTAN id (for example '940GZZLUKSX' for King's Cross). The response carries predicted arrival times you can rank and surface.

### Does the TfL API cover National Rail or just London?

The Unified API is London-centric. It includes London Overground, Elizabeth line, DLR, tube, bus, tram, and IFS Cloud Cable Car, plus journey-planner integration with National Rail at London stations. For nationwide rail timetables outside London, pair this API with a National Rail Open Data feed.

### Can I limit what my agent is allowed to do with the TfL Unified API?

Yes. Because you run Jentic One yourself, your own rules decide which TfL operations and credentials the agent may use, and you can restrict it to only the calls it needs, such as planning a journey with `/Journey/JourneyResults` or reading line status with `/Line/Mode/{modes}/Status.` TfL scopes live data through path and query parameters that name lines and stops rather than an account resource, so the boundary you draw is the set of operations you allow. Broader operations like `/Line/{ids}/Arrivals/{stopPointId}` or /BikePoint lookups are only reachable when you include them in that allowed set, and the app_id and app_key stay with your instance rather than the agent's context.
