Skip to content
Alpha — Headcode is currently in alpha. APIs and data may change without notice.

Station board filtering

Station board endpoints (/v1/stations/{id}/departures and /v1/stations/{id}/arrivals) support optional query parameters that let you narrow results to specific operators, platforms, or services calling at a particular station.

These filters can be combined to build precise board views for your application.

Use the toc parameter to show only services run by a specific Train Operating Company.

GET /v1/stations/KGX/departures?toc=GR

This returns only LNER (code GR) departures from London Kings Cross. You can find the full list of operator codes via the Operators API.

Use the platform parameter to restrict results to a single platform.

GET /v1/stations/KGX/arrivals?platform=1

This returns only arrivals at platform 1. Platform identifiers match the values returned in the station profile’s platforms array.

Use the calling_at parameter to show only services that call at a specific station. The value should be a TIPLOC code.

GET /v1/stations/KGX/departures?calling_at=YORK

This returns departures from Kings Cross that call at York. This is useful for building “trains to…” views.

Filters can be combined freely. For example, to find LNER departures from platform 1 that call at York:

GET /v1/stations/KGX/departures?toc=GR&platform=1&calling_at=YORK

Use the expand parameter to embed the full service detail — downstream calling points with timing, formation, and associations — directly in each board row, instead of fetching /v1/services/{id} separately per service.

GET /v1/stations/KGX/departures?expand=true

With expand=true, every BoardService row gains a service object. Without it (the default), the service key is absent and responses are unchanged. If a service cannot be resolved at expansion time, its row is still returned with service: null.

Expansion is available on all four board endpoints: /departures, /arrivals, /board, and /next. It combines freely with the filters above. Note that expanded responses are substantially larger — prefer the default behaviour when you only render top-level board rows.

Board results are controlled by the limit parameter (default 20, maximum 100). Filtering is applied before the limit, so you always receive up to limit matching services.