Transport for UK API

Transportation / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

Transport for UK (TransportAPI) is a comprehensive transport data platform covering trains, buses, trams, and more across the United Kingdom. It provides real-time departures, journey planning, and timetable data from multiple operators in a unified JSON API. An API key is required — sign up for a free developer account at developer.transportapi.com with 1,000 calls per day.

💡

Beginner Tip

Sign up at developer.transportapi.com for a free app_id and app_key. The bus live departures endpoint is a great starting point: use a UK bus stop ATCO code and your credentials to get live arrivals.

Available Data

match scores and results
team standings
player statistics
schedule and fixtures

Example Response

JSON Response
{
  "route": "Line 1",
  "origin": "Station A",
  "destination": "Station B",
  "departure": "08:30",
  "arrival": "09:15",
  "status": "On Time",
  "delays_min": 0
}

Field Reference

departures Map of route names to arrays of upcoming departures.
departures[route][].line Bus line number or route identifier.
departures[route][].direction Final destination or direction of the bus.
departures[route][].aimed_departure_time Scheduled departure time in HH:MM format.
departures[route][].expected_departure_time Real-time expected departure time, updated live.
stop_name Official name of the bus stop queried.

Implementation Example

const url = "https://developer.transportapi.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

403 Forbidden Missing or invalid app_id and app_key query parameters.
Always include both app_id=YOUR_APP_ID and app_key=YOUR_APP_KEY as query parameters in every request.
Stop not found ATCO code or station code provided is incorrect.
Use the places endpoint to search for stop codes by name before querying live departures.
429 Too Many Requests Free tier limit of 1,000 calls/day has been exceeded.
Cache responses locally, reduce polling frequency, or upgrade to a paid plan for higher limits.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Transportation
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →