Back to Top

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}

Be informed of all train departures

SUB trains/departures
SUBSCRIBE trains/departures

Train has left a station

Attributes of a train leaving a station.

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

Inform of a train departure

PUB trains/departures
PUBLISH trains/departures

Train has left a station

Attributes of a train leaving a station.

Payload
Payload example
{
  "event": "left",
  "sent_at": "2022-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": "2022-05-04T09:42:00+00:00",
  "train_code": "string",
  "train_passengers_count": 42,
  "station_code": "string",
  "station_name": "string"
}

Inform of a train arrival

PUB trains/arrivals
PUBLISH trains/arrivals

Train has arrived in a station

Attributes of a train arriving in a station.

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