# Transport for London API
> London public transport as an API, powered by the official Transport for London Unified API. Get live line status for the Tube and every other mode (DLR, Overground, Elizabeth line, trams, buses, river bus) with severity and disruption reasons, search any station or stop by name to get its NaPTAN id, modes, lines and coordinates, pull live arrival predictions for a stop (which line, to where, in how many minutes, from which platform), check a single line in detail with its current disruptions, and plan a door-to-door journey between two places with full leg-by-leg directions and durations. Stops and journey endpoints accept a place name, a NaPTAN id or lat,lon. Perfect for commuter and travel apps, station departure boards, status widgets, Slack/Discord bots and trip planners. No accounts, no upstream key.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/tfl-api/..."
```

## Pricing
- **Free** (Free) — 4,000 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 50,000 calls/Mo, 6 req/s
- **Pro** ($16/Mo) — 250,000 calls/Mo, 16 req/s
- **Mega** ($43/Mo) — 1,250,000 calls/Mo, 40 req/s

## Endpoints

### Status

#### `GET /v1/line` — One line status & disruptions

**Parameters:**
- `id` (query, required, string) — Line id Example: `victoria`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tfl-api/v1/line?id=victoria"
```

**Response:**
```json
{
    "data": {
        "line": {
            "id": "victoria",
            "mode": "tube",
            "name": "Victoria",
            "status": [
                {
                    "reason": "Victoria Line: Service will resume later this morning.\r\n ",
                    "severity": 20,
                    "description": "Service Closed"
                }
            ],
            "disruptions": []
        }
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:04.092Z",
        "request_id": "4fd3f2cc-c8e5-4714-99b1-e5d69bb70773"
    },
    "status": "ok",
    "message": "Line retrieved",
    "success": true
}
```

#### `GET /v1/status` — Live line status for a mode

