Transport for London Unified API
Our unified API brings together data across all modes of transport into a single RESTful API. This API provides access to the most highly requested realtime and status infomation across all the modes of transport, in a single and consistent way. Access to the developer documentation is available at https://api.tfl.gov.uk.
Trust score
How is this computed?Composite of 5 axes from our methodology (proof-based officialness, live verification, metadata completeness, license clarity, agent readiness).
- Officialnessweight 25%45/100
45/100 from 5 proof signals (domain / portal-backlink / GitHub-org / reciprocal / policy).
- Availabilityweight 25%100/100
Latest verification succeeded.
- Metadata completenessweight 20%80/100
8 of 10 recommended metadata fields populated.
- License clarityweight 15%50/100
License info not yet tracked for APIs (datasets only).
- Agent readinessweight 15%60/100
OpenAPI spec URL declared · Spec format known (openapi) · Topic tags assigned
Official Proof
Public Sector APIProof Evidence
official domain (gov.uk); policies found: accessibility
Data schema (186 fields)
| Field | Type | Description |
|---|---|---|
| year | integer (int32) | The year for which to filter the accidents on. |
| id | string | A bike point id (a list of ids can be obtained from the above BikePoint call) |
| query | string | The search term e.g. "St. James" |
| lat | number (double) | Latitude |
| lon | number (double) | Longitude |
| optype | string | Operator Type e.g Minicab, Executive, Limousine |
| wc | string | Wheelchair accessible |
| radius | number (double) | The radius of the bounding circle in metres |
| name | string | Trading name of operating company |
| maxResults | integer (int32) | An optional parameter to limit the number of results return. Default and maximum is 20. |
| legacyFormat | boolean | Legacy Format |
| forceXml | boolean | Force Xml |
| twentyFourSevenOnly | boolean | Twenty Four Seven Only |
| from | string | Origin of the journey. Can be WGS84 coordinates expressed as "lat,long", a UK postcode, a Naptan (StopPoint) id, an ICS StopId, or a free-text string (will cause disambiguation unless it exactly matches a point of interest name). |
| to | string | Destination of the journey. Can be WGS84 coordinates expressed as "lat,long", a UK postcode, a Naptan (StopPoint) id, an ICS StopId, or a free-text string (will cause disambiguation unless it exactly matches a point of interest name). |
| via | string | Travel through point on the journey. Can be WGS84 coordinates expressed as "lat,long", a UK postcode, a Naptan (StopPoint) id, an ICS StopId, or a free-text string (will cause disambiguation unless it exactly matches a point of interest name). |
| nationalSearch | boolean | Does the journey cover stops outside London? eg. "nationalSearch=true" |
| date | string | The date must be in yyyyMMdd format |
| time | string | The time must be in HHmm format |
| timeIs | string | Does the time given relate to arrival or leaving time? Possible options: "departing" | "arriving" |
| journeyPreference | string | The journey preference eg possible options: "leastinterchange" | "leasttime" | "leastwalking" |
| mode | array | The mode must be a comma separated list of modes. eg possible options: "public-bus,overground,train,tube,coach,dlr,cablecar,tram,river,walking,cycle" |
| accessibilityPreference | array | The accessibility preference must be a comma separated list eg. "noSolidStairs,noEscalators,noElevators,stepFreeToVehicle,stepFreeToPlatform" |
| fromName | string | An optional name to associate with the origin of the journey in the results. |
| toName | string | An optional name to associate with the destination of the journey in the results. |
| viaName | string | An optional name to associate with the via point of the journey in the results. |
| maxTransferMinutes | string | The max walking time in minutes for transfer eg. "120" |
| maxWalkingMinutes | string | The max walking time in minutes for journeys eg. "120" |
| walkingSpeed | string | The walking speed. eg possible options: "slow" | "average" | "fast". |
| cyclePreference | string | The cycle preference. eg possible options: "allTheWay" | "leaveAtStation" | "takeOnTransport" | "cycleHire" |
| adjustment | string | Time adjustment command. eg possible options: "TripFirst" | "TripLast" |
| bikeProficiency | array | A comma separated list of cycling proficiency levels. eg possible options: "easy,moderate,fast" |
| alternativeCycle | boolean | Option to determine whether to return alternative cycling journey |
| alternativeWalking | boolean | Option to determine whether to return alternative walking journey |
| applyHtmlMarkup | boolean | Flag to determine whether certain text (e.g. walking instructions) should be output with HTML tags or not. |
| useMultiModalCall | boolean | A boolean to indicate whether or not to return 3 public transport journeys, a bus journey, a cycle hire journey, a personal cycle journey and a walking journey |
| walkingOptimization | boolean | A boolean to indicate whether to optimize journeys using walking |
| taxiOnlyTrip | boolean | A boolean to indicate whether to return one or more taxi journeys. Note, setting this to true will override "useMultiModalCall". |
| routeBetweenEntrances | boolean | A boolean to indicate whether public transport routes should include directions between platforms and station entrances. |
| useRealTimeLiveArrivals | boolean | A boolean to indicate if we want to receive real time live arrivals data where available. |
| calcOneDirection | boolean | A boolean to make Journey Planner calculate journeys in one temporal direction only. In other words, only calculate journeys after the 'depart' time, or before the 'arrive' time. By default, the Journey Planner engine (EFA) calculates journeys in both temporal directions. |
| includeAlternativeRoutes | boolean | A boolean to make Journey Planner return alternative routes. Alternative routes are calculated by removing one or more lines included in the fastest route and re-calculating. By default, these journeys will not be returned. |
| overrideMultiModalScenario | integer (int32) | An optional integer to indicate what multi modal scenario we want to use. |
| combineTransferLegs | boolean | A boolean to indicate whether walking leg to station entrance and walking leg from station entrance to platform should be combined. Defaults to true |
| ids | array | A comma-separated list of line ids e.g. victoria,circle,N133. Max. approx. 20 ids. |
| modes | array | A comma-separated list of modes e.g. tube,dlr |
| serviceTypes | array | A comma seperated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified |
| direction | string | The direction of travel. Can be inbound or outbound. |
| excludeCrowding | boolean | That excludes crowding from line disruptions. Can be true or false. |
| detail | boolean | Include details of the disruptions that are causing the line status including the affected stops and routes |
| startDate | string | — |
| endDate | string | — |
| dateRange.startDate | string (date-time) | — |
| dateRange.endDate | string (date-time) | — |
| severity | integer (int32) | The level of severity (eg: a number from 0 to 14) |
| severityLevel | string | If specified, ensures that only those line status(es) are returned within the lines that have disruptions with the matching severity level. |
| tflOperatedNationalRailStationsOnly | boolean | If the national-rail line is requested, this flag will filter the national rail stations so that only those operated by TfL are returned |
| fromStopPointId | string | The originating station's stop point id (station naptan code e.g. 940GZZLUASL, you can use /StopPoint/Search/{query} endpoint to find a stop point id from a station name) |
| toStopPointId | string | The destination stations's Naptan code |
| stopPointId | string | Optional. Id of stop to get arrival predictions for (station naptan code e.g. 940GZZLUASL, you can use /StopPoint/Search/{query} endpoint to find a stop point id from a station name) |
| destinationStationId | string | Optional. Id of destination stop |
| count | integer (int32) | A number of arrivals to return for each stop, -1 to return all available. |
| postcode | string | — |
| postcodeInput.postcode | string | — |
| types | array | A comma-separated list of the types to return. Max. approx 12 types. A valid list of place types can be obtained from the /Place/Meta/placeTypes endpoint. |
| activeOnly | boolean | An optional parameter to limit the results to active records only (Currently only the 'VariableMessageSign' place type is supported) |
| includeChildren | boolean | Defaults to false. If true child places e.g. individual charging stations at a charge point while be included, otherwise just the URLs of any child places will be returned |
| categories | array | An optional list of comma separated property categories to return in the Place's property bag. If null or empty, all categories of property are returned. Pass the keyword "none" to return no properties (a valid list of categories can be obtained from the /Place/Meta/categories endpoint) |
| type | array | Place types to filter on, or null to return all types |
| numberOfPlacesToReturn | integer (int32) | If specified, limits the number of returned places equal to the given value |
| placeGeo.swLat | number (double) | — |
| placeGeo.swLon | number (double) | — |
| placeGeo.neLat | number (double) | — |
| placeGeo.neLon | number (double) | — |
| placeGeo.lat | number (double) | — |
| placeGeo.lon | number (double) | — |
| location.lat | number (double) | — |
| location.lon | number (double) | — |
| z | integer (int32) | The zoom level |
| width | integer (int32) | The width of the requested overlay. |
| height | integer (int32) | The height of the requested overlay. |
| dateRangeNullable.startDate | string (date-time) | — |
| dateRangeNullable.endDate | string (date-time) | — |
| stripContent | boolean | Optional, defaults to false. When true, removes every property/node except for id, point, severity, severityDescription, startDate, endDate, corridor details, location, comments and streets |
| severities | array | an optional list of Severity names to filter on (a valid list of severities can be obtained from the /Road/Meta/severities endpoint) |
| closures | boolean | Optional, defaults to true. When true, always includes disruptions that have road closures, regardless of the severity filter. When false, the severity filter works as normal. |
| disruptionIds | array | Comma-separated list of disruption identifiers to filter by. |
| includeCrowdingData | boolean | Include the crowding data (static). To Filter further use: /StopPoint/{ids}/Crowding/{line} |
| placeTypes | array | A comcomma-separated value representing the place types. |
| line | string | A particular line e.g. victoria, circle, northern etc. |
| page | integer (int32) | — |
| lineIds | array | The lines which contain the given Naptan id (all lines relevant to the given stoppoint if empty) |
| lineId | string | Line id of the line to filter by (e.g. victoria) |
| includeRouteBlockedStops | boolean | — |
| getFamily | boolean | Specify true to return disruptions for entire family, or false to return disruptions for just this stop point. Defaults to false. |
| flattenResponse | boolean | Specify true to associate all disruptions with parent stop point. (Only applicable when getFamily is true). |
| stopTypes | array | a list of stopTypes that should be returned (a list of valid stop types can be obtained from the StopPoint/meta/stoptypes endpoint) |
| useStopPointHierarchy | boolean | Re-arrange the output into a parent/child hierarchy |
| returnLines | boolean | true to return the lines that each stop point serves as a nested resource |
| faresOnly | boolean | True to only return stations in that have Fares data available for single fares to another station. |
| lines | array | An optional, parameter separated list of the lines to filter by |
| includeHubs | boolean | If true, returns results including HUBs. |
| output | string | If set to "web", a 302 redirect to relevant website bus stop page is returned. Valid values are : web. All other values are ignored. |
| pinLat | number (double) | The latitude of the pin. |
| pinLon | number (double) | The longitude of the pin. |
| mapCenterLat | number (double) | The map center latitude. |
| mapCenterLon | number (double) | The map center longitude. |
| scenarioTitle | string | The title of the scenario. |
| timeOfDayId | string | The id for the time of day (AM/INTER/PM) |
| modeId | string | The id of the mode. |
| travelTimeInterval | integer (int32) | The total minutes between the travel time bands |
| compareType | string | — |
| compareValue | string | — |
| locationTfl.Api.Presentation.Entities.AccidentStats.AccidentDetail | string | — |
| boroughTfl.Api.Presentation.Entities.AccidentStats.AccidentDetail | string | — |
| casualtiesTfl.Api.Presentation.Entities.AccidentStats.AccidentDetail | array<object> | — |
| vehiclesTfl.Api.Presentation.Entities.AccidentStats.AccidentDetail | array<object> | — |
| ageTfl.Api.Presentation.Entities.AccidentStats.Casualty | integer (int32) | — |
| classTfl.Api.Presentation.Entities.AccidentStats.Casualty | string | — |
| ageBandTfl.Api.Presentation.Entities.AccidentStats.Casualty | string | — |
| accidentsTfl.Api.Presentation.Entities.AccidentStats.AccidentStatsOrderedSummary | integer (int32) | — |
| urlTfl.Api.Presentation.Entities.Place | string | The unique location of this resource. |
| commonNameTfl.Api.Presentation.Entities.Place | string | A human readable name. |
| distanceTfl.Api.Presentation.Entities.Place | number (double) | The distance of the place from its search point, if this is the result of a geographical search, otherwise zero. |
| placeTypeTfl.Api.Presentation.Entities.Place | string | The type of Place. See /Place/Meta/placeTypes for possible values. |
| additionalPropertiesTfl.Api.Presentation.Entities.Place | array<object> | A bag of additional key/value pairs with extra information about this place. |
| childrenTfl.Api.Presentation.Entities.Place | array<object> | — |
| childrenUrlsTfl.Api.Presentation.Entities.Place | array<string> | — |
| categoryTfl.Api.Presentation.Entities.AdditionalProperties | string | — |
| keyTfl.Api.Presentation.Entities.AdditionalProperties | string | — |
| sourceSystemKeyTfl.Api.Presentation.Entities.AdditionalProperties | string | — |
| valueTfl.Api.Presentation.Entities.AdditionalProperties | string | — |
| modifiedTfl.Api.Presentation.Entities.AdditionalProperties | string (date-time) | — |
| labelTfl.Api.Presentation.Entities.CycleSuperhighway | string | The long label to show on maps when zoomed in |
| labelShortTfl.Api.Presentation.Entities.CycleSuperhighway | string | The short label to show on maps |
| geographyTfl.Api.Presentation.Entities.CycleSuperhighway | object | A LineString or MultiLineString that forms the route of the highway |
| segmentedTfl.Api.Presentation.Entities.CycleSuperhighway | boolean | True if the route is split into segments |
| statusTfl.Api.Presentation.Entities.CycleSuperhighway | string | Cycle route status i.e Proposed, Existing etc |
| routeTypeTfl.Api.Presentation.Entities.CycleSuperhighway | string | Type of cycle route e.g CycleSuperhighways, Quietways, MiniHollands etc |
| coordinateSystemIdSystem.Data.Spatial.DbGeographyWellKnownValue | integer (int32) | — |
| wellKnownTextSystem.Data.Spatial.DbGeographyWellKnownValue | string | — |
| wellKnownBinarySystem.Data.Spatial.DbGeographyWellKnownValue | string (byte) | — |
| passengerTypeTfl.Api.Presentation.Entities.Fares.Fare | string | — |
| validFromTfl.Api.Presentation.Entities.Fares.Fare | string (date-time) | — |
| validUntilTfl.Api.Presentation.Entities.Fares.Fare | string (date-time) | — |
| ticketTimeTfl.Api.Presentation.Entities.Fares.Fare | string | — |
| ticketTypeTfl.Api.Presentation.Entities.Fares.Fare | string | — |
| costTfl.Api.Presentation.Entities.Fares.Fare | string | — |
| capTfl.Api.Presentation.Entities.Fares.Fare | number (double) | — |
| descriptionTfl.Api.Presentation.Entities.Fares.Fare | string | — |
| zoneTfl.Api.Presentation.Entities.Fares.Fare | string | — |
| headerTfl.Api.Presentation.Entities.Fares.FaresSection | string | — |
| indexTfl.Api.Presentation.Entities.Fares.FaresSection | integer (int32) | — |
| journeyTfl.Api.Presentation.Entities.Fares.FaresSection | object | — |
| rowsTfl.Api.Presentation.Entities.Fares.FaresSection | array<object> | — |
| messagesTfl.Api.Presentation.Entities.Fares.FaresSection | array<object> | — |
| fromStationTfl.Api.Presentation.Entities.Fares.Journey | object | — |
| toStationTfl.Api.Presentation.Entities.Fares.Journey | object | — |
| boundsIdTfl.Api.Presentation.Entities.Fares.FareDetails | integer (int32) | — |
| contactlessPAYGOnlyFareTfl.Api.Presentation.Entities.Fares.FareDetails | boolean | — |
| routeCodeTfl.Api.Presentation.Entities.Fares.FareDetails | string | — |
| displayNameTfl.Api.Presentation.Entities.Fares.FareDetails | string | — |
| displayOrderTfl.Api.Presentation.Entities.Fares.FareDetails | integer (int32) | — |
| routeDescriptionTfl.Api.Presentation.Entities.Fares.FareDetails | string | — |
| validatorInformationTfl.Api.Presentation.Entities.Fares.FareDetails | string | — |
| operatorTfl.Api.Presentation.Entities.Fares.FareDetails | string | — |
| specialFareTfl.Api.Presentation.Entities.Fares.FareDetails | boolean | — |
| throughFareTfl.Api.Presentation.Entities.Fares.FareDetails | boolean | — |
| isTourTfl.Api.Presentation.Entities.Fares.FareDetails | boolean | — |
| ticketsAvailableTfl.Api.Presentation.Entities.Fares.FareDetails | array<object> | — |
| bulletOrderTfl.Api.Presentation.Entities.Message | integer (int32) | — |
| messageTextTfl.Api.Presentation.Entities.Message | string | — |
| linkTextTfl.Api.Presentation.Entities.Message | string | — |
| atcoCodeTfl.Api.Presentation.Entities.Fares.FareStation | string | — |
| fareCategoryTfl.Api.Presentation.Entities.Fares.FareStation | string | — |
| isPopularFareTfl.Api.Presentation.Entities.Fares.FareBounds | boolean | — |
| isPopularTravelCardTfl.Api.Presentation.Entities.Fares.FareBounds | boolean | — |
| viewableDateTfl.Api.Presentation.Entities.Fares.FaresPeriod | string (date-time) | — |
| isFutureTfl.Api.Presentation.Entities.Fares.FaresPeriod | boolean | — |
| longitudeTfl.Api.Presentation.Entities.Coordinate | number (double) | — |
| latitudeTfl.Api.Presentation.Entities.Coordinate | number (double) | — |
| eastingTfl.Api.Presentation.Entities.Coordinate | number (double) | — |
| northingTfl.Api.Presentation.Entities.Coordinate | number (double) | — |
| xCoordTfl.Api.Presentation.Entities.Coordinate | integer (int32) | — |
| yCoordTfl.Api.Presentation.Entities.Coordinate | integer (int32) | — |
| addressTfl.Api.Presentation.Entities.GeoCodeSearchMatch | string | A string describing the formatted address of the place. Adds additional context to the place's Name. |
Schema captured from openapi 2 days ago.
Verification Status
Using the API
Configuration
- Base URL
- https://api.tfl.gov.uk
- Version
- v1
- Format
- openapi
- Endpoints
- 84
Try the API
/AccidentStats/{year}Gets all accident details for accidents occuring in the specified year
/AirQualityGets air quality data feed
/BikePointGets all bike point locations. The Place object has an addtionalProperties array which contains the nbBikes, nbDocks and nbSpaces numbers which give the status of the BikePoint. A mismatch in these numbers i.e. nbDocks - (nbBikes + nbSpaces) != 0 indicates broken docks.
/BikePoint/{id}Gets the bike point with the given id.
/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 example. Note that the search result does not contain the PlaceProperties i.e. the status or occupancy of the BikePoint, to get that information you should retrieve the BikePoint by its id on /BikePoint/id.
Requests are proxied through our servers. Only GET endpoints are testable.
Query examples
curl -s 'https://api.tfl.gov.uk/swagger/docs/v1' -H 'Accept: application/json'Machine-readable API description (use it to generate clients).
Machine-readable & source
Embed this badge in a README or wiki — it always shows the latest verification state and quality tier.