Skip to content

Transport for London, England API

by tfl.gov.uk

API keyHTTPSTransportation
Open documentation ↗

Overview

Discover TFL APIs

Transport for London, England is a transportation API from tfl.gov.uk. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 84 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Unknown
Base URL
https://api.digital.tfl.gov.uk
Version
v1
Endpoints
84
Spec updated
2023-03-06

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://api.digital.tfl.gov.uk/AirQuality" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("https://api.digital.tfl.gov.uk/AirQuality", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://api.digital.tfl.gov.uk/AirQuality",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/AccidentStats/{year}Gets all accident details for accidents occuring in the specified year
GET/AirQualityGets air quality data feed
GET/BikePointGets all bike point locations. The Place object has an addtionalProperties array which contains the nbBikes, nbDocks and nbSpaces numbers which giv
GET/BikePoint/SearchSearch for bike stations by their name, a bike point's name often contains information about the name of the street or nearby landmarks, for exampl
GET/BikePoint/{id}Gets the bike point with the given id.
GET/Cabwise/searchGets taxis and minicabs contact information
GET/Journey/JourneyResults/{from}/to/{to}Perform a Journey Planner search from the parameters specified in simple types
GET/Journey/Meta/ModesGets a list of all of the available journey planner modes
GET/Line/Meta/DisruptionCategoriesGets a list of valid disruption categories
GET/Line/Meta/ModesGets a list of valid modes
GET/Line/Meta/ServiceTypesGets a list of valid ServiceTypes to filter on
GET/Line/Meta/SeverityGets a list of valid severity codes
GET/Line/Mode/{modes}Gets lines that serve the given modes.
GET/Line/Mode/{modes}/DisruptionGet disruptions for all lines of the given modes.
GET/Line/Mode/{modes}/RouteGets all lines and their valid routes for given modes, including the name and id of the originating and terminating stops for each route
GET/Line/Mode/{modes}/StatusGets the line status of for all lines for the given modes
GET/Line/RouteGet all valid routes for all lines, including the name and id of the originating and terminating stops for each route.
GET/Line/Search/{query}Search for lines or routes matching the query string
GET/Line/Status/{severity}Gets the line status for all lines with a given severity A list of valid severity codes can be obtained from a call to Line/Meta/Severity
GET/Line/{ids}Gets lines that match the specified line ids.
GET/Line/{ids}/Arrivals/{stopPointId}Get the list of arrival predictions for given line ids based at the given stop
GET/Line/{ids}/DisruptionGet disruptions for the given line ids
GET/Line/{ids}/RouteGet all valid routes for given line ids, including the name and id of the originating and terminating stops for each route.
GET/Line/{ids}/StatusGets the line status of for given line ids e.g Minor Delays
GET/Line/{ids}/Status/{StartDate}/to/{EndDate}Gets the line status for given line ids during the provided dates e.g Minor Delays
GET/Line/{id}/Route/Sequence/{direction}Gets all valid routes for given line id, including the sequence of stops on each route.
GET/Line/{id}/StopPointsGets a list of the stations that serve the given line id
GET/Line/{id}/Timetable/{fromStopPointId}Gets the timetable for a specified station on the give line
GET/Line/{id}/Timetable/{fromStopPointId}/to/{toStopPointId}Gets the timetable for a specified station on the give line with specified destination
GET/Mode/ActiveServiceTypesReturns the service type active for a mode. Currently only supports tube
GET/Mode/{mode}/ArrivalsGets the next arrival predictions for all stops of a given mode
GET/Occupancy/BikePoints/{ids}Get the occupancy for bike points.
GET/Occupancy/CarParkGets the occupancy for all car parks that have occupancy data
GET/Occupancy/CarPark/{id}Gets the occupancy for a car park with a given id
GET/Occupancy/ChargeConnectorGets the occupancy for all charge connectors
GET/Occupancy/ChargeConnector/{ids}Gets the occupancy for a charge connectors with a given id (sourceSystemPlaceId)
GET/PlaceGets the places that lie within a geographic region. The geographic region of interest can either be specified by using a lat/lon geo-point and a r
GET/Place/Address/Streets/{Postcode}Gets the set of streets associated with a post code.
GET/Place/Meta/CategoriesGets a list of all of the available place property categories and keys.
GET/Place/Meta/PlaceTypesGets a list of the available types of Place.
GET/Place/SearchGets all places that matches the given query
GET/Place/Type/{types}Gets all places of a given type
GET/Place/{id}Gets the place with the given id.
GET/Place/{type}/At/{Lat}/{Lon}Gets any places of the given type whose geography intersects the given latitude and longitude. In practice this means the Place must be polygonal e
GET/Place/{type}/overlay/{z}/{Lat}/{Lon}/{width}/{height}Gets the place overlay for a given set of co-ordinates and a given width/height.
GET/RoadGets all roads managed by TfL
GET/Road/Meta/CategoriesGets a list of valid RoadDisruption categories
GET/Road/Meta/SeveritiesGets a list of valid RoadDisruption severity codes
GET/Road/all/Disruption/{disruptionIds}Gets a list of active disruptions filtered by disruption Ids.
GET/Road/all/Street/DisruptionGets a list of disrupted streets. If no date filters are provided, current disruptions are returned.
GET/Road/{ids}Gets the road with the specified id (e.g. A1)
GET/Road/{ids}/DisruptionGet active disruptions, filtered by road ids
GET/Road/{ids}/StatusGets the specified roads with the status aggregated over the date range specified, or now until the end of today if no dates are passed.
GET/SearchSearch the site for occurrences of the query string. The maximum number of results returned is equal to the maximum page size of 100. To return sub
GET/Search/BusSchedulesSearches the bus schedules folder on S3 for a given bus number.
GET/Search/Meta/CategoriesGets the available search categories.
GET/Search/Meta/SearchProvidersGets the available searchProvider names.
GET/Search/Meta/SortsGets the available sorting options.
GET/StopPointGets a list of StopPoints within {radius} by the specified criteria
GET/StopPoint/Meta/CategoriesGets the list of available StopPoint additional information categories
GET/StopPoint/Meta/ModesGets the list of available StopPoint modes
GET/StopPoint/Meta/StopTypesGets the list of available StopPoint types
GET/StopPoint/Mode/{modes}Gets a list of StopPoints filtered by the modes available at that StopPoint.
GET/StopPoint/Mode/{modes}/DisruptionGets a distinct list of disrupted stop points for the given modes
GET/StopPoint/SearchSearch StopPoints by their common name, or their 5-digit Countdown Bus Stop Code.
GET/StopPoint/Search/{query}Search StopPoints by their common name, or their 5-digit Countdown Bus Stop Code.
GET/StopPoint/ServiceTypesGets the service types for a given stoppoint
GET/StopPoint/Sms/{id}Gets a StopPoint for a given sms code.
GET/StopPoint/Type/{types}Gets all stop points of a given type
GET/StopPoint/Type/{types}/page/{page}Gets all the stop points of given type(s) with a page number
GET/StopPoint/{ids}Gets a list of StopPoints corresponding to the given list of stop ids.
GET/StopPoint/{ids}/DisruptionGets all disruptions for the specified StopPointId, plus disruptions for any child Naptan records it may have.
GET/StopPoint/{id}/ArrivalDeparturesGets the list of arrival and departure predictions for the given stop point id (overground, Elizabeth line and thameslink only)
GET/StopPoint/{id}/ArrivalsGets the list of arrival predictions for the given stop point id
GET/StopPoint/{id}/CanReachOnLine/{lineId}Gets Stopoints that are reachable from a station/line combination.
GET/StopPoint/{id}/Crowding/{line}Gets all the Crowding data (static) for the StopPointId, plus crowding data for a given line and optionally a particular direction.
GET/StopPoint/{id}/DirectionTo/{toStopPointId}Returns the canonical direction, "inbound" or "outbound", for a given pair of stop point Ids in the direction from -> to.
GET/StopPoint/{id}/RouteReturns the route sections for all the lines that service the given stop point ids
GET/StopPoint/{id}/placeTypesGet a list of places corresponding to a given id and place types.
GET/StopPoint/{stopPointId}/CarParksGet car parks corresponding to the given stop point id.
GET/StopPoint/{stopPointId}/TaxiRanksGets a list of taxi ranks corresponding to the given stop point id.
GET/TravelTimes/compareOverlay/{z}/mapcenter/{mapCenterLat}/{mapCenterLon}/pinlocation/{pinLat}/{pinLon}/dimensions/{width}/{height}Gets the TravelTime overlay.
GET/TravelTimes/overlay/{z}/mapcenter/{mapCenterLat}/{mapCenterLon}/pinlocation/{pinLat}/{pinLon}/dimensions/{width}/{height}Gets the TravelTime overlay.
GET/Vehicle/{ids}/ArrivalsGets the predictions for a given list of vehicle Id's.

Questions

Does the Transport for London, England API need an API key?

Yes. The Transport for London, England API uses API key authentication; the documentation explains how to get credentials.

Does the Transport for London, England API support HTTPS?

Yes, the Transport for London, England API is served over HTTPS.

How many endpoints does the Transport for London, England API have?

Its OpenAPI description lists 84 endpoints in version v1. All of them are shown on this page.

What are alternatives to the Transport for London, England API?

Other Transportation APIs include airportsapi, Uber, Transport for Spain, Amadeus for Developers, Boston MBTA Transit.

Compare alternatives →

Listed from public-apis (MIT), public-apis database (MIT), APIs.guru (CC0).