**Parameters:**
- `mode` (query, optional, string) — tube|dlr|overground|elizabeth-line|tram|bus|national-rail|river-bus|cable-car Example: `tube`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tfl-api/v1/status?mode=tube"
```

**Response:**
```json
{
    "data": {
        "mode": "tube",
        "count": 11,
        "lines": [
            {
                "id": "bakerloo",
                "mode": "tube",
                "name": "Bakerloo",
                "status": [
                    {
                        "reason": "BAKERLOO LINE: Saturday 30 and Sunday 31 May, no service between Queens Park and Harrow & Wealdstone. There will also be no LIONESS LINE service between Euston and Watford Junction. A very limited SOUTHERN service will continue to serve Wembley Central early and late on Saturday and on Sunday, and LONDON NORTH WESTERN RAILWAY trains stop at Harrow & Wealdstone. If travelling to Wembley for the Rugby League Challenge Cup Finals on Saturday or the Women's FA Cup Final on Sunday. Special bus service 718 operates.",
                        "severity": 5,
                        "description": "Part Closure"
                    },
                    {
                        "reason": "Bakerloo Line: Service will resume later this morning.\r\n ",
                        "severity": 20,
                        "description": "Service Closed"
                    }
                ],
                "disruptions": []
            },
            {
                "id": "central",
                "mode": "tube",
                "name": "Central",
                "status": [
                    {
                        "reason": "Central Line: Service will resume later this morning.\r\n ",
                    
…(truncated, see openapi.json for full schema)
```

### Stops

#### `GET /v1/stops` — Search stations & stops

**Parameters:**
- `query` (query, required, string) — Place name Example: `oxford circus`
- `mode` (query, optional, string) — Filter by mode Example: `tube`
- `limit` (query, optional, string) — Max results Example: `25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tfl-api/v1/stops?query=oxford+circus&mode=tube&limit=25"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "query": "oxford circus",
        "stops": [
            {
                "id": "940GZZLUOXC",
                "lat": 51.515224,
                "lon": -0.141903,
                "name": "Oxford Circus Underground Station",
                "lines": [],
                "modes": [
                    "tube"
                ]
            }
        ],
        "total": 1
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:04.340Z",
        "request_id": "2938d5f4-aeb3-4f41-84af-145a48dda160"
    },
    "status": "ok",
    "message": "Stops retrieved",
    "success": true
}
```

### Arrivals

#### `GET /v1/arrivals` — Live arrival predictions

**Parameters:**
- `stop` (query, required, string) — Stop name or NaPTAN id Example: `oxford circus`
- `limit` (query, optional, string) — Max results Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tfl-api/v1/arrivals?stop=oxford+circus&limit=20"
```

**Response:**
```json
{
    "data": {
        "stop": "940GZZLUOXC",
        "count": 2,
        "station": "Oxford Circus Underground Station",
        "arrivals": [
            {
                "line": "Bakerloo",
                "minutes": 17,
                "towards": "Elephant and Castle",
                "expected": "2026-06-01T00:19:36Z",
                "platform": "Southbound - Platform 3",
                "destination": "Elephant & Castle Underground Station",
                "time_to_station_s": 998
            },
            {
                "line": "Bakerloo",
                "minutes": 19,
                "towards": "Elephant and Castle",
                "expected": "2026-06-01T00:21:36Z",
                "platform": "Southbound - Platform 3",
                "destination": "Elephant & Castle Underground Station",
                "time_to_station_s": 1118
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:04.515Z",
        "request_id": "836344bd-3269-409b-852a-033d4adda1f7"
    },
    "status": "ok",
    "message": "Arrivals retrieved",
    "success": true
}
```

### Journey

#### `GET /v1/journey` — Plan a journey A to B

**Parameters:**
- `from` (query, required, string) — From place/id/latlon Example: `oxford circus`
- `to` (query, required, string) — To place/id/latlon Example: `waterloo`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tfl-api/v1/journey?from=oxford+circus&to=waterloo"
```

**Response:**
```json
{
    "data": {
        "to": "HUBWAT",
        "from": "940GZZLUOXC",
        "count": 3,
        "journeys": [
            {
                "legs": [
                    {
                        "mode": "walking",
                        "arrival": "Oxford Circus Stn  / Margaret Street",
                        "summary": "Transfer to Oxford Circus Stn /Margaret St",
                        "departure": "Oxford Circus Station",
                        "duration_min": 1
                    },
                    {
                        "mode": "bus",
                        "arrival": "Westminster Stn  / Parliament Square",
                        "summary": "88 bus to Westminster Station / Parliament Square",
                        "departure": "Oxford Circus Stn  / Margaret Street",
                        "duration_min": 11
                    },
                    {
                        "mode": "bus",
                        "arrival": "Lower Marsh",
                        "summary": "N155 bus to Lower Marsh",
                        "departure": "Westminster Stn  / Parliament Square",
                        "duration_min": 5
                    },
                    {
                        "mode": "walking",
                        "arrival": "Lambeth, Waterloo Hub Hotel",
                        "summary": "Walk to Lambeth, Waterloo Hub Hotel",
                        "departure": "Lower Marsh",
                        "duration_min": 8
                  
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Usage notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tfl-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "London public transport. /v1/status?mode=tube = live line status for a mode (tube, dlr, overground, elizabeth-line, tram, bus, national-rail, river-bus, cable-car); /v1/stops?query=oxford circus = search stations/stops (ids, modes, lines, coords); /v1/arrivals?stop=oxford circus = live arrival predictions (accepts a stop name or NaPTAN id); /v1/line?id=victoria = one line's status & disruptions; /v1/journey?from=oxford circus&to=waterloo = door-to-door journey planning with legs (from/to accept names, ids or 'lat,lon'). Powered by TfL open data.",
        "source": "Transport for London Unified API (api.tfl.gov.uk)",
        "endpoints": [
            "/v1/status",
            "/v1/stops",
            "/v1/arrivals",
            "/v1/line",
            "/v1/journey",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:05.568Z",
        "request_id": "37b93b83-7e94-42f3-8307-8e559627d715"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/tfl-api
OpenAPI spec: https://www.oanor.com/api/tfl-api/openapi.json
