Follow trains departures and arrivals live, in any station.

This is the documentation for version 1.0.0 of the API. Last update on Apr 30, 2020.

This API is provided under license Apache 2.0.

Protocol: mqtt
trains.mycompany.com:{port}

SUBSCRIBE trains/departures

Train has left a station

Attributes of a train leaving a station.

Payload
Payload example
{
  "event": "left",
  "sent_at": "2021-05-04T09:42:00+00:00",
  "train_code": "string",
  "train_passengers_count": 42,
  "station_code": "string",
  "station_name": "string"
}
PUBLISH trains/departures

Train has left a station

Attributes of a train leaving a station.

Payload
Payload example
{
  "event": "left",
  "sent_at": "2021-05-04T09:42:00+00:00",
  "train_code": "string",
  "train_passengers_count": 42,
  "station_code": "string",
  "station_name": "string"
}
SUBSCRIBE trains/arrivals

Train has arrived in a station

Attributes of a train arriving in a station.

Payload
Payload example
{
  "event": "left",
  "sent_at": "2021-05-04T09:42:00+00:00",
  "train_code": "string",
  "train_passengers_count": 42,
  "station_code": "string",
  "station_name": "string"
}
PUBLISH trains/arrivals

Train has arrived in a station

Attributes of a train arriving in a station.

Payload
Payload example
{
  "event": "left",
  "sent_at": "2021-05-04T09:42:00+00:00",
  "train_code": "string",
  "train_passengers_count": 42,
  "station_code": "string",
  "station_name": "string"
}