UK Passenger Transport API documentation
The Phase 1 API provides a consistent national location and identifier layer for UK public transport. Responses are JSON and all protected requests use an API key.
Free accounts include 10,000 requests per calendar month, with a 60 requests-per-minute limit.
Authentication
Send your key in the X-API-Key request header. Create an account to issue, rotate and revoke your own keys from the account dashboard.
curl -H "X-API-Key: ukpt_…" \
"https://api.ukpt.botric.co.uk/v1/locations/search?q=Preston"Interactive reference
Explore request parameters, response schemas and status codes in the generated OpenAPI reference.
Open API referenceData sources, coverage and refresh times
Refresh times use Europe/London time. Live feeds may arrive late during upstream outages; scheduled quality checks monitor freshness and import coverage.
| Dataset | Gathered from | Refresh | Coverage |
|---|---|---|---|
| Bus stops and localities | NaPTAN and NPTG, Department for Transport | Daily overnight | Names, coordinates, ATCO/NaPTAN codes and locality hierarchy |
| Rail-replacement stops | DfT NaPTAN Rail Replacement Locations | Daily at 00:45 | Official replacement-stop locations, ATCO codes and station links |
| Bus services, routes and calling patterns | Bus Open Data Service (BODS), TransXChange | One NOC every hour; full catalogue continuously cycles | English registered bus timetables, route numbers, LineRef and ServiceCode |
| Bus operators and NOC codes | BODS operator catalogue | Refreshed during each hourly NOC pass | Operator identities, NOC codes and dataset import state |
| Live bus vehicle positions | Bus Open Data Service (BODS), SIRI-VM | Polled every 15 seconds; positions expire after 10 minutes | Vehicle references, lines, journeys, GPS coordinates, bearings and destinations where supplied |
| Rail stations and identifiers | National Rail Knowledgebase and Network Rail CORPUS | Knowledgebase daily at 06:00; CORPUS weekly Sunday | Stations, accessibility, CRS, TIPLOC, STANOX, NLC and UIC identifiers |
| Planned trains and replacement buses | Network Rail Schedule/CIF | Daily at 05:50; rolling horizon up to about 12 weeks | Planned calling patterns, UIDs, TOCs and category BR replacement buses |
| Near-term rail timetable | National Rail Darwin Timetable Files | Checked daily at 05:40 | Dated operational timetables and planned station calls |
| Live trains and replacement services | National Rail Darwin realtime Kafka | Continuous, normally within seconds | RIDs, estimates, actual times, platforms and cancellations |
| London transport | Transport for London Unified API | Daily at 05:00 | London Underground, bus, tram and other supported TfL lines |
| Regional tram and metro | Traveline National Dataset (TNDS) | Weekly Sunday at 05:30 | Manchester Metrolink, Sheffield Supertram and other available urban networks |
Location endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/locations | List and filter transport locations |
| GET | /v1/locations/{id} | Fetch one location and all known identifiers |
| GET | /v1/locations/search?q= | Search locations by name |
| GET | /v1/locations/near?lat=&lon=&radius= | Find locations within a radius in metres |
| GET | /v1/resolve?crs=&naptan=&atco=&tiploc= | Resolve a source identifier |
| GET | /v2/locations/{type} | List locations by tag, for example RailReplacement |
| GET | /v2/rail/stations/{crs}/nearby-bus-services?distance=500 | List bus operators, routes, destinations and calling patterns near a station |
| GET | /v1/rail/railreplacement?date=YYYY-MM-DD&toc=XX | List live and 12-week planned replacements; TOC is optional |
| GET | /v1/rail/railreplacement/{rid} | Get a replacement journey and linked ATCO stops |
| GET | /v1/rail/railreplacement/{uid}/{date} | Get a future or live replacement by UID and date |
| GET | /v1/rail/train/{rid} | Get an ordered rail journey by RID |
| GET | /v1/tfl/rail | List TfL rail, Tube, DLR and tram lines |
| GET | /v1/tfl/bus | List TfL bus lines with matched operator tags |
| GET | /v1/tfl/stations | List TfL rail and metro stations |
| GET | /v1/tfl/bus-stops | List TfL bus stops |
| GET | /v1/tfl/operators | List operators safely matched to TfL lines |
| GET | /v1/tfl/search?q= | Search TfL lines, locations and operators |
| GET | /v1/tfl/bus/{route_number} | Get operators, calling patterns and identified stops for a TfL bus route |
| GET | /v1/tfl/rail/{line_name} | Get every calling-pattern variation and stop for a TfL rail line |
| GET | /v1/tfl/rail/status | Get current TfL rail network status, cached for 60 seconds |