Get non-stopping (passing) trains for a station
const url = 'https://api.headcode.dev/v1/stations/KGX/passing?limit=20&expand=false&time_offset=0&time_window=120';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.headcode.dev/v1/stations/KGX/passing?limit=20&expand=false&time_offset=0&time_window=120' \ --header 'Authorization: Bearer <token>'Returns live non-stopping trains that pass through a station without calling, derived from normalised Darwin service and status data. Times are working times, not public timetable times, since passing trains have no public schedule at this station. Results are at station/TIPLOC granularity only - there is no filtering by physical running line (Fast/Slow/Up/Down); that would require a new data source and is a Future Enhancement, not delivered by this endpoint. The station identifier accepts the same CRS/TIPLOC/STANOX/NLC/slug/ATCO/UIC values as the station lookup endpoint.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Any station identifier: CRS code (e.g. KGX), TIPLOC (e.g. KNGX), STANOX (e.g. 10101), NLC, URL slug (e.g. london-kings-cross), ATCO, or UIC.
Example
KGXQuery Parameters
Section titled “Query Parameters ”Maximum number of board rows to return.
When true, each board row includes the full service detail (calling points, formation, associations) under a service key. Defaults to false.
Filter by destination station. Accepts the same identifier formats as station ID.
Filter by TOC/operator code.
Filter by calling station TIPLOC.
Shift the query window by X minutes from now(); supports negative values.
Duration of the query window in minutes (default 120).
Responses
Section titled “ Responses ”Non-stopping trains passing through the station.
object
object
Darwin RID.
Six-character CIF UID.
Four-character signalling headcode.
Two-character ATOC/TOC code.
TIPLOC visit at this station.
Working passing time, HH:MM:SS. Non-stopping trains have no public timetable time at this station.
Public estimated time, HH:MM.
Working estimated time, HH:MM:SS.
Actual time, HH:MM, when available.
Whether Darwin reports the forecast as delayed/unknown.
object
Darwin Run ID.
Six-character CIF UID.
Four-character headcode (signalling train identity).
Retail Service ID (6 or 8 characters).
Scheduled start date.
Two-character ATOC operator code.
Whether this is a passenger service.
Whether the service is currently active in Darwin.
Whether this is a charter service.
Whether the train is running in reverse formation.
A delay or cancellation reason.
object
Reason code.
TIPLOC where the reason applies.
Whether the location is near the reason site.
A delay or cancellation reason.
object
Reason code.
TIPLOC where the reason applies.
Whether the location is near the reason site.
Ordered calling points with live status.
object
Position in the calling order.
Schedule location type.
TIPLOC code for this location.
Raw 12-character activity code string.
Whether this calling point is cancelled.
Scheduled public arrival time (HH:MM).
Scheduled public departure time (HH:MM).
Scheduled working arrival time (HH:MM:SS).
Scheduled working departure time (HH:MM:SS).
Scheduled working pass time (HH:MM:SS).
Platform assignment and status.
object
Platform number or identifier.
Whether the platform is confirmed.
Whether the platform is suppressed from displays.
Platform source (P=Planned, A=Automatic, M=Manual).
Real-time status for an arrival, departure, or pass.
object
Estimated time (HH:MM).
Working estimated time (HH:MM:SS).
Actual time (HH:MM).
Whether the forecast is unknown-delay.
Real-time status for an arrival, departure, or pass.
object
Estimated time (HH:MM).
Working estimated time (HH:MM:SS).
Actual time (HH:MM).
Whether the forecast is unknown-delay.
Real-time status for an arrival, departure, or pass.
object
Estimated time (HH:MM).
Working estimated time (HH:MM:SS).
Actual time (HH:MM).
Whether the forecast is unknown-delay.
Loading/crowding data for this calling point.
object
Loading category description (e.g. “Seats available”).
Loading category type.
Overall loading percentage (0-100).
Per-coach loading data.
Loading data for a specific coach.
object
Coach identifier.
Loading percentage for this coach (0-100).
When this loading data was last updated.
Links to other services (joins, splits, etc.).
object
Association type.
RID of the associated service.
UID of the associated service.
TIPLOC where the association occurs.
Whether the association is cancelled.
Train formation (coaches).
object
Formation identifier.
object
Coach identifier (e.g. “A”).
Coach class.
Toilet type available.
Toilet availability status.
Example
{ "station_crs": "KGX", "station_name": "London Kings Cross", "services": [ { "rid": "202605141A45", "uid": "C12345", "train_id": "1A45", "toc_code": "GR", "tiploc": "KNGX", "working_pass": "10:02:30", "estimated": "10:05", "service": { "rid": "202605141A45", "uid": "C12345", "train_id": "1A45", "ssd": "2026-05-14", "toc_code": "GR", "calling_points": [ { "location_type": "OR", "tiploc": "KNGX", "public_arrival": "14:30", "public_departure": "14:32", "platform": { "platform": "1", "source": "P" } } ], "associations": [ { "category": "JJ" } ], "formation": { "coaches": [ { "number": "A", "coach_class": "First" } ] } } } ]}Invalid request.
The request is invalid.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/general/bad-request", "title": "Bad Request", "status": 400, "detail": "Both 'lat' and 'lng' must be provided together.", "code": "HEADCODE.GENERAL.BAD_REQUEST"}API key is missing or invalid.
Authentication is missing or invalid.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/general/unauthorized", "title": "Unauthorized", "status": 401, "detail": "missing or malformed Bearer token", "code": "HEADCODE.GENERAL.UNAUTHORIZED"}API key does not have the required scope.
The API key does not have the required scope.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/general/forbidden", "title": "Forbidden", "status": 403, "detail": "API key does not have the required scope 'reference:read'.", "code": "HEADCODE.GENERAL.FORBIDDEN"}No station matches the given identifier.
No station matches the supplied identifier.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/stations/not-found", "title": "Station Not Found", "status": 404, "detail": "No station found for identifier 'XYZ'.", "code": "HEADCODE.STATIONS.NOT_FOUND"}The client has exceeded its rate limit.
The client has sent too many requests in a given amount of time.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/general/rate-limited", "title": "Too Many Requests", "status": 429, "detail": "Rate limit exceeded. Please retry after 30 seconds.", "code": "HEADCODE.GENERAL.RATE_LIMITED"}An unexpected internal error occurred.
An internal error occurred.
object
A URI reference that identifies the problem type.
A short, human-readable summary of the problem type.
The HTTP status code generated by the origin server for this occurrence.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem.
An API-specific error code aiding consumers and the provider team understand the error based on the Headcode error taxonomy.
Optional list of explicit details about the problem for an API consumer.
An object to provide explicit details on a problem towards an API consumer.
object
A granular description on the specific error related to a body property, query parameter, path parameter, and/or header.
A JSON Pointer to a specific request body property that is the source of error.
The name of the query or path parameter that is the source of error.
The name of the header that is the source of error.
A string containing additional provider specific codes to identify the error context.
Example
{ "type": "https://docs.headcode.dev/errors/general/internal-server-error", "title": "Internal Server Error", "status": 500, "detail": "An internal error occurred.", "code": "HEADCODE.GENERAL.INTERNAL_SERVER_ERROR"}