RailFeed API

Dashboard

Every request needs an API key — create one here (owner-issued for now, no public signup yet). Paste it below to use the "Try it" buttons on this page; it's kept only in this browser's local storage, never sent anywhere but RailFeed itself.

GET/api/live_board

Real-time departure/arrival board for a station. Merges CIF schedules with TRUST movements to show scheduled time, actual time, delay, platform, operator, destination, and status.

ParameterTypeDescription
crs *string3-letter CRS code (e.g. LDS, PAD, EUS). Alternatively use tiploc or stanox.
tiplocstringTIPLOC code (e.g. LEEDS, PADTON)
stanoxstringSTANOX code (e.g. 17132)
date optstringYYYY-MM-DD. Default: today.
hours optintTime window in hours (1-24). Default: 2.
type optstringdepartures | arrivals | both | passes. Default: departures. Use passes for through-trains that don't stop.
/api/live_board?crs=LDS&hours=2&type=departures

Response fields

uid, headcode, toc_id, toc_name, toc_type, power_type, traction_class, traction_class_name (human-readable name for EMU/DMU only, e.g. "Class 800 Azuma/AT300", "Sprinter DMU" — null for loco-hauled freight where traction_class is tonnage), train_category, category_description, origin, origin_crs, destination, destination_crs, scheduled_departure, scheduled_arrival, scheduled_pass (WTT pass time — set for through-trains, null otherwise), public_departure, public_arrival, platform (booked platform), actual_platform (last reported platform, may differ from booked), is_pass, is_q_path (boolean — true if Q-path/runs-as-required service), line, estimated_pass_time (interpolated pass time for through-trains, midpoint of adjacent timing points), activated (boolean — true if TRUST activation received, i.e. train is actually running), train_id, actual_departure, actual_arrival, delay_mins, variation_status, delay_monitoring_point (boolean — true if this location is an official delay-attribution point), auto_expected (boolean — true means TRUST calculated this timestamp from the train's last known position rather than observing it directly, because this location has no real-time detection; it's a forecast, not a confirmation, and can be later than the current time for a train that hasn't actually arrived yet), status (expected|active|cancelled|passed — already accounts for auto_expected: a forecast that hasn't elapsed yet won't show as passed), formation (object or null — Darwin Push Port real-time formation data: formation_id raw unit string e.g. "377415+377212", units array of unit numbers, total_coaches integer coach count)

GET/api/service_live

Full calling points for a service with live TRUST movement data overlaid. Shows every stop (ORIGIN, CALL, PASS, TERMINATES) with scheduled vs actual times and per-stop delay.

ParameterTypeDescription
uid *stringSchedule UID (6 chars). Alternatively use train_id.
train_idstringTRUST train_id (10 chars) — resolved to UID via activations table.
date optstringYYYY-MM-DD. Default: today.
/api/service_live?uid=L36739

Response fields

Top level: train_id, date, status (cancelled|active|expected — whole-service status), stop_count, schedule object, stops[] array, formation, associations array (joins/splits with other services — category, and the other schedule's headcode/origin/destination where resolvable).

schedule object: uid, headcode, toc_id, toc_name, power_type, traction_class, traction_class_name, train_category, category_description, stp_indicator, origin, origin_crs, destination, destination_crs.

stops[] array, one per calling point: tiploc, location_name, crs, latitude, longitude (for route mapping), location_type, activity (CIF activity codes), call_type (ORIGIN|CALL|PASS|TERMINATES), platform, actual_platform, scheduled/public arrival/departure/pass, actual_arrival, actual_departure, actual_pass, delay_mins, variation_status, delay_monitoring_point, auto_expected (see live_board — same forecast-vs-confirmed meaning), status (expected|reported|passed — a still-future auto_expected report shows as expected, not reported/passed).

GET/api/services

Find all scheduled services between two stations on a given date. Returns departure/arrival times, journey duration, operator, and whether the train passes or calls.

ParameterTypeDescription
from *stringOrigin station — CRS, TIPLOC, or STANOX.
to *stringDestination station — CRS, TIPLOC, or STANOX.
date optstringYYYY-MM-DD. Default: today.
/api/services?from=LDS&to=YRK

Response fields

CIF-scheduled only (no live overlay) — direct services where one schedule calls at both stations, in order. Does not find journeys requiring a change of train; compose with live_board/departures at a common interchange for that. Per service: uid, headcode, toc_id, toc_name, toc_type, power_type, traction_class, train_category, category_description, origin, origin_crs, destination, destination_crs, from_departure/from_public_departure/from_platform/from_is_pass (at the from station), to_arrival/to_public_arrival/to_platform/to_is_pass (at the to station), journey_mins.

GET/api/delays

Services currently delayed at a station beyond a threshold. Deduplicates by train_id, keeping the worst delay per train.

ParameterTypeDescription
crs *stringCRS code. Alternatively use tiploc or stanox.
threshold optintMinimum delay in minutes. Default: 5.
hours optintLook-back window (1-24). Default: 2.
/api/delays?crs=LDS&threshold=5&hours=2
GET/api/cancellations

Cancelled services, optionally filtered by station. Extracts cancellation data from TRUST 0002 messages and cross-references with CIF schedules. Sorted by the cancelled service's own scheduled departure time (like a normal board), not by when the cancellation message was received — several unrelated trains cancelled around the same moment would otherwise cluster together regardless of how spread across the day their actual times are.

ParameterTypeDescription
crs optstringFilter by station CRS. Omit for network-wide. Also accepts tiploc/stanox.
hours optintLook-back window on when the cancellation was reported (1-48). Default: 6. Note: a cancellation can be issued hours ahead of the service's own scheduled time — this window bounds message recency, not how long the cancellation stays valid.
/api/cancellations?crs=LDS&hours=6
GET/api/movements

Raw TRUST movement events (most recent first). Enriched with TOC names, schedule category, traction data, and location names.

ParameterTypeDescription
limit optintMax rows (1-500). Default: 100.
tiplocstringFilter by TIPLOC.
crsstringFilter by CRS code.
headcodestringFilter by headcode (e.g. 1A05).
headcode_classstringFilter by first digit of headcode (0-9).
freight1|0Freight only.
msg_typestring0001=activation, 0002=cancel, 0003=movement.
/api/movements?crs=LDS&limit=20
GET/api/departures

CIF scheduled departures at a station (STP-resolved). No live data overlay — use /api/live_board for that.

ParameterTypeDescription
crs *stringCRS, TIPLOC, or STANOX.
date optstringYYYY-MM-DD. Default: today.
/api/departures?crs=LDS
GET/api/arrivals

CIF scheduled arrivals at a station (STP-resolved).

ParameterTypeDescription
crs *stringCRS, TIPLOC, or STANOX.
date optstringYYYY-MM-DD. Default: today.
/api/arrivals?crs=LDS
GET/api/schedule

Full CIF calling points for a schedule UID on a date (STP-resolved). No live overlay — use /api/service_live for that.

ParameterTypeDescription
uid *stringSchedule UID (6 chars).
date optstringYYYY-MM-DD. Default: today.
/api/schedule?uid=L36739
GET/api/positions

Latest position per active train (last 2 hours). One row per train_id with the most recent confirmed movement — a still-future forecast at a no-detection location (see auto_expected under live_board) is not used as the position until its predicted time has actually elapsed, so seconds_since_seen is never negative.

ParameterTypeDescription
headcodestringFilter by headcode.
freight1|0Freight only.
/api/positions?headcode=1A05
GET/api/tiploc

Search for TIPLOC locations by name, CRS, or STANOX.

ParameterTypeDescription
q *stringSearch term (matches name, tiploc, CRS, or STANOX).
/api/tiploc?q=leeds
GET/api/toc

List all TOC (Train Operating Company) entries. Includes both ATOC 2-letter codes and TRUST numeric codes.

ParameterTypeDescription
type optstringPASSENGER | FREIGHT | CHARTER.
/api/toc?type=PASSENGER
GET/api/categories

List all train category codes and their descriptions.

/api/categories
GET/api/status

Feed connection status, record counts, last CIF import, recent errors.

/api/status
GET/api/health

Simple health check. Returns {"status":"ok"}.

/api/health