transport.rest API

Beginner's Pick Transportation / No Auth Required Beginner HTTPS CORS
Free to Use Varies (check documentation)

Overview

transport.rest is a community-maintained, developer-friendly public transport API that provides free access to transport data for European networks including Deutsche Bahn (Germany) and the Netherlands. No authentication is needed — just make a GET request and receive clean JSON data. It is designed with simplicity in mind, making it ideal for beginners building travel apps.

Beginner Tip

Start with the German Deutsche Bahn API at https://v6.db.transport.rest — try /stops/nearby with latitude and longitude to find stations near you and get live departure data. No API key needed.

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

id Unique stop or station identifier in the transport network.
name Official name of the stop or station.
location.latitude Geographic latitude coordinate of the stop.
location.longitude Geographic longitude coordinate of the stop.
distance Distance in meters from the queried coordinates to the stop.
products Boolean flags indicating which transport types serve this stop (e.g., nationalExpress, regional, bus).

Implementation Example

Request
const url = "https://transport.rest/";
const response = await fetch(url);
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

400 Bad Request Required query parameters like latitude/longitude or stop ID are missing.
Check the endpoint documentation at transport.rest to see which parameters are required for each route.
Empty results array No stops found near the given coordinates, or the stop ID is invalid.
Verify coordinates are within the supported region and use /stops/search?query= to find valid stop IDs.
503 Service Unavailable Community server may be temporarily down or overloaded.
Retry with exponential backoff — the service is free and community-run, so occasional downtime may occur.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Transportation
Difficulty Beginner
Verified: 2026-04-04

Related Tags

Similar APIs

View All →