TransCAPI — Great Britain transport data API

7 min read Original article ↗

Great Britain transport data API

Every stop, every timetable, one API key.

Bus, tram and rail across England, Scotland and Wales. Live train times from National Rail, live buses linked to their exact trip, disruptions matched to your route, and timetables refreshed every morning. All official open data, served as plain JSON.

Free tier, no card. 1,000 requests a day.

GET /v1/bus/vehicles.json?lat=53.4794&lon=-2.2453
{
  "line": "197",
  "operator": "Bee Network",
  "destination": "Chorlton Street Coach Station",
  "latitude": 53.476608,
  "longitude": -2.241816,
  "delay_seconds": -104
}

387,881stops

631bus operators

1,541,858timetabled journeys

59,372,797timetabled calls

2,653rail stations

Answers a timetable can't give

Built from every bus TransCAPI tracks and every departure in the timetable, not just the next one.

Reachability

Where can I get to in 30 minutes?

The area reachable by public transport from any point in Great Britain, as GeoJSON ready for a map, or the travel time from one place to up to 500 others in a single request. For property search, recruitment, site selection, or "which venue is easiest for everyone?"

Reachability guide

London shaded by how far you can get from King's Cross by public transport in 15, 30 and 45 minutes

Punctuality

How reliable is this bus, really?

Measured, not timetabled: on time, late and very late by route, by stop and by hour, from every tracked bus passing every timing point, on the Traffic Commissioners' definition of on time.

Punctuality guide

First's 51 in Sheffield, last 28 days

68%on time

90%on time leaving the first stop

51%on time at the last stop

1 in 10more than 8 min late at Church Street

From 136,782 observed stop calls. Worst at 17:00, 56% on time. Live from /v1/bus/reliability.json.

Connections

Will I make my change?

Every journey with a change says how often that change has actually worked for those exact buses over recent weeks. A 2-minute change that looks fine on paper and works one day in four is worth knowing about before you're stood at the stop.

How it's worked out

# Sheffield station to Crookes, 08:00
GET /v1/journey.json?from_lat=53.378&from_lon=-1.462
                    &to_lat=53.386&to_lon=-1.513

"connection_chance_pct": 25,
"connections": [
  {
    "at": "West Street/Carver Street",
    "from_line": "120",
    "to_line": "52",
    "spare_s": 120,
    "chance_pct": 25,
    "basis": "trip_history",
    "days": 20
  }
]

Push alerts

Don't poll. We'll tell you.

Register a URL once and TransCAPI posts to it when your bus is a few minutes away, or when a disruption hits your stop, station, operator or route. Signed, retried if your server's down, and included on every plan. No more asking every minute whether anything has changed.

Push alerts docs

# What your server receives
POST /hooks/transcapi
X-TransCAPI-Event: vehicle_approaching
X-TransCAPI-Signature: sha256=bd2b3189aef3...

{
  "type": "vehicle_approaching",
  "data": {
    "atcocode": "370022870",
    "line": "95",
    "destination": "Walkley",
    "minutes_away": 9.5,
    "delay_seconds": 0,
    "vehicle": {
      "latitude": 53.381833,
      "longitude": -1.464979
    }
  }
}

One API across the whole network

Thirteen official feeds in eight formats, matched to each other and kept up to date as they change, so you don't have to.

Stops & places

Search every bus, tram and rail stop in Great Britain by point, radius or bounding box. Each one says which way its buses go, so two stops sharing a name are still tellable apart.

Departures & arrivals

Live rail times from National Rail's Darwin, with platforms, cancellations and delay reasons. Bus times across Great Britain, with live positions where an operator reports them. Arrival boards too — a terminus is a place people get off, not just a place nothing leaves.

Routes & geometry

A line's directions, calling points and the day's timetable — plus the path each direction actually takes, as an encoded polyline. Draw the road, not a line between stops.

Journey planning

Multi-modal itineraries with walking limits, turn-by-turn directions and fare estimates. Door to door, anywhere in Great Britain.

Disruptions

Planned works, incidents and line status for bus, tram, National Rail and the London network, in one shape. Pass a journey's path and get back only what touches that route, not every 21 in the country.

Open data, attributed

Every source and licence is listed, with the attribution line your users need to see. You can build on it commercially, knowing where it all comes from.

Push alerts

Webhooks when a bus is minutes from your stop or a disruption matches your filters. Signed JSON, retried if your server is down, so your app can stop polling.

Punctuality & reachability

How often each bus is really on time, the chance of making a change, and everywhere reachable in 30 minutes, measured from the buses themselves and the full timetable.

Carbon & climb

Every journey says its CO2 on the government's own factors, beside driving it alone, and how much uphill walking it involves, with a limit for gentle routes.

Built for the details that break transport apps

Getting the data is the easy part. These are the parts that take months to get right.

Disruptions that know your route

Pass a journey's path and get back only the roadworks, incidents and line closures that touch it. Service numbers aren't unique: First South Yorkshire runs a 21 in Barnsley and another in Rotherham, so filtering by line alone warns people about the wrong town.

/v1/disruptions.json?path=…&path_radius=300

Live means live, and says so

Rail comes from National Rail's own real-time system, with platforms, cancellations and the reason a train is late. Buses are linked to their exact timetabled trip, not guessed from a line number. Every departure says whether its time is live or timetabled, so you never show a guess as fact.

"source": "darwin"

Fresh every morning

Operators republish their timetables constantly, some every night, and each time the journey ids change. A timetable a few weeks old quietly stops matching the buses on the road. Ours is reloaded from the national export daily, with no downtime.

refreshed daily, 05:30

Roads, not straight lines

Routes come with the path each direction actually takes. Where an operator publishes no geometry you get null, never a line joining the stops, which runs through buildings and down roads no bus can use.

"encoded_polyline": "qutdI|fkGG…"

Stops that say which way

A third of stops share a name with another, usually the pole across the road. Every stop says where its buses are heading, derived from the journeys that call there, which a passenger can act on and "adj" is not.

"towards": "Walkley"

Answers that admit what they don't know

Outside journey planning's coverage you get a clear 422 outside_coverage, not an empty list that reads as "no buses". If a live feed is down the board still comes back, timetabled, with the reason. Unknown delays are null, not zero.

"live_error": null

Safe to build a business on

Every source is official open data, licensed for commercial use and listed with its licence. You get the exact attribution line your app needs to show, so there's nothing to untangle when you launch.

Data sources & attribution

Room to grow before you pay

1,000 requests a day free, with every endpoint and every live feed. Paid tiers start at 50,000 a day, and every response tells you where you stand in its headers.

Pricing

Ask a stop what is coming

One request, an API key in a header, JSON back. No SOAP envelope, no per-operator feed to reconcile, no GTFS zip to unpack at three in the morning.

  • Plain REST and JSON, documented with live examples
  • One key for bus, rail, journeys and disruptions
  • Every source and licence listed, with the attribution line to copy
  • Rate limits that tell you where you stand in the headers

Full API reference

$ curl -H "X-Api-Key: $KEY" \
    "https://api.transcapi.com/v1/bus/stops.json\
?lat=53.3824&lon=-1.4695&radius=100&limit=1"

{
  "member": [
    {
      "atcocode": "370022870",
      "name": "Church Street/High Street",
      "indicator": "HS5",
      "bearing": "W",
      "towards": "Walkley",
      "locality": "Sheffield Centre",
      "latitude": 53.382424,
      "longitude": -1.46953,
      "distance": 3.3
    }
  ]
}

All of Great Britain, and we show our working

That is not an illustration. Every mark is a stop in the register — 387,881 of them — plotted from the same table the API answers from. Great Britain draws itself.

Where coverage is thinner, the docs say so rather than letting you find out. Route geometry exists for the operators that publish it. Northern Ireland isn't covered: its network is published separately, outside the national feeds.

Start in five minutes

Build something with it

Free key, every endpoint, no card. Upgrade when your traffic says so.

Get your API key