# Transport for London API

> Returns London line status, routes, stops, stations and line and stop searches from TfL.

Category: Travel, Maps & Weather. Region: GB. 13 endpoints at `https://api.hoshime.com/v1/tfl/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/tfl
## GET /v1/tfl/lineStatus

The current service status of every line of one transport mode, such as the tube.

Scope: `social:read` · Units: 1 · Cached: 2 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `mode` | string | no | Transport mode: tube, dlr, overground, elizabeth-line, tram, river-bus or cable-car. (one of tube, dlr, overground, elizabeth-line, tram, river-bus, cable-car; default tube; e.g. tube) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `mode` (string), `name` (string), `reason` (string), `status` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/lineStatus?mode=tube" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/lineRoute

The route of one line: its stations in order and the route variants (each as its stop ids).

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Line id, such as victoria or elizabeth. (e.g. victoria) |
| `direction` | string | no | inbound, outbound or all. (one of inbound, outbound, all; default all) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `direction` (string), `id` (string), `mode` (string), `name` (string), `routes` (RouteVariant[]), `routes[].name` (string), `routes[].serviceType` (string), `routes[].stopIds` (string[]), `stops` (Stop[]), `stops[].id` (string), `stops[].latitude` (number (double)), `stops[].longitude` (number (double)), `stops[].modes` (ModeName[]), `stops[].name` (string), `stops[].zone` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/lineRoute?id=victoria" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/lineStops

Every stop point a line serves, with its modes, zone and position.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Line id, such as victoria. (e.g. victoria) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `latitude` (number (double)), `longitude` (number (double)), `modes` (ModeName[]), `modes[].name` (string), `name` (string), `zone` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/lineStops?id=victoria" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/lineSearch

Lines whose name matches the text, such as the lines a place name is served by.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Text in the line name, such as victoria. (e.g. victoria) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `mode` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/lineSearch?query=victoria" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/stops

Stops and stations whose name matches the text, with their modes, zone and position.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Text in the stop name, such as victoria. (e.g. victoria) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `latitude` (number (double)), `longitude` (number (double)), `modes` (ModeName[]), `modes[].name` (string), `name` (string), `zone` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/stops?query=victoria" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/stop

One stop point by id: its name, modes, zone, address, position and the lines that call there.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Stop id (NaPTAN code), such as 940GZZLUVIC. (e.g. 940GZZLUVIC) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `address` (string), `id` (string), `latitude` (number (double)), `lines` (LineRef[]), `lines[].id` (string), `lines[].name` (string), `longitude` (number (double)), `modes` (ModeName[]), `modes[].name` (string), `name` (string), `stopType` (string), `zone` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/stop?id=940GZZLUVIC" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/arrivals

The live predictions of the next vehicles to arrive at a stop, soonest first.

Scope: `social:read` · Units: 1 · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Stop id (NaPTAN code), such as 940GZZLUVIC. (e.g. 940GZZLUVIC) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `destination` (string), `expectedAt` (string), `id` (string), `lineId` (string), `lineName` (string), `mode` (string), `platform` (string), `timeToStation` (integer (int64)), `towards` (string), `vehicle` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/arrivals?id=940GZZLUVIC" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/disruptions

The current disruptions of one transport mode, such as planned works and line information.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `mode` | string | no | Transport mode: tube, dlr, overground, elizabeth-line, tram, river-bus or cable-car. (one of tube, dlr, overground, elizabeth-line, tram, river-bus, cable-car; default tube; e.g. tube) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `category` (string), `description` (string), `type` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/disruptions?mode=tube" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/journey

Journey planner: the suggested journeys between two places, each with its legs.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `from` | string | yes | Stop id, such as 940GZZLUVIC, or a position as lat,lon. (e.g. 940GZZLUVIC) |
| `to` | string | yes | Stop id, such as 940GZZLUOXC, or a position as lat,lon. (e.g. 940GZZLUOXC) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `arrivalAt` (string), `departureAt` (string), `durationMinutes` (integer (int64)), `legs` (Leg[]), `legs[].arrivalAt` (string), `legs[].departureAt` (string), `legs[].durationMinutes` (integer (int64)), `legs[].from` (string), `legs[].instruction` (string), `legs[].mode` (string), `legs[].to` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/journey?from=940GZZLUVIC&to=940GZZLUOXC" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/bikePoints

Santander Cycles docking stations whose name matches the text, with their id and position.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Text in the station name, such as waterloo. (e.g. waterloo) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `latitude` (number (double)), `longitude` (number (double)), `name` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/bikePoints?query=waterloo" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/bikePoint

The live status of one docking station: bikes and empty docks now, and whether it is installed and locked.

Scope: `social:read` · Units: 1 · Cached: 1 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Bike point id, such as BikePoints_154. (e.g. BikePoints_154) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `bikes` (integer (int64)), `docks` (integer (int64)), `eBikes` (integer (int64)), `emptyDocks` (integer (int64)), `id` (string), `installed` (boolean), `latitude` (number (double)), `locked` (boolean), `longitude` (number (double)), `name` (string), `standardBikes` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/tfl/bikePoint?id=BikePoints_154" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/stopsNear

Bus, tram, tube, rail and ferry stops within a radius of a position, nearest first, with their distance in metres.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `latitude` | string | yes | Latitude, from -90 to 90, such as 51.5033. (e.g. 51.5033) |
| `longitude` | string | yes | Longitude, from -180 to 180, such as -0.1276. (e.g. -0.1276) |
| `radius` | integer | no | Search radius in metres, from 1 to 1000. (default 500; e.g. 500) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `distanceMeters` (number (double)), `id` (string), `latitude` (number (double)), `longitude` (number (double)), `modes` (ModeName[]), `modes[].name` (string), `name` (string), `stopType` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/stopsNear?latitude=51.5033&longitude=-0.1276&radius=500" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tfl/roadStatus

The current traffic status of the TfL road corridors, such as the A2: all of them, or the one named by road.

Scope: `social:read` · Units: 1 · Cached: 5 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `road` | string | no | Road corridor, such as a2 or a406. Leave it out for all the corridors. (e.g. a2) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `name` (string), `severity` (string), `status` (string), `statusFrom` (string), `statusUntil` (string)

```bash
curl "https://api.hoshime.com/v1/tfl/roadStatus?road=a2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
