Station Departure Boards
Real-time departure boards
This endpoint is the primary backend to departureboards.mobi and provides all the details for displaying the departure boards at a station.
This endpoint is designed to be called once a minute so that real-time updates are shown to the end user.
Please make certain you have read the Conditions of use before using this API.
The output of this endpoint is either a JSON object or null if no station exists a specified 3Alpha/CRS code.
The object consists of:
- station
- The name & crs/3alpha code of the station
- operator
- The operator details of the station
- messages
- The station messages (or null if none) for this station
- departures
- JSON array of the departures
- generated
- ISO timestamp of when this JSON was generated
The departures array contains objects, one per train:
- status
- The status of a specific train like when it's due
- train
- Details about the train that does not change
- forecast
- Forecast information from Darwin
- schedule
- The timetable schedule for the train at this station
- calling
- The stops after this station that the train will call at
- associations
- Association data linking this train to others
Here's an example of a departure boards, simplified for brevity:
$ curl -s http://api.area51.onl/rail/1/station/MDE/boards | jq '.' { "station": { "name": "Maidstone East", "crs": "MDE" }, "operator": { "code": "SE", "name": "Southeastern", "url": "http://www.nationalrail.co.uk/tocs_maps/tocs/SE.aspx" }, "messages": null, "departures": [ { "status": { "platform": "1", "time": "15:36", "delay": 3, "arrive": "15:35", "arrived": false, "startsHere": false, "depart": "15:36", "departed": false, "terminatesHere": false, "via": "via Maidstone East", "length": null, "delayed": false, "cancelled": false, "reason": null, "lastReport": { "name": "Bearsted", "time": "15:31", "delay": 3 } }, "train": { "rid": "201611228746717", "uid": "W46717", "trainId": "2A46", "toc": "Southeastern", "origin": "Ashford International", "departs": "15:10", "dest": "London Victoria", "arrives": "16:37" }, "forecast": { "pta": "15:33", "ptd": "15:33", "wta": "15:32:30", "wtd": "15:33:30" }, "schedule": { "pta": "15:33", "ptd": "15:33", "wta": "15:32:30", "wtd": "15:33:30", "type": "IP", "activity": "T" }, "calling": [ { "crs": "BMG", "name": "Barming", "timetable": "15:38", "time": "15:40", "delay": 2 }, ... { "crs": "BMS", "name": "Bromley South", "timetable": "16:20", "time": "16:21", "delay": 1 }, { "crs": "VIC", "name": "London Victoria", "timetable": "16:37", "time": "16:37", "delay": 0 } ], "associations": [ { "category": "FORMS", "crs": "VIC", "pta": "16:37", "ptd": "16:52", "time": "16:52", "train": { "rid": "201611228748383", "trainId": "2N52", "dest": "Ashford International" } } ] } ], "generated": "2016-11-22T15:32:44Z" }
status
The status object consists of the main details to show on the boards for a train.
- platform
- The platform if known
- time
- The time the train is expected to either depart or arrive
- delay
- The current delay in minutes. If negative then it's running early
- arrive
- The time its expected to arrive. null means it starts from here
- arrived
- true then the train has arrived
- startsHere
- true then the train starts from this station
- depart
- The time the train is expected to depart. null means it terminates here
- departed
- The train as just departed
- terminatesHere
- true then the train terminates at this station
- via
- if not null an additonal string to add to the destination describing stations this train also calls at
- length
- if not null the number of coaches this train is formed of
- delayed
- If this is true then the text "Delayed" must be shown instead of the departure time
- cancelled
- If true then the train has been cancelled
- reason
- If not null then the reason why a train as been delayed (cancelled=false) or cancelled
- lastReport
- When the train is running where we last got a message from the train, the time and delay
train
The train object consists details about the train that doesn not change.
- rid
- Unique ID for this specific run of the train
- uid
- The schedule UID
- trainId
- The Headcode of the train. It's not called headocde as that has a different meaning within schedules.
- toc
- The operator of this service
- origin
- The origin station
- departs
- When the train was timetabled to depart the origin
- dest
- The destination station
- arrives
- When the train was timetabled to arrive at the destination
forecast & schedule
The forecast and schedule objects contain the timetable details at this station. Schedule may be absent if the train is on diversion (so it's not in the main schedule)
- pta
- Public Time of Arrival
- ptd
- Public Time of Departure
- wta
- Working Time of Arrival
- wtd
- Working Time of Departure
- type
- Type of schedule entry (schedule only)
- activity
- Type of activity at this station (schedule only)
calling
The calling array consists of the stations this train is going to stop at after this station. It is sorted in chronological order but will not contain cancelled stops.
- crs
- 3Alpha/CRS code of the station
- name
- Name of the station
- timetable
- The timetabled time at this station
- time
- The expected time at this station
- delay
- the expected delay in minutes at this station
associations
This Array contains association details of this service. Associations are where a train divides part way, joins another service or it forms a new service at it's destination.
- category
- The type of association, FORMS means it forms another service at the destination JOINS means it joins another service at the destination forming a longer train DIVIDES means it divides. The main part remains on this service whilst part of the train forms a new service.
- crs
- 3Alpha/CRS code of the station where this happens
- pta
- Timetabled time the associated train arrives at this station
- ptd
- Timetabled time the associated train departs this station
- time
- ptd or pta if ptd is null
- train.rid
- The RID of the associated service
- train.trainId
- The headCode of the associated service
- train.dest
- The destination of the associated service