# TransCAPI > REST API for public transport in Great Britain (England, Scotland, Wales) the island of Ireland (Northern Ireland and the Republic), the Netherlands and Belgium: stops and places, bus and rail departures and arrivals with live running, routes and services, live bus positions, disruptions, and journey planning. One API key, plain JSON, official open data. Base URL: `https://api.transcapi.com`. Every `/v1` endpoint needs an API key, sent as the `X-Api-Key` header (or `api_key` query parameter). Keys are free at https://www.transcapi.com/signup — the free tier is 200 requests a day with every endpoint. ## Conventions that matter - Every departure and arrival has `source`: `darwin` (live rail, National Rail), `avl` (a bus tracked against its timetable), `siri_vm` (a bus matched to a live position), `nta_gtfsr` (Republic of Ireland, NTA live feed), `irish_rail` (Irish Rail live), `ovapi_gtfsr` (Netherlands, OVapi live feed), `bmc_gtfsr` (Belgium: SNCB, De Lijn and TEC live feeds), or `gtfs_scheduled` (timetable only). Present live and timetabled times differently. - Statuses: `on_time`, `late`, `early`, `delayed` (late, no estimate yet), `cancelled`, `departed` (bus already past the stop), `partly_cancelled` (a train with some calls cancelled). - Missing data is `null`, never a guess: `shape: null` where no route geometry is published, `delay_seconds: null` where a bus is not tracked. - `trip_id` links things: a departure, a live vehicle and `/v1/{bus,rail}/services/{trip_id}.json` share it. - Stops sharing a name are told apart by `towards` (where the buses go). Show it next to the name. - Bus stops are identified by NaPTAN `atcocode` (e.g. `370022870`); rail stations by 3-letter CRS code (e.g. `LDS` Leeds, `KGX` London Kings Cross). - Times are ISO 8601 with offsets. - Errors are JSON `{"error": {"code": ..., "message": ...}}`. `422 outside_coverage` means journey planning does not cover that area (not "no journeys"); `429` with `rate_limit_exceeded` or `daily_limit_exceeded` means wait `Retry-After` seconds. - Every response carries `X-RateLimit-Limit`, `-Remaining`, `-Reset` (per minute) and `X-RateLimit-Daily-Limit`, `-Daily-Remaining`, `-Daily-Reset`. ## Endpoints - `GET /v1/places.json?query=` — towns, villages, postcodes (full or partial, e.g. `S1`) and stops. Same-named places ranked by size. Optional `lat`/`lon` sorts by distance; `type` filters (`settlement`, `postcode`, `airport`, `bus_stop`, `train_station`, `tram_stop`). - `GET /v1/bus/stops.json?lat=&lon=&radius=` — stops near a point (or `min_lat`/`min_lon`/`max_lat`/`max_lon`), each with `towards`. - `GET /v1/bus/stop_timetables/{atcocode}.json` — departures (`type=arrivals` or `both` for arrivals). Expected times and `delay_seconds` for tracked buses; `live=true` adds matched vehicle positions. Window: `from_offset`/`to_offset` minutes, `datetime`. Untracked departures whose bus is tracked on its previous journey (same block) get a prediction: `source: "block"`, `predicted_from`. - `GET /v1/bus/vehicles.json?lat=&lon=&radius=` — live buses near a point (radius up to 10000 m) or in a box, linked to their `trip_id`, with `delay_seconds` where tracked. Filter `line`, `operator`. - `GET /v1/bus/reliability.json?route_id=` (or `operator=&line=`, or `operator=` alone to list lines) — observed punctuality over `days` (default 28, ≤56): on-time/early/late/very-late %, mean delay, timing-point/first/last-stop on-time %, by hour. On time = ≤1 min early and <6 min late. Northern England and West Sussex since 4 Aug 2026, wherever operators report positions across GB since 30 Sep 2026. - `GET /v1/bus/stop_reliability/{atcocode}.json` — each line's punctuality at a stop, with median and 90th-percentile delay (≤35 days). - `GET /v1/bus/routes.json?q=` — find bus routes by line number or name (`q`), `operator`, or a stop served (`atcocode`). - `GET /v1/bus/routes/{route_id}.json` — a route's directions, stops, road geometry (`shape.encoded_polyline`, precision 5) and a day's timetable. - `GET /v1/bus/services/{trip_id}.json` — one journey's calling points and, if running, its live vehicle. - `GET /v1/rail/stations.json?lat=&lon=&radius=` — stations near a point. - `GET /v1/rail/station_timetables/{crs_code}.json` — departures/arrivals with live expected times, platforms, cancellations, delay reasons and station `messages` from National Rail (within two hours of now; `live=false` for timetable only). - `GET /v1/rail/services/{trip_id}.json` — one train's calling points; for today, each call has `status`, `expected_time`, `actual_time`, `platform`. - `GET /v1/rail/routes.json`, `/v1/rail/routes/{route_id}.json` — rail services by operator. - `GET /v1/rail/fares.json?from={crs}&to={crs}` — every fare between two stations for one adult (Anytime, Off-Peak, Super Off-Peak, Advance; standard and first), with route, time restriction and validity, and `cheapest` per kind. `railcard=` (codes from `GET /v1/rail/railcards.json`, e.g. YNG) gives railcard prices. Advance fares are a range (`price` from, `price_to`); no seat availability. - `POST /v1/alerts.json` — push alerts (webhooks): `{"type": "vehicle_approaching", "atcocode", "minutes", "line"?, "url"}` or `{"type": "disruption", "filters": {...}, "url"}`; returns a `secret` once for the `X-TransCAPI-Signature` HMAC-SHA256. `GET/DELETE /v1/alerts/{id}.json`, `POST /v1/alerts/{id}/test.json`. Limits: 3/10/50/500 by plan, per account (all its keys share them, as they share the daily allowance). - `GET /v1/airports.json?query=` (or `lat=&lon=`) — the 50 GB airports with scheduled flights (IATA/ICAO, terminals). `GET /v1/airports/{iata}.json` — one airport with rail stations within 3 km (`crs_code`), bus/coach/tram/metro stops within 500 m with their lines (`atcocode`), and nearby disruptions. No flight data. - `GET /v1/disruptions.json` — planned works, incidents and line status: bus and tram across Great Britain, National Rail engineering works and incidents (`mode=rail`, placed by the stations named in affected routes; `atcocode` accepts a CRS code), Tube/DLR/Overground/Elizabeth line/London Trams. Filter by `mode`, `severity`, `operator`, `line`, stop (`atcocode`), point and radius, box, `planned`, or a journey's route with `path` (encoded polyline) and `path_radius` — the reliable way to ask what affects a journey, since line numbers repeat across towns. - `GET /v1/journey/reachable.json?lat=&lon=&cutoffs=15,30,45` — the area reachable by public transport within each cutoff (≤90 min), as GeoJSON, anywhere in Great Britain, today or tomorrow (`datetime`). Walking estimated from straight-line distance. - `POST /v1/journey/travel_times.json` — body `{"from": {"lat","lon"}, "to": [{"id","lat","lon"}, ...≤500], "datetime", "max_minutes"}`: minutes by public transport from one point to each destination, `null` if unreachable. GET form: `?from_lat=&from_lon=&to=lat,lon|lat,lon` (≤100). - `GET /v1/journey.json?from_lat=&from_lon=&to_lat=&to_lon=` — multi-modal journeys (bus, coach, rail, Underground, metro, tram, ferry) anywhere in England, Scotland and Wales, or anywhere on the island of Ireland, or anywhere in the Netherlands and Belgium (planned together), up to two months ahead, with walking limits (`max_walk_distance`), turn-by-turn directions (`include_steps=true`), live positions, and fares (rail across Great Britain, with a change of train priced as one through ticket, `railcard=` for railcard prices; bus in Yorkshire and West Sussex). Live legs fill `start_time.estimated`/`delay_s` and `real_time` (tracked buses; trains within two hours, plus `status`, `platform`, `delay_reason`); a train leg's `trip_id` works with `/v1/rail/services/{trip_id}.json`. Bus/tram/metro legs follow the operator's route (`leg_geometry_source: "shape"`). Walking legs carry `terrain` (climb and descent in metres, steepest gradient, shape, estimated calories, from OS Terrain 50) and each itinerary a `walking` summary. Itineraries with changes carry `connections` (spare time and `chance_pct` of making each change, from how those exact buses ran on recent days) and `connection_chance_pct`. `datetime` without an offset is UK time. `max_gradient` (percent) excludes journeys whose walks are steeper; each itinerary has `accessibility.steepest_walk_gradient_pct`. Every leg and itinerary carries `carbon` (g CO2e from the UK government's 2026 conversion factors, plus `driving_alone_co2e_g` for comparison). Journeys between Great Britain, Ireland and the Netherlands, and to the Isle of Man, return `422 outside_coverage`; in Ireland, train legs have live times from Irish Rail and Republic bus legs from the NTA (Luas is timetable only) (`status: "cancelled"` if cancelled); Northern Ireland legs are scheduled, and there are no fares. Sundays 03:00-04:30 UK it returns `503 scheduled_maintenance` with `Retry-After` while the week's timetables load. ## Coverage and gaps Great Britain for stops, places, journey planning, and bus and rail timetables (both refreshed daily). Live bus positions follow BODS reporting (England, some Wales, little Scotland); bus delays and punctuality cover wherever operators report positions (national since 30 Sep 2026; punctuality history in northern England and West Sussex from 4 Aug 2026). Ireland (since 18 Oct 2026): stops, places, timetables (bus, coach, Luas, NI Railways, Irish Rail, DART) and journey planning from Translink's open data (Northern Ireland) and the National Transport Authority's (Republic, CC BY 4.0); Irish trains have live expected times from Irish Rail; Republic buses have live times, cancellations and positions (Luas timetable only) from the NTA's GTFS-Realtime feed; Northern Ireland is scheduled only; no fares. Irish trains are in the bus endpoints (with `mode: rail`), not `/v1/rail`. The Netherlands (since 18 Oct 2026): stops, towns, every operator's timetable (NS trains, buses, trams, metros, ferries) from OVapi (CC0; shapes ODbL, OpenStreetMap), live expected times, cancellations and positions (`source: ovapi_gtfsr`), journey planning; times are UK time with an exact offset (an hour behind Dutch clocks); Dutch trains are in the bus endpoints with `mode: rail`; no fares. ## Attribution Apps displaying TransCAPI data must show the source attribution: see https://www.transcapi.com/docs/data-sources for the exact line (OGL, OS, Royal Mail, OpenStreetMap, National Rail Enquiries, TfL). ## Docs - [Getting started](https://www.transcapi.com/docs/getting-started): one working request per area - [Bus](https://www.transcapi.com/docs/bus): departures, tracked delays, live vehicles - [Rail](https://www.transcapi.com/docs/rail): live boards and single trains - [Disruptions](https://www.transcapi.com/docs/disruptions): filters and matching to a route - [Journey planning](https://www.transcapi.com/docs/journey) - [Airports](https://www.transcapi.com/docs/airports) - [Push alerts](https://www.transcapi.com/docs/alerts) - [Rate limits](https://www.transcapi.com/docs/rate-limits) ## Guides - [UK bus times in Python](https://www.transcapi.com/guides/uk-bus-times-python): postcode to nearest stops to departures - [Live UK train departures](https://www.transcapi.com/guides/live-train-departures-api): a Darwin-backed station board - [Journey planning that knows about hills](https://www.transcapi.com/guides/journey-planning-walking-climb): ranking journeys by walking climb - [Where can I get to in 30 minutes?](https://www.transcapi.com/guides/reachability-maps-travel-times): reachable areas and one-to-many travel times - [How do I get to the airport?](https://www.transcapi.com/guides/airport-public-transport-api): airports, their trains, trams and buses - [How reliable is my bus?](https://www.transcapi.com/guides/bus-punctuality-api): measured punctuality and connection chances - [Data sources & attribution](https://www.transcapi.com/docs/data-sources) - [OpenAPI spec](https://api.transcapi.com/openapi.json) - [MCP server](https://github.com/tcdataconsultants/transcapi-mcp): the API as tools for AI assistants - [Full reference for LLMs](https://www.transcapi.com/llms-full.txt) ## Endpoint reference Generated from https://api.transcapi.com/openapi.json. ### GET /v1/airports.json Airports with scheduled flights in Great Britain The 50 airports in England, Scotland and Wales with scheduled flights, each with its IATA and ICAO codes and its terminal entrances (where passengers arrive, from NaPTAN). Filter by `query` (name, town or code), or give `lat`/`lon` (and optionally `radius` in metres) to sort by distance. Otherwise largest first. - `query` (query, string) - `lat` (query, number) - `lon` (query, number) - `radius` (query, integer) - `limit` (query, integer, default 50) Responses: `200` Airports ### GET /v1/airports/{iata}.json An airport and its public transport An airport by IATA code (LHR, MAN, EDI...) with its terminal entrances; the rail stations within 3 km of a terminal (pass a `crs_code` to /v1/rail/station_timetables/{crs_code}.json for live departures); the bus, coach and tram stops within 500 m with the lines that serve them (pass an `atcocode` to /v1/bus/stop_timetables/{atcocode}.json); and disruptions in force within 3 km. Distances are straight lines to the nearest terminal entrance. - `iata` (path, string, required) Responses: `200` The airport, `404` Not an airport with scheduled flights in Great Britain ### GET /v1/alerts.json List your push alerts Responses: `200` Every alert on this API key ### POST /v1/alerts.json Create a push alert (webhook) TransCAPI POSTs signed JSON to your https URL when the condition is met. vehicle_approaching: a tracked bus is due at `atcocode` within `minutes` (1-30), optionally only `line`. disruption: a disruption newly matches `filters` (any of mode, severity, operator, line, atcocode, lat+lon+radius, planned). The response includes `secret`, shown once, for checking the X-TransCAPI-Signature header. Responses: `201` The alert ### DELETE /v1/alerts/{alert_id}.json Delete a push alert - `alert_id` (path, string, required) ### GET /v1/alerts/{alert_id}.json A push alert and its last 20 deliveries - `alert_id` (path, string, required) ### POST /v1/alerts/{alert_id}/test.json Send a test event to the alert's URL Delivers a `test` event straight away and reports what your server answered. Re-enables a paused alert if the test succeeds. - `alert_id` (path, string, required) ### GET /v1/bus/activity.json Bus activity by line or vehicle Over the last `days` complete days (default 7, 1-28), from the stops each tracked bus was seen passing: trips run, distance driven, buses used, stops served, the places passed and how often, trips by hour, and for each bus its trips, distance and lines. Give operator + line, or operator + vehicle (a fleet number such as 35682, or a vehicle_id from /v1/bus/vehicles.json). Built for bus and roadside advertising: where a line or an advertised bus went and how often. It counts buses, not passengers. Distance is each trip's route length where known, otherwise straight-line between stops plus a quarter. - `operator` (query, string, required) — National Operator Code - `line` (query, string) — Line name as on the bus - `vehicle` (query, string) — Fleet number or vehicle_id - `days` (query, integer, default 7) Responses: `200` Activity summary, `404` Nothing tracked for that line or bus in the period ### GET /v1/bus/reliability.json Bus punctuality by route or line Observed punctuality over the last `days` complete days (default 28, 7-56): the share of stop calls on time, early, late and very late, mean delay and its spread, on-time rates at timing points, first and last stops, and an hour-by-hour breakdown. Give a route_id (from /v1/bus/routes.json), or operator + line. operator alone lists that operator's lines. Measured where TransCAPI tracks buses: northern England and West Sussex. - `route_id` (query, string) - `operator` (query, string) — National Operator Code - `line` (query, string) — Line name as on the bus - `days` (query, integer, default 28) Responses: `200` Punctuality summary, `404` No observations for that route or line ### GET /v1/bus/routes.json Find bus routes by line number, operator, or a stop they serve - `q` (query, string) — Line number or name, e.g. "36" or "X1" - `operator` (query, string) — Operator name or agency id - `atcocode` (query, string) — Only routes calling at this stop - `limit` (query, integer, default 20) - `page` (query, integer, default 1) Responses: `200` List of routes, `400` No search criterion given ### GET /v1/bus/routes/{route_id}.json A bus route's directions, stops and timetable for a day A route id covers every journey run under one line number by one operator, including short workings and school journeys, so `representative_stops` is the longest single journey found rather than a union of them. `timetable` lists that day's journeys in departure order; each carries a `trip_id` to look up with /v1/bus/services/{trip_id}.json. Each entry in `directions` carries a `shape`: the path those journeys actually take, as an encoded polyline (Google algorithm, precision 5) with its point count and length in metres. It is null where the operator publishes no geometry. Do not substitute a line drawn through `representative_stops` for it -- that cuts through buildings and down roads no bus can use. - `route_id` (path, string, required) - `date` (query, string) — Service date (default today, UK local) - `direction` (query, integer (0 | 1)) - `limit` (query, integer, default 50) — Journeys per page of the timetable - `page` (query, integer, default 1) Responses: `200` Route detail, `404` Route not found ### GET /v1/bus/services/{trip_id}.json One scheduled journey - every stop it calls at, and where it is now Answers "where does the 09:42 stop, and where has it got to?" for a single journey. `trip_id` is the value returned as `trip_id` (or `dated_vehicle_journey_ref`) on a stop timetable, or in a route's timetable. `live_vehicle` carries the tracked position and `current_stop_sequence` when a vehicle is working the journey right now, and is null otherwise - including for a journey later today, which has not set off and so has nothing to report. - `trip_id` (path, string, required) - `date` (query, string) — Service date the times are for (default today, UK local) - `live` (query, boolean, default True) — Look up the live vehicle position for this journey Responses: `200` Service detail, `404` Service not found ### GET /v1/bus/stop_reliability/{atcocode}.json Bus punctuality at a stop For each line calling at the stop, over the last `days` complete days (default 28, 7-35): observations, the share on time, early, late and very late, and the median and 90th-percentile delay. Measured where TransCAPI tracks buses: northern England and West Sussex since 4 August 2026, the rest of Great Britain since 30 September 2026. - `atcocode` (path, string, required) - `days` (query, integer, default 28) Responses: `200` One entry per line ### GET /v1/bus/stop_timetables/{atcocode}.json Departures and arrivals for a bus stop, with expected times for tracked buses and live positions - `atcocode` (path, string, required) - `datetime` (query, string) — ISO 8601 datetime to plan around (default now) - `from_offset` (query, integer, default 0) — Minutes from `datetime` to start the departure window - `to_offset` (query, integer, default 60) — Minutes from `datetime` to end the departure window - `limit` (query, integer, default 20) - `live` (query, boolean, default False) — Also fetch live BODS SIRI-VM vehicle positions and match them to departures. Applies to departures only - the feed carries an origin departure time to match on, not an arrival time at this stop. - `type` (query, string (departures | arrivals | both), default departures) — Which board to return. `arrivals` lists services terminating or calling here by the time they arrive, including those that terminate at this stop and so never appear as a departure. Responses: `200` Stop timetable, `404` Stop not found ### GET /v1/bus/stops.json Find bus/tram/rail stops near a location or within a bounding box Roughly a third of stop names are shared by more than one stop, because a name describes a place and the two poles either side of a road are both at it. Three fields tell them apart. `towards` is the commonest destination of journeys calling there, derived from the timetable, and is the one a passenger can act on. `towards_next` is the first differently-named stop the bus calls at next, which separates the pairs that share a destination -- any circular route does. `bearing` is NaPTAN's own compass direction and is the weakest of the three: opposite poles on one road are frequently given the same one. - `lat` (query, number) - `lon` (query, number) - `radius` (query, integer, default 400) — Search radius in metres (used with lat/lon) - `min_lat` (query, number) - `min_lon` (query, number) - `max_lat` (query, number) - `max_lon` (query, number) - `limit` (query, integer, default 20) - `page` (query, integer, default 1) - `type` (query, array of string) Responses: `200` List of stops ### GET /v1/bus/vehicles.json Live bus positions near a point or in a bounding box Every bus reporting its position to BODS in the area, linked to its timetabled trip where the timetable holds it, so `trip_id` can be passed to /v1/bus/services/{trip_id}.json. `delay_seconds` is given where TransCAPI tracks the bus against its timetable (currently wherever the operator reports positions to BODS) and null elsewhere. Positions older than five minutes are left out. - `lat` (query, number) - `lon` (query, number) - `radius` (query, integer, default 1000) — Metres from lat/lon, up to 10000 - `min_lat` (query, number) - `min_lon` (query, number) - `max_lat` (query, number) - `max_lon` (query, number) - `line` (query, string) — Line name, e.g. 52a (case-insensitive) - `operator` (query, string) — Operator code (NOC) or exact name - `limit` (query, integer, default 100) Responses: `200` Live vehicles ### GET /v1/disruptions.json Planned works, incidents and line status across bus, National Rail and TfL modes Combines the DfT's national BODS SIRI-SX bus situation feed, National Rail's Knowledgebase incidents (planned engineering works and unplanned incidents), and TfL's line status for the Tube, DLR, Overground, Elizabeth line and trams, normalised into one shape. Each result carries the `source` it came from (`bods_siri_sx`, `nre_kb`, `tfl`). National Rail incidents list the stations named in their affected routes, with CRS codes and positions, so stop, location and route filters apply to rail too. By default only disruptions currently in force are returned, and lines running a good service are omitted; pass `include_good_service=true` to see every TfL line's status including the healthy ones. The `sources` object reports when each feed was last retrieved and whether it last failed, so an empty list is distinguishable from an outage. - `mode` (query, string) — Comma-separated modes to include - any of `bus`, `tram`, `rail`, `tube`, `dlr`, `overground`, `elizabeth-line`. Default is all of them. `tram` draws on both SIRI-SX and TfL. `rail` is National Rail's engineering works and incidents, plus any rail situations bus operators publish through SIRI-SX. - `severity` (query, string) — Comma-separated severities - any of `severe`, `minor`, `information`, `good`, `unknown`. - `atcocode` (query, string) — Only disruptions naming this stop as affected - `operator` (query, string) — Operator name or code, matched as a substring - `line` (query, string) — Line or route name, matched as a substring - `lat` (query, number) - `lon` (query, number) - `radius` (query, integer, default 2000) — Search radius in metres around lat/lon. Only disruptions naming at least one stop with coordinates can match a geographic query. - `min_lat` (query, number) - `min_lon` (query, number) - `max_lat` (query, number) - `max_lon` (query, number) - `path` (query, string) — An encoded polyline (precision 5, as OpenTripPlanner and Google Maps emit) describing a route. Only disruptions naming a stop within `path_radius` metres of it are returned. Use this rather than a bounding box to ask "what is disrupting this journey": a service number identifies a route only within one operator's area, so filtering by `line` alone will match the same number in other towns. Matching uses each situation's complete stop list, not the capped one in the response. - `path_radius` (query, integer, default 300) — How far from the path a stop may be, in metres. Maximum 5000. Only meaningful alongside `path`. - `planned` (query, boolean) — True for planned works only, false for unplanned incidents only. Omit to include both. - `active_only` (query, boolean, default True) — Exclude disruptions whose validity period has not started or has ended - `include_good_service` (query, boolean, default False) - `limit` (query, integer, default 50) - `page` (query, integer, default 1) Responses: `200` List of disruptions ### GET /v1/journey.json Plan a journey between two points Returns transit itineraries between two coordinates, with per-leg fare estimates and live vehicle positions where available, plus optional walking and cycling alternatives. Covers England, Scotland and Wales (bus, coach, rail, Underground, metro, tram, ferry) up to two months ahead, and the island of Ireland (Translink in Northern Ireland, every NTA-listed operator in the Republic, Luas and Irish Rail) as a separate area: a journey between Great Britain and Ireland returns 422 outside_coverage, as does the Isle of Man. Bus, tram and metro legs follow the operator's route where published (leg_geometry_source). Walking legs carry terrain (climb, descent, steepest gradient, shape and estimated calories, from OS Terrain 50) and each itinerary a walking summary. Every leg and itinerary carries carbon: grams of CO2e from the UK government's 2026 conversion factors, with driving alone the same distance for comparison. Itineraries with changes carry connections: the time to spare at each and the chance of making it, from how the buses involved have run on recent days. - `from_lat` (query, number, required) - `from_lon` (query, number, required) - `to_lat` (query, number, required) - `to_lon` (query, number, required) - `datetime` (query, string) — ISO8601 datetime for departure (or arrival if arrive_by=true). Defaults to now. - `arrive_by` (query, boolean, default False) - `modes` (query, string, default walk,bicycle) — Comma-separated non-transit alternatives to compute alongside the transit result - any of `walk`, `bicycle`, `car`. Pass an empty value to skip them. Transit is always returned. `car` is off by default and returns a single driving itinerary for comparison against transit; like the other alternatives it is subject to the same coverage area, since driving needs the same street network. - `transit_modes` (query, string, default tram,rail) — Comma-separated optional transit sub-modes - any of `tram`, `rail`. Bus and coach are always included. Pass an empty value to search bus and coach only. - `railcard` (query, string) — Price rail legs with a railcard (code from /v1/rail/railcards.json, e.g. YNG for the 16-25 Railcard). - `include_fares` (query, boolean, default True) - `include_live` (query, boolean, default True) - `include_intermediate_stops` (query, boolean, default False) — Include every stop called at on each transit leg. - `max_walk_distance` (query, integer) — Maximum length in metres of any single walking leg. Itineraries with a longer walk are excluded. Does not apply to the direct walking alternative. - `max_total_walk_distance` (query, integer) — Maximum total metres walked across the whole journey, summed over every walking leg. Does not apply to the direct walking alternative. - `max_gradient` (query, number) — Steepest slope, in percent, allowed on any walking leg, up or down (8.3 is the 1-in-12 ramp standard). Itineraries with a steeper walk are excluded, measured from OS Terrain 50. Walks that couldn't be measured don't exclude a journey but leave accessibility.gradient_checked false. - `include_steps` (query, boolean, default False) — Include turn-by-turn directions on each walking leg - direction, street name, distance and coordinate per step. - `limit` (query, integer, default 5) Responses: `200` Journey itineraries, `422` Origin or destination lies outside the routing coverage area ### GET /v1/journey/reachable.json Area reachable by public transport (isochrones) GeoJSON of the area reachable from a point within each cutoff, by bus, coach, tram, metro, Underground, ferry and rail, anywhere in Great Britain or Ireland, leaving at a given time today or tomorrow. Walking to, between and from stops is estimated by straight-line distance with a detour allowance, so edges are good estimates rather than street-exact. - `lat` (query, number, required) - `lon` (query, number, required) - `cutoffs` (query, string, default 15,30,45) — Comma-separated minutes, up to four, each at most 90. - `datetime` (query, string) — Departure time, ISO 8601, now until the end of tomorrow. Defaults to now. - `max_walk` (query, integer, default 800) — Longest walk to or from a stop, metres (100-2000). Responses: `200` A GeoJSON FeatureCollection, `422` Outside Great Britain and Ireland, `503` The day's data isn't built yet ### POST /v1/journey/travel_times.json Travel times from one origin to many destinations Minutes by public transport (with walking) from one point to up to 500 destinations, anywhere in Great Britain or Ireland, leaving at a given time today or tomorrow. null where a destination can't be reached within max_minutes. Walking is estimated by straight-line distance with a detour allowance. Also accepts GET with `to=lat,lon|lat,lon` (up to 100). Responses: `200` One result per destination ### GET /v1/places.json Search for places (stops, settlements, postcodes, streets, landmarks) Streets and landmarks (schools, hospitals, parks, hills, lakes) are Great Britain only, from OS Open Names. A street is matched with its town when the query names one, "Broad Street, Sheffield" or "broad street sheffield"; otherwise nearest to lat/lon, or in the largest towns first. - `query` (query, string) — Free text search term - `type` (query, array of string) - `lat` (query, number) - `lon` (query, number) - `min_lat` (query, number) - `min_lon` (query, number) - `max_lat` (query, number) - `max_lon` (query, number) - `limit` (query, integer, default 20) - `page` (query, integer, default 1) Responses: `200` List of matching places ### GET /v1/rail/fares.json Rail fares between two stations Walk-up and Advance fares for one adult between two stations in Great Britain, from the Rail Delivery Group's fares data: Anytime, Off-Peak, Super Off-Peak and Advance singles and returns, with the route each is valid on, its time restriction and validity. Advance fares are given as a range (`price` from the cheapest tier, `price_to` the dearest): the data has the prices but not how many seats are left at each. With `railcard`, prices are the railcard price and tickets the railcard can't be used with are left out. - `from` (query, string, required) — Origin station CRS code - `to` (query, string, required) — Destination station CRS code - `railcard` (query, string) — Railcard code from /v1/rail/railcards.json, e.g. YNG for the 16-25 Railcard - `class` (query, string (standard | first | all), default all) - `include_seasons` (query, boolean, default False) Responses: `200` Fares, `404` A station isn't in the fares data ### GET /v1/rail/railcards.json Railcards that rail fares can be priced with Responses: `200` Railcards ### GET /v1/rail/routes.json Find rail routes by operator The rail schedule is built from the Network Rail CIF feed, which groups services by operator rather than by named line - so a rail route is one train operating company, and its `operator` field names it. Use /v1/rail/services/{trip_id}.json for an individual train. - `q` (query, string) — Operator name or 2-letter ATOC code, e.g. "Northern" or "NT" - `operator` (query, string) - `crs_code` (query, string) — Only operators calling at this station - `limit` (query, integer, default 20) - `page` (query, integer, default 1) Responses: `200` List of routes, `400` No search criterion given ### GET /v1/rail/routes/{route_id}.json A rail operator's services for a day Because a rail route is a whole operator, `timetable` here is every train that operator runs on the date - thousands for the largest ones - so it is paged, and `representative_stops` is one journey's calling points rather than anything resembling a line. - `route_id` (path, string, required) — 2-letter ATOC code, e.g. NT for Northern - `date` (query, string) — Service date (default today, UK local) - `limit` (query, integer, default 50) - `page` (query, integer, default 1) Responses: `200` Route detail, `404` Route not found ### GET /v1/rail/services/{trip_id}.json One train - every station it calls at, and when Answers "where does the 09:42 to Leeds stop?" for a single train. `trip_id` comes from the `trip_id` field of a station timetable or a route's timetable. For a train running today, each call carries live running from National Rail's Darwin: expected and actual times, status, and the platform at the next station. - `trip_id` (path, string, required) - `date` (query, string) — Service date the times are for (default today, UK local) - `live` (query, boolean, default True) — Merge live running from Darwin, for a train running today. Responses: `200` Service detail, `404` Service not found ### GET /v1/rail/station_timetables/{crs_code}.json Departures and arrivals for a rail station, with live running from National Rail - `crs_code` (path, string, required) — 3-letter station CRS code, e.g. LDS for Leeds - `datetime` (query, string) — ISO 8601 datetime to plan around (default now) - `from_offset` (query, integer, default 0) — Minutes from `datetime` to start the departure window - `to_offset` (query, integer, default 60) — Minutes from `datetime` to end the departure window - `limit` (query, integer, default 20) - `type` (query, string (departures | arrivals | both), default departures) — Which board to return. `arrivals` lists services by the time they reach this station, including those terminating here, which a departure board can never show. - `live` (query, boolean, default True) — Merge live running from National Rail's Darwin: expected times, platforms, cancellations and delay reasons. Applies within two hours either side of now; further out the board is scheduled. Responses: `200` Station timetable, `404` Station not found ### GET /v1/rail/stations.json Find rail stations near a location or within a bounding box - `lat` (query, number) - `lon` (query, number) - `radius` (query, integer, default 5000) — Search radius in metres (used with lat/lon) - `min_lat` (query, number) - `min_lon` (query, number) - `max_lat` (query, number) - `max_lon` (query, number) - `limit` (query, integer, default 20) - `page` (query, integer, default 1) Responses: `200` List of rail stations