iRail API Docs

API Endpoint

iRail supports digital creativity concerning mobility in Belgium. This is an attempt to make the railway time schedules in Belgium easily available for anyone.

The iRail api allows anyone to query trains, stations, liveboards and connections.

The API is available at https://api.irail.be. This reference covers the V1 data endpoints and the occupancy feedback endpoint. The legacy unversioned stations, liveboard, connections, vehicle, composition, and disturbances routes respond with HTTP 303 redirects to their /v1/ equivalents.

You can check the current status of the API at status.irail.be

Best practices when using the API

If you build an application on top of the iRail api, be sure to do at least one of the following things:

  • If possible, set the user-agent header string. Include the name of your application, and a way to contact you in case something would go wrong. An example user agent string format is <application name>/<application version> (<website>; <mail>), which could result in the following string: irail/1.2.0 (irail.be; hello@irail.be). The use of a user agent string like this isn’t obligated or enforced, but allows for better communication.

  • If you can’t set the user agent string, at least be sure to follow us on github, website or gitter.

Request limits

You can make up to 3 requests per second per source IP address. Every IP address also has 5 burst requests, meaning you can either have 8 requests in 1 second or 15 requests in 3 seconds, but you will need to drop below 3 requests per second in order for these burst requests to refill.

Exceeding the request limit will cause the server to return 429 responses.

Request limits are set so everyone can enjoy open transport data with high availability and fast response times. Please don’t use excessive polling: always optimise your application, even when you’re not reaching our request limitations (yet).

Are you limited by our request limits? Get in touch to see if we can work out a better request strategy together.

Always undertake action when your application receives frequent “429 Too Many Requests” responses! When your application causes too much requests, one of the following actions will happen

  • When the user agent is set, we will contact the developers at the provided e-mail address or website. In case of excessive requests for a long period of time (e.g. multiple 429 responses per second for more than 3 hours), your application might be blocked before we receive a response. We will still contact you to assist with resolving the issue and increasing the efficiency of your requests.

  • When no user agent is set, the source IP address will be blocked without prior warnings. If your IP address is blocked, please contact the iRail team to resolve this.

URIs

The iRail API uses URIs (Uniform Resource Identifications) to identify departures, stations, trains and occupancies. This way, there can be no misinterpretations. While there might be multiple meanings or interpretations possible for “Brussels South” (for example, the railway station, the airport, maybe the region south of Brussels), the URI http://irail.be/stations/NMBS/008814001 means the railway station Brussels south, and nothing else. The meaning of this URI doesn’t change on other websites, APIs, or datasets. URIs don’t change often, and don’t have to be human readable. They can change however, therefore they shouldn’t be composed by the user, but should be retrieved from a previous response.

URI’s are ids, just like numeric ids. While in this case they represent a URL, these URLs do not make part of the API! All API requests go to https://api.irail.be! Ids can be used on any domain, but if the id is the same url, you know that the objects represent the same thing, even if they are in different APIs or applications.

URIs in use by the iRail API

The following objects are identified by a URI:

Response formats

Use format=json for JSON responses on the V1 data endpoints. XML is the default and is also returned for an unknown format value. The Accept header alone does not select JSON.

In V1 JSON data responses, timestamps, counts, delays, coordinates, and flags such as canceled are strings. Flags typically use "0" and "1". Interpret numeric strings according to the field descriptions, and keep platform designations and IDs as strings.

Check the HTTP status before parsing the response. Most V1 errors are JSON objects with exception and message, even for requests using format=xml. They can also include diagnostic fields such as at, stackTrace, and cause. Some validation errors return a plain-text body.

Caching

Follow the Cache-Control header when present. V1 does not provide ETag-based conditional requests.

Bug reports

You can report bugs in the api on the API github repository. You can report mistakes in the documentation on the documentation github repository.

Stations

Retrieve a list of all stations. Alternatively, you can check out our repo at https://github.com/iRail/stations for a CSV of all stations, and nodejs scripts to convert this CSV to other formats.

Stations API

GET /v1/stations?format=json&lang=en
RequestsJsonXML
Headers
Accept: application/json
Responses200
Headers
Content-Type: application/json
Access-Control-Allow-Origin: "*"
Body
{
  "version": "1.4",
  "timestamp": "1489621486",
  "station": [
    {
      "id": "BE.NMBS.008821006",
      "@id": "http://irail.be/stations/NMBS/008821006",
      "locationX": "4.421101",
      "locationY": "51.2172",
      "standardname": "Antwerpen-Centraal",
      "name": "Antwerp-Central"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "version": {
      "type": "string"
    },
    "timestamp": {
      "type": "string"
    },
    "station": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
          },
          "@id": {
            "type": "string"
          },
          "locationX": {
            "type": "string",
            "description": "The longitude of the station"
          },
          "locationY": {
            "type": "string",
            "description": "The latitude of the station"
          },
          "standardname": {
            "type": "string",
            "description": "The consistent name of this station"
          },
          "name": {
            "type": "string",
            "description": "The default name of this station"
          }
        },
        "required": [
          "id",
          "@id",
          "locationX",
          "locationY",
          "standardname",
          "name"
        ]
      }
    }
  },
  "required": [
    "version",
    "timestamp",
    "station"
  ]
}
Headers
Accept: application/xml
Responses200
Headers
Content-Type: application/xml
Access-Control-Allow-Origin: "*"
Body
<stations version="1.4" timestamp="1489621390">
   <station id="BE.NMBS.007015400" locationX="-0.1260606" locationY="51.5310399" URI="http://irail.be/stations/NMBS/007015400" standardname="London Saint Pancras International">London Saint Pancras International</station>
</stations>

Retrieve all stations
GET/v1/stations{?format,lang}

URI Parameters
HideShow
format
string (optional) Default: xml Example: json

The response format

Choices: xml json

lang
string (optional) Default: en Example: en

The language of any text or names in the response.

Choices: nl fr en de


Liveboard

Liveboards provides real-time informations on arriving and departing trains for every Belgian station.

Liveboard API

Be aware

Trying to query data way in the past, or way in the future, might result in error 500 responses. If you’re not sure what causes an error 500 response, be sure to check if your query works for the current day, or if the NMBS website has the data for the date you want to look up.

GET /v1/liveboard?id=BE.NMBS.008892007&station=Gent-Sint-Pieters&date=300917&time=1230&arrdep=departure&lang=en&format=json
RequestsJsonArrivals JSONXML
Headers
Accept: application/json
Responses200400
Headers
Content-Type: application/json
Access-Control-Allow-Origin: "*"
Body
{
  "version": "1.4",
  "timestamp": "1489614297",
  "station": "Ghent-Sint-Pieters",
  "stationinfo": {
    "id": "BE.NMBS.008821006",
    "@id": "http://irail.be/stations/NMBS/008821006",
    "locationX": "4.421101",
    "locationY": "51.2172",
    "standardname": "Antwerpen-Centraal",
    "name": "Antwerp-Central"
  },
  "departures": {
    "number": "32",
    "departure": [
      {
        "id": "0",
        "delay": "0",
        "station": "Antwerp-Central",
        "stationinfo": {
          "id": "BE.NMBS.008821006",
          "@id": "http://irail.be/stations/NMBS/008821006",
          "locationX": "4.421101",
          "locationY": "51.2172",
          "standardname": "Antwerpen-Centraal",
          "name": "Antwerp-Central"
        },
        "time": "1489575600",
        "vehicle": "BE.NMBS.IC3033",
        "vehicleinfo": {
          "name": "BE.NMBS.IC3033",
          "shortname": "IC 3033",
          "number": "3033",
          "type": "IC",
          "locationX": "0",
          "locationY": "0",
          "@id": "http://irail.be/vehicle/IC3033"
        },
        "platform": "4",
        "platforminfo": {
          "name": "4",
          "normal": "1"
        },
        "canceled": "0",
        "left": "0",
        "isExtra": "0",
        "departureConnection": "http://irail.be/connections/8821006/20170316/IC1832",
        "occupancy": {
          "@id": "http://api.irail.be/terms/unknown",
          "name": "unknown"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "version": {
      "type": "string"
    },
    "timestamp": {
      "type": "string"
    },
    "station": {
      "type": "string"
    },
    "stationinfo": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
        },
        "@id": {
          "type": "string"
        },
        "locationX": {
          "type": "string",
          "description": "The longitude of the station"
        },
        "locationY": {
          "type": "string",
          "description": "The latitude of the station"
        },
        "standardname": {
          "type": "string",
          "description": "The consistent name of this station"
        },
        "name": {
          "type": "string",
          "description": "The default name of this station"
        }
      },
      "required": [
        "id",
        "@id",
        "locationX",
        "locationY",
        "standardname",
        "name"
      ]
    },
    "departures": {
      "type": "object",
      "properties": {
        "number": {
          "type": "string"
        },
        "departure": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "delay": {
                "type": "string",
                "description": "The departure delay, in seconds"
              },
              "station": {
                "type": "string"
              },
              "stationinfo": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
                  },
                  "@id": {
                    "type": "string"
                  },
                  "locationX": {
                    "type": "string",
                    "description": "The longitude of the station"
                  },
                  "locationY": {
                    "type": "string",
                    "description": "The latitude of the station"
                  },
                  "standardname": {
                    "type": "string",
                    "description": "The consistent name of this station"
                  },
                  "name": {
                    "type": "string",
                    "description": "The default name of this station"
                  }
                },
                "required": [
                  "id",
                  "@id",
                  "locationX",
                  "locationY",
                  "standardname",
                  "name"
                ]
              },
              "time": {
                "type": "string",
                "description": "The unix timestamp, expressed as seconds since January 1st 1970"
              },
              "vehicle": {
                "type": "string"
              },
              "vehicleinfo": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "shortname": {
                    "type": "string"
                  },
                  "number": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "locationX": {
                    "type": "string"
                  },
                  "locationY": {
                    "type": "string"
                  },
                  "@id": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "shortname",
                  "number",
                  "type",
                  "locationX",
                  "locationY",
                  "@id"
                ]
              },
              "platform": {
                "type": "string",
                "description": "The platform from which this train will depart"
              },
              "platforminfo": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The platform name. **Warning** Do not treat this as a number. This value can also be '1B' for example, or '?' when unknown."
                  },
                  "normal": {
                    "type": "string",
                    "description": "Whether or not this is the normal platform. If 0, a platform change has happened in real time."
                  }
                },
                "required": [
                  "name",
                  "normal"
                ]
              },
              "canceled": {
                "type": "string",
                "description": "Whether or not this train has been cancelled"
              },
              "left": {
                "type": "string",
                "description": "Whether or not this train has been left the station"
              },
              "isExtra": {
                "type": "string",
                "description": "Whether this is an added service."
              },
              "departureConnection": {
                "type": "string",
                "description": "A unique URI for this departure"
              },
              "occupancy": {
                "type": "object",
                "properties": {
                  "@id": {
                    "type": "string",
                    "description": "The linked-data id of this term"
                  },
                  "name": {
                    "type": "string",
                    "description": "Occupancy level, one of `unknown`, `low`, `medium`, or `high`."
                  }
                },
                "required": [
                  "@id",
                  "name"
                ],
                "description": "The occupancy on this train. `unknown` indicates unavailable data."
              }
            },
            "required": [
              "id",
              "delay",
              "time",
              "vehicle",
              "vehicleinfo",
              "platform",
              "platforminfo",
              "canceled",
              "left",
              "isExtra"
            ]
          }
        }
      },
      "required": [
        "number",
        "departure"
      ]
    }
  },
  "required": [
    "version",
    "timestamp",
    "station",
    "departures"
  ]
}
Headers
Content-Type: application/json
Body
{
  "exception": "RequestedStopNotFoundException",
  "message": "Invalid request, value 'Retie' for parameter 'station' is invalid: Requested stop not found: Retie",
  "at": "LiveboardV1Controller.java:123",
  "stackTrace": []
}
Headers
Accept: application/json
Responses200
Headers
Content-Type: application/json
Body
{
  "version": "1.4",
  "timestamp": "1489614297",
  "station": "Ghent-Sint-Pieters",
  "stationinfo": {
    "id": "BE.NMBS.008821006",
    "@id": "http://irail.be/stations/NMBS/008821006",
    "locationX": "4.421101",
    "locationY": "51.2172",
    "standardname": "Antwerpen-Centraal",
    "name": "Antwerp-Central"
  },
  "arrivals": {
    "number": "1",
    "arrival": [
      {
        "id": "0",
        "delay": "0",
        "station": "Antwerp-Central",
        "stationinfo": {
          "id": "BE.NMBS.008821006",
          "@id": "http://irail.be/stations/NMBS/008821006",
          "locationX": "4.421101",
          "locationY": "51.2172",
          "standardname": "Antwerpen-Centraal",
          "name": "Antwerp-Central"
        },
        "time": "1489575600",
        "vehicle": "BE.NMBS.IC3033",
        "vehicleinfo": {
          "name": "BE.NMBS.IC3033",
          "shortname": "IC 3033",
          "number": "3033",
          "type": "IC",
          "locationX": "0",
          "locationY": "0",
          "@id": "http://irail.be/vehicle/IC3033"
        },
        "platform": "4",
        "platforminfo": {
          "name": "4",
          "normal": "1"
        },
        "canceled": "0",
        "arrived": "0",
        "isExtra": "0",
        "departureConnection": "http://irail.be/connections/8821006/20170316/IC1832"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "version": {
      "type": "string"
    },
    "timestamp": {
      "type": "string"
    },
    "station": {
      "type": "string"
    },
    "stationinfo": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
        },
        "@id": {
          "type": "string"
        },
        "locationX": {
          "type": "string",
          "description": "The longitude of the station"
        },
        "locationY": {
          "type": "string",
          "description": "The latitude of the station"
        },
        "standardname": {
          "type": "string",
          "description": "The consistent name of this station"
        },
        "name": {
          "type": "string",
          "description": "The default name of this station"
        }
      },
      "required": [
        "id",
        "@id",
        "locationX",
        "locationY",
        "standardname",
        "name"
      ]
    },
    "arrivals": {
      "type": "object",
      "properties": {
        "number": {
          "type": "string"
        },
        "arrival": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "delay": {
                "type": "string",
                "description": "The arrival delay, in seconds"
              },
              "station": {
                "type": "string"
              },
              "stationinfo": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
                  },
                  "@id": {
                    "type": "string"
                  },
                  "locationX": {
                    "type": "string",
                    "description": "The longitude of the station"
                  },
                  "locationY": {
                    "type": "string",
                    "description": "The latitude of the station"
                  },
                  "standardname": {
                    "type": "string",
                    "description": "The consistent name of this station"
                  },
                  "name": {
                    "type": "string",
                    "description": "The default name of this station"
                  }
                },
                "required": [
                  "id",
                  "@id",
                  "locationX",
                  "locationY",
                  "standardname",
                  "name"
                ]
              },
              "time": {
                "type": "string",
                "description": "The unix timestamp, expressed as seconds since January 1st 1970"
              },
              "vehicle": {
                "type": "string"
              },
              "vehicleinfo": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "shortname": {
                    "type": "string"
                  },
                  "number": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "locationX": {
                    "type": "string"
                  },
                  "locationY": {
                    "type": "string"
                  },
                  "@id": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "shortname",
                  "number",
                  "type",
                  "locationX",
                  "locationY",
                  "@id"
                ]
              },
              "platform": {
                "type": "string",
                "description": "The platform from which this train arrives"
              },
              "platforminfo": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The platform name. **Warning** Do not treat this as a number. This value can also be '1B' for example, or '?' when unknown."
                  },
                  "normal": {
                    "type": "string",
                    "description": "Whether or not this is the normal platform. If 0, a platform change has happened in real time."
                  }
                },
                "required": [
                  "name",
                  "normal"
                ]
              },
              "canceled": {
                "type": "string",
                "description": "Whether or not this train has been cancelled"
              },
              "arrived": {
                "type": "string",
                "description": "Whether the train has arrived"
              },
              "isExtra": {
                "type": "string",
                "description": "Whether this is an added service."
              },
              "departureConnection": {
                "type": "string",
                "description": "A unique URI for this departure"
              }
            },
            "required": [
              "id",
              "delay",
              "time",
              "vehicle",
              "vehicleinfo",
              "platform",
              "platforminfo",
              "canceled",
              "arrived",
              "isExtra"
            ]
          }
        }
      },
      "required": [
        "number",
        "arrival"
      ]
    }
  },
  "required": [
    "version",
    "timestamp",
    "station",
    "arrivals"
  ]
}
Headers
Accept: application/xml
Responses200
Headers
Content-Type: application/xml
Access-Control-Allow-Origin: "*"
Body
<liveboard version="1.4" timestamp="1489614530">
    <station id="BE.NMBS.008892007" locationX="3.710675" locationY="51.035896" URI="http://irail.be/stations/NMBS/008892007" standardname="Gent-Sint-Pieters">Ghent-Sint-Pieters</station>
    <departures number="1">
        <departure id="0" delay="0" canceled="0" left="0" isExtra="0">
            <station id="BE.NMBS.008892908" locationX="3.602552" locationY="50.742506" URI="http://irail.be/stations/NMBS/008892908" standardname="Ronse">Ronse</station>
            <time formatted="2017-03-15T12:00:00">1489575600</time>
            <vehicle URI="http://irail.be/vehicle/L782" shortname="L 782" number="782" type="L" locationX="0" locationY="0">BE.NMBS.L782</vehicle>
            <platform normal="1">4</platform>
            <departureConnection>http://irail.be/connections/8892007/20170315/L782</departureConnection>
            <occupancy URI="http://api.irail.be/terms/unknown">unknown</occupancy>
        </departure>
    </departures>
</liveboard>

Retrieve a liveboard
GET/v1/liveboard{?id,station,date,time,arrdep,lang,format}

A liveboard for a specified station. This includes departures or arrivals, along with their delays, train ids, occupancy, …

For Brussels South departures, use /v1/liveboard?station=Brussel-Zuid&arrdep=departure&format=json. Arrival results are in arrivals.arrival and use arrived instead of left. An unknown station or a request with neither station parameter returns HTTP 400.

URI Parameters
HideShow
station
string (optional) Example: Gent-Sint-Pieters

The name of the station to query. Supply either station or id.

id
string (optional) Example: BE.NMBS.008892007

If you know the id of a station, this might be used instead of a name. A nonempty id takes precedence if both are supplied.

arrdep
string (optional) Default: departure Example: departure

Whether the results should show arrivals departures in the station.

Choices: departure arrival

time
string (optional) Default: current time in Belgium Example: 1230

The time to query.

The time is formatted as hhmm.

date
string (optional) Default: current date in Belgium Example: 300917

The date to query.

The date is formatted as ddmmyy.

format
string (optional) Default: xml Example: json

The response format

Choices: xml json

lang
string (optional) Default: en Example: en

The language of any text or names in the response.

Choices: nl fr en de


Connections

Get routes between two stations, including realtime data on delays.

Connections API

As of January 20, the following data has been added:

  • Intermediate stops are stops where the train will stop, but where the traveller remains seated.

Journey alerts are in alerts.alert.

Be aware

Trying to query data way in the past, or way in the future, might result in error 500 responses. If you’re not sure what causes an error 500 response, be sure to check if your query works for the current day, or if the NMBS website has the data for the date you want to look up.

Handling a walking via

In some cases, there might be a walking part in a route. This happens for example when a user arrives in Haren-Zuid and has a next train in Haren, only a few hundred meters further.

  • For walking parts, don’t attempt to parse train ids or destinations.

  • Don’t exclude routes which contain walking parts by default, but feel free to give users the option to do so. For example the route Aarschot-Meiser has a small walking part, whereas avoiding that walking part will cause the user to arrive significantly earlier or later.

  • A walking leg has walking: "1" and vehicle ID BE.NMBS.WALK.

GET /v1/connections?from=Gent-Sint-Pieters&to=Mechelen&date=300917&time=1230&timesel=departure&format=json&lang=en&typeOfTransport=automatic&results=6
RequestsJsonXML
Headers
Accept: application/json
Responses200400404
Headers
Content-Type: application/json
Access-Control-Allow-Origin: "*"
Body
{
  "version": "1.4",
  "timestamp": "1489622781",
  "connection": [
    {
      "id": "0",
      "departure": {
        "delay": "0",
        "station": "Antwerp-Central",
        "stationinfo": {
          "id": "BE.NMBS.008821006",
          "@id": "http://irail.be/stations/NMBS/008821006",
          "locationX": "4.421101",
          "locationY": "51.2172",
          "standardname": "Antwerpen-Centraal",
          "name": "Antwerp-Central"
        },
        "time": "1497783600",
        "vehicle": "BE.NMBS.IC3033",
        "vehicleinfo": {
          "name": "BE.NMBS.IC3033",
          "shortname": "IC 3033",
          "number": "3033",
          "type": "IC",
          "locationX": "0",
          "locationY": "0",
          "@id": "http://irail.be/vehicle/IC3033"
        },
        "platform": "4",
        "platforminfo": {
          "name": "4",
          "normal": "1"
        },
        "left": "0",
        "canceled": "0",
        "direction": {
          "name": "Mechelen"
        },
        "stops": {
          "number": "1",
          "stop": [
            {
              "id": "0",
              "station": "Antwerp-central",
              "stationinfo": {
                "id": "BE.NMBS.008821006",
                "@id": "http://irail.be/stations/NMBS/008821006",
                "locationX": "4.421101",
                "locationY": "51.2172",
                "standardname": "Antwerpen-Centraal",
                "name": "Antwerp-Central"
              },
              "platform": "?",
              "platforminfo": {
                "name": "4",
                "normal": "1"
              },
              "departureDelay": "0",
              "departureCanceled": "0",
              "scheduledDepartureTime": "1489658760",
              "arrivalDelay": "0",
              "arrivalCanceled": "0",
              "left": "0",
              "arrived": "0",
              "isExtraStop": "0",
              "scheduledArrivalTime": "1489658760"
            }
          ]
        },
        "occupancy": {
          "@id": "http://api.irail.be/terms/unknown",
          "name": "unknown"
        },
        "walking": "0",
        "departureConnection": "http://irail.be/connections/8821006/20170316/IC1832"
      },
      "arrival": {
        "delay": "0",
        "station": "Antwerp-Central",
        "stationinfo": {
          "id": "BE.NMBS.008821006",
          "@id": "http://irail.be/stations/NMBS/008821006",
          "locationX": "4.421101",
          "locationY": "51.2172",
          "standardname": "Antwerpen-Centraal",
          "name": "Antwerp-Central"
        },
        "time": "1497786840",
        "vehicle": "BE.NMBS.IC3033",
        "vehicleinfo": {
          "name": "BE.NMBS.IC3033",
          "shortname": "IC 3033",
          "number": "3033",
          "type": "IC",
          "locationX": "0",
          "locationY": "0",
          "@id": "http://irail.be/vehicle/IC3033"
        },
        "platform": "4",
        "platforminfo": {
          "name": "4",
          "normal": "1"
        },
        "arrived": "0",
        "canceled": "0",
        "walking": "0",
        "direction": {
          "name": "Mechelen"
        },
        "departureConnection": "Hello, world!"
      },
      "duration": "3240",
      "remarks": {
        "number": "0",
        "remark": []
      },
      "alerts": {
        "number": "1",
        "alert": [
          {
            "id": "0",
            "header": "L 50: We are conducting work for you between Ghent and Aalst.",
            "lead": "We are conducting work for you between Ghent and Aalst",
            "description": "Hello, world!",
            "startTime": "1509441420",
            "endTime": "1510527540"
          }
        ]
      },
      "vias": {
        "number": "1",
        "via": [
          {
            "id": "0",
            "arrival": {
              "delay": "0",
              "station": "Antwerp-Central",
              "stationinfo": {
                "id": "BE.NMBS.008821006",
                "@id": "http://irail.be/stations/NMBS/008821006",
                "locationX": "4.421101",
                "locationY": "51.2172",
                "standardname": "Antwerpen-Centraal",
                "name": "Antwerp-Central"
              },
              "time": "1497786840",
              "vehicle": "BE.NMBS.IC3033",
              "vehicleinfo": {
                "name": "BE.NMBS.IC3033",
                "shortname": "IC 3033",
                "number": "3033",
                "type": "IC",
                "locationX": "0",
                "locationY": "0",
                "@id": "http://irail.be/vehicle/IC3033"
              },
              "platform": "4",
              "platforminfo": {
                "name": "4",
                "normal": "1"
              },
              "arrived": "0",
              "canceled": "0",
              "walking": "0",
              "direction": {
                "name": "Mechelen"
              },
              "departureConnection": "Hello, world!"
            },
            "departure": {
              "delay": "0",
              "station": "Antwerp-Central",
              "stationinfo": {
                "id": "BE.NMBS.008821006",
                "@id": "http://irail.be/stations/NMBS/008821006",
                "locationX": "4.421101",
                "locationY": "51.2172",
                "standardname": "Antwerpen-Centraal",
                "name": "Antwerp-Central"
              },
              "time": "1497783600",
              "vehicle": "BE.NMBS.IC3033",
              "vehicleinfo": {
                "name": "BE.NMBS.IC3033",
                "shortname": "IC 3033",
                "number": "3033",
                "type": "IC",
                "locationX": "0",
                "locationY": "0",
                "@id": "http://irail.be/vehicle/IC3033"
              },
              "platform": "4",
              "platforminfo": {
                "name": "4",
                "normal": "1"
              },
              "left": "0",
              "canceled": "0",
              "direction": {
                "name": "Mechelen"
              },
              "stops": {
                "number": "1",
                "stop": [
                  {
                    "id": "0",
                    "station": "Antwerp-central",
                    "stationinfo": {
                      "id": "BE.NMBS.008821006",
                      "@id": "http://irail.be/stations/NMBS/008821006",
                      "locationX": "4.421101",
                      "locationY": "51.2172",
                      "standardname": "Antwerpen-Centraal",
                      "name": "Antwerp-Central"
                    },
                    "platform": "?",
                    "platforminfo": {
                      "name": "4",
                      "normal": "1"
                    },
                    "departureDelay": "0",
                    "departureCanceled": "0",
                    "scheduledDepartureTime": "1489658760",
                    "arrivalDelay": "0",
                    "arrivalCanceled": "0",
                    "left": "0",
                    "arrived": "0",
                    "isExtraStop": "0",
                    "scheduledArrivalTime": "1489658760"
                  }
                ]
              },
              "occupancy": {
                "@id": "http://api.irail.be/terms/unknown",
                "name": "unknown"
              },
              "walking": "0",
              "departureConnection": "http://irail.be/connections/8821006/20170316/IC1832"
            },
            "timebetween": "360",
            "station": "Antwerp-Central",
            "stationinfo": {
              "id": "BE.NMBS.008821006",
              "@id": "http://irail.be/stations/NMBS/008821006",
              "locationX": "4.421101",
              "locationY": "51.2172",
              "standardname": "Antwerpen-Centraal",
              "name": "Antwerp-Central"
            },
            "vehicle": "BE.NMBS.IC3033",
            "vehicleinfo": {
              "name": "BE.NMBS.IC3033",
              "shortname": "IC 3033",
              "number": "3033",
              "type": "IC",
              "locationX": "0",
              "locationY": "0",
              "@id": "http://irail.be/vehicle/IC3033"
            }
          }
        ]
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "version": {
      "type": "string"
    },
    "timestamp": {
      "type": "string"
    },
    "connection": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "departure": {
            "type": "object",
            "properties": {
              "delay": {
                "type": "string",
                "description": "The departure delay, in seconds."
              },
              "station": {
                "type": "string"
              },
              "stationinfo": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
                  },
                  "@id": {
                    "type": "string"
                  },
                  "locationX": {
                    "type": "string",
                    "description": "The longitude of the station"
                  },
                  "locationY": {
                    "type": "string",
                    "description": "The latitude of the station"
                  },
                  "standardname": {
                    "type": "string",
                    "description": "The consistent name of this station"
                  },
                  "name": {
                    "type": "string",
                    "description": "The default name of this station"
                  }
                },
                "required": [
                  "id",
                  "@id",
                  "locationX",
                  "locationY",
                  "standardname",
                  "name"
                ]
              },
              "time": {
                "type": "string",
                "description": "The unix timestamp, expressed as seconds since January 1st 1970"
              },
              "vehicle": {
                "type": "string"
              },
              "vehicleinfo": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "shortname": {
                    "type": "string"
                  },
                  "number": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "locationX": {
                    "type": "string"
                  },
                  "locationY": {
                    "type": "string"
                  },
                  "@id": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "shortname",
                  "number",
                  "type",
                  "locationX",
                  "locationY",
                  "@id"
                ]
              },
              "platform": {
                "type": "string",
                "description": "The platform from which this train will depart"
              },
              "platforminfo": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The platform name. **Warning** Do not treat this as a number. This value can also be '1B' for example, or '?' when unknown."
                  },
                  "normal": {
                    "type": "string",
                    "description": "Whether or not this is the normal platform. If 0, a platform change has happened in real time."
                  }
                },
                "required": [
                  "name",
                  "normal"
                ]
              },
              "left": {
                "type": "string",
                "description": "Whether or not this train has left"
              },
              "canceled": {
                "type": "string",
                "description": "Whether or not this train has been cancelled"
              },
              "direction": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              },
              "stops": {
                "type": "object",
                "properties": {
                  "number": {
                    "type": "string",
                    "description": "The number of stops in this list"
                  },
                  "stop": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The index of this stop in an array of stops"
                        },
                        "station": {
                          "type": "string",
                          "description": "The name of this station as returned by the nmbs"
                        },
                        "stationinfo": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
                            },
                            "@id": {
                              "type": "string"
                            },
                            "locationX": {
                              "type": "string",
                              "description": "The longitude of the station"
                            },
                            "locationY": {
                              "type": "string",
                              "description": "The latitude of the station"
                            },
                            "standardname": {
                              "type": "string",
                              "description": "The consistent name of this station"
                            },
                            "name": {
                              "type": "string",
                              "description": "The default name of this station"
                            }
                          },
                          "required": [
                            "id",
                            "@id",
                            "locationX",
                            "locationY",
                            "standardname",
                            "name"
                          ]
                        },
                        "platform": {
                          "type": "string"
                        },
                        "platforminfo": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "The platform name. **Warning** Do not treat this as a number. This value can also be '1B' for example, or '?' when unknown."
                            },
                            "normal": {
                              "type": "string",
                              "description": "Whether or not this is the normal platform. If 0, a platform change has happened in real time."
                            }
                          },
                          "required": [
                            "name",
                            "normal"
                          ]
                        },
                        "departureDelay": {
                          "type": "string",
                          "description": "The departure delay, in seconds"
                        },
                        "departureCanceled": {
                          "type": "string",
                          "description": "Whether or not this departure has been cancelled"
                        },
                        "scheduledDepartureTime": {
                          "type": "string",
                          "description": "The unix timestamp, expressed as seconds since January 1st 1970"
                        },
                        "arrivalDelay": {
                          "type": "string",
                          "description": "The arrival delay, in seconds."
                        },
                        "arrivalCanceled": {
                          "type": "string",
                          "description": "Whether or not the arrival on this stop is canceled"
                        },
                        "left": {
                          "type": "string"
                        },
                        "arrived": {
                          "type": "string"
                        },
                        "isExtraStop": {
                          "type": "string",
                          "description": "Whether or not this is an extra stop which isn't in the original route for train"
                        },
                        "scheduledArrivalTime": {
                          "type": "string",
                          "description": "The unix timestamp, expressed as seconds since January 1st 1970"
                        }
                      },
                      "required": [
                        "id",
                        "station",
                        "platform",
                        "platforminfo",
                        "departureDelay",
                        "departureCanceled",
                        "scheduledDepartureTime",
                        "arrivalDelay",
                        "arrivalCanceled",
                        "left",
                        "arrived",
                        "isExtraStop",
                        "scheduledArrivalTime"
                      ]
                    }
                  }
                },
                "required": [
                  "number",
                  "stop"
                ],
                "description": "The intermediate stops between this departure and the next arrival"
              },
              "occupancy": {
                "type": "object",
                "properties": {
                  "@id": {
                    "type": "string",
                    "description": "The linked-data id of this term"
                  },
                  "name": {
                    "type": "string",
                    "description": "Occupancy level, one of `unknown`, `low`, `medium`, or `high`."
                  }
                },
                "required": [
                  "@id",
                  "name"
                ]
              },
              "walking": {
                "type": "string",
                "description": "Whether or not this is a walking part"
              },
              "departureConnection": {
                "type": "string",
                "description": "A unique URI for this departure"
              }
            },
            "required": [
              "delay",
              "station",
              "time",
              "vehicle",
              "vehicleinfo",
              "platform",
              "platforminfo",
              "left",
              "canceled",
              "direction",
              "stops",
              "occupancy",
              "walking"
            ]
          },
          "arrival": {
            "type": "object",
            "properties": {
              "delay": {
                "type": "string",
                "description": "The arrival delay, in seconds"
              },
              "station": {
                "type": "string"
              },
              "stationinfo": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
                  },
                  "@id": {
                    "type": "string"
                  },
                  "locationX": {
                    "type": "string",
                    "description": "The longitude of the station"
                  },
                  "locationY": {
                    "type": "string",
                    "description": "The latitude of the station"
                  },
                  "standardname": {
                    "type": "string",
                    "description": "The consistent name of this station"
                  },
                  "name": {
                    "type": "string",
                    "description": "The default name of this station"
                  }
                },
                "required": [
                  "id",
                  "@id",
                  "locationX",
                  "locationY",
                  "standardname",
                  "name"
                ]
              },
              "time": {
                "type": "string",
                "description": "The unix timestamp, expressed as seconds since January 1st 1970"
              },
              "vehicle": {
                "type": "string"
              },
              "vehicleinfo": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "shortname": {
                    "type": "string"
                  },
                  "number": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "locationX": {
                    "type": "string"
                  },
                  "locationY": {
                    "type": "string"
                  },
                  "@id": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "shortname",
                  "number",
                  "type",
                  "locationX",
                  "locationY",
                  "@id"
                ]
              },
              "platform": {
                "type": "string",
                "description": "The platform from which this train will depart"
              },
              "platforminfo": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The platform name. **Warning** Do not treat this as a number. This value can also be '1B' for example, or '?' when unknown."
                  },
                  "normal": {
                    "type": "string",
                    "description": "Whether or not this is the normal platform. If 0, a platform change has happened in real time."
                  }
                },
                "required": [
                  "name",
                  "normal"
                ]
              },
              "arrived": {
                "type": "string",
                "description": "Whether or not this train has arrived"
              },
              "canceled": {
                "type": "string",
                "description": "Whether or not this train has been cancelled"
              },
              "walking": {
                "type": "string",
                "description": "Whether or not this is a walking part"
              },
              "direction": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              },
              "departureConnection": {
                "type": "string",
                "description": "A unique URI for the associated departure."
              }
            },
            "required": [
              "delay",
              "station",
              "time",
              "vehicle",
              "vehicleinfo",
              "platform",
              "platforminfo",
              "arrived",
              "canceled",
              "walking",
              "direction"
            ]
          },
          "duration": {
            "type": "string",
            "description": "The total duration of this connection, in seconds"
          },
          "remarks": {
            "type": "object",
            "properties": {
              "number": {
                "type": "string"
              },
              "remark": {}
            },
            "required": [
              "number",
              "remark"
            ],
            "description": "Currently empty."
          },
          "alerts": {
            "type": "object",
            "properties": {
              "number": {
                "type": "string",
                "description": "The number of alerts in this list"
              },
              "alert": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "header": {
                      "type": "string"
                    },
                    "lead": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string",
                      "description": "Full alert text."
                    },
                    "startTime": {
                      "type": "string",
                      "description": "The start time as unix timestamp, expressed as seconds since January 1st 1970"
                    },
                    "endTime": {
                      "type": "string",
                      "description": "The end time as unix timestamp, expressed as seconds since January 1st 1970"
                    }
                  },
                  "required": [
                    "id",
                    "header",
                    "lead",
                    "startTime",
                    "endTime"
                  ]
                }
              }
            },
            "required": [
              "number",
              "alert"
            ]
          },
          "vias": {
            "type": "object",
            "properties": {
              "number": {
                "type": "string",
                "description": "The number of vias (transfers) in this connection"
              },
              "via": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "arrival": {
                      "type": "object",
                      "properties": {
                        "delay": {
                          "type": "string",
                          "description": "The arrival delay, in seconds"
                        },
                        "station": {
                          "type": "string"
                        },
                        "stationinfo": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
                            },
                            "@id": {
                              "type": "string"
                            },
                            "locationX": {
                              "type": "string",
                              "description": "The longitude of the station"
                            },
                            "locationY": {
                              "type": "string",
                              "description": "The latitude of the station"
                            },
                            "standardname": {
                              "type": "string",
                              "description": "The consistent name of this station"
                            },
                            "name": {
                              "type": "string",
                              "description": "The default name of this station"
                            }
                          },
                          "required": [
                            "id",
                            "@id",
                            "locationX",
                            "locationY",
                            "standardname",
                            "name"
                          ]
                        },
                        "time": {
                          "type": "string",
                          "description": "The unix timestamp, expressed as seconds since January 1st 1970"
                        },
                        "vehicle": {
                          "type": "string"
                        },
                        "vehicleinfo": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "shortname": {
                              "type": "string"
                            },
                            "number": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "locationX": {
                              "type": "string"
                            },
                            "locationY": {
                              "type": "string"
                            },
                            "@id": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "shortname",
                            "number",
                            "type",
                            "locationX",
                            "locationY",
                            "@id"
                          ]
                        },
                        "platform": {
                          "type": "string",
                          "description": "The platform from which this train will depart"
                        },
                        "platforminfo": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "The platform name. **Warning** Do not treat this as a number. This value can also be '1B' for example, or '?' when unknown."
                            },
                            "normal": {
                              "type": "string",
                              "description": "Whether or not this is the normal platform. If 0, a platform change has happened in real time."
                            }
                          },
                          "required": [
                            "name",
                            "normal"
                          ]
                        },
                        "arrived": {
                          "type": "string",
                          "description": "Whether or not this train has arrived"
                        },
                        "canceled": {
                          "type": "string",
                          "description": "Whether or not this train has been cancelled"
                        },
                        "walking": {
                          "type": "string",
                          "description": "Whether or not this is a walking part"
                        },
                        "direction": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "name"
                          ]
                        },
                        "departureConnection": {
                          "type": "string",
                          "description": "A unique URI for the associated departure."
                        }
                      },
                      "required": [
                        "delay",
                        "station",
                        "time",
                        "vehicle",
                        "vehicleinfo",
                        "platform",
                        "platforminfo",
                        "arrived",
                        "canceled",
                        "walking",
                        "direction"
                      ]
                    },
                    "departure": {
                      "type": "object",
                      "properties": {
                        "delay": {
                          "type": "string",
                          "description": "The departure delay, in seconds."
                        },
                        "station": {
                          "type": "string"
                        },
                        "stationinfo": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
                            },
                            "@id": {
                              "type": "string"
                            },
                            "locationX": {
                              "type": "string",
                              "description": "The longitude of the station"
                            },
                            "locationY": {
                              "type": "string",
                              "description": "The latitude of the station"
                            },
                            "standardname": {
                              "type": "string",
                              "description": "The consistent name of this station"
                            },
                            "name": {
                              "type": "string",
                              "description": "The default name of this station"
                            }
                          },
                          "required": [
                            "id",
                            "@id",
                            "locationX",
                            "locationY",
                            "standardname",
                            "name"
                          ]
                        },
                        "time": {
                          "type": "string",
                          "description": "The unix timestamp, expressed as seconds since January 1st 1970"
                        },
                        "vehicle": {
                          "type": "string"
                        },
                        "vehicleinfo": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "shortname": {
                              "type": "string"
                            },
                            "number": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "locationX": {
                              "type": "string"
                            },
                            "locationY": {
                              "type": "string"
                            },
                            "@id": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "shortname",
                            "number",
                            "type",
                            "locationX",
                            "locationY",
                            "@id"
                          ]
                        },
                        "platform": {
                          "type": "string",
                          "description": "The platform from which this train will depart"
                        },
                        "platforminfo": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string",
                              "description": "The platform name. **Warning** Do not treat this as a number. This value can also be '1B' for example, or '?' when unknown."
                            },
                            "normal": {
                              "type": "string",
                              "description": "Whether or not this is the normal platform. If 0, a platform change has happened in real time."
                            }
                          },
                          "required": [
                            "name",
                            "normal"
                          ]
                        },
                        "left": {
                          "type": "string",
                          "description": "Whether or not this train has left"
                        },
                        "canceled": {
                          "type": "string",
                          "description": "Whether or not this train has been cancelled"
                        },
                        "direction": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "name"
                          ]
                        },
                        "stops": {
                          "type": "object",
                          "properties": {
                            "number": {
                              "type": "string",
                              "description": "The number of stops in this list"
                            },
                            "stop": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "description": "The index of this stop in an array of stops"
                                  },
                                  "station": {
                                    "type": "string",
                                    "description": "The name of this station as returned by the nmbs"
                                  },
                                  "stationinfo": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
                                      },
                                      "@id": {
                                        "type": "string"
                                      },
                                      "locationX": {
                                        "type": "string",
                                        "description": "The longitude of the station"
                                      },
                                      "locationY": {
                                        "type": "string",
                                        "description": "The latitude of the station"
                                      },
                                      "standardname": {
                                        "type": "string",
                                        "description": "The consistent name of this station"
                                      },
                                      "name": {
                                        "type": "string",
                                        "description": "The default name of this station"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "@id",
                                      "locationX",
                                      "locationY",
                                      "standardname",
                                      "name"
                                    ]
                                  },
                                  "platform": {
                                    "type": "string"
                                  },
                                  "platforminfo": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "description": "The platform name. **Warning** Do not treat this as a number. This value can also be '1B' for example, or '?' when unknown."
                                      },
                                      "normal": {
                                        "type": "string",
                                        "description": "Whether or not this is the normal platform. If 0, a platform change has happened in real time."
                                      }
                                    },
                                    "required": [
                                      "name",
                                      "normal"
                                    ]
                                  },
                                  "departureDelay": {
                                    "type": "string",
                                    "description": "The departure delay, in seconds"
                                  },
                                  "departureCanceled": {
                                    "type": "string",
                                    "description": "Whether or not this departure has been cancelled"
                                  },
                                  "scheduledDepartureTime": {
                                    "type": "string",
                                    "description": "The unix timestamp, expressed as seconds since January 1st 1970"
                                  },
                                  "arrivalDelay": {
                                    "type": "string",
                                    "description": "The arrival delay, in seconds."
                                  },
                                  "arrivalCanceled": {
                                    "type": "string",
                                    "description": "Whether or not the arrival on this stop is canceled"
                                  },
                                  "left": {
                                    "type": "string"
                                  },
                                  "arrived": {
                                    "type": "string"
                                  },
                                  "isExtraStop": {
                                    "type": "string",
                                    "description": "Whether or not this is an extra stop which isn't in the original route for train"
                                  },
                                  "scheduledArrivalTime": {
                                    "type": "string",
                                    "description": "The unix timestamp, expressed as seconds since January 1st 1970"
                                  }
                                },
                                "required": [
                                  "id",
                                  "station",
                                  "platform",
                                  "platforminfo",
                                  "departureDelay",
                                  "departureCanceled",
                                  "scheduledDepartureTime",
                                  "arrivalDelay",
                                  "arrivalCanceled",
                                  "left",
                                  "arrived",
                                  "isExtraStop",
                                  "scheduledArrivalTime"
                                ]
                              }
                            }
                          },
                          "required": [
                            "number",
                            "stop"
                          ],
                          "description": "The intermediate stops between this departure and the next arrival"
                        },
                        "occupancy": {
                          "type": "object",
                          "properties": {
                            "@id": {
                              "type": "string",
                              "description": "The linked-data id of this term"
                            },
                            "name": {
                              "type": "string",
                              "description": "Occupancy level, one of `unknown`, `low`, `medium`, or `high`."
                            }
                          },
                          "required": [
                            "@id",
                            "name"
                          ]
                        },
                        "walking": {
                          "type": "string",
                          "description": "Whether or not this is a walking part"
                        },
                        "departureConnection": {
                          "type": "string",
                          "description": "A unique URI for this departure"
                        }
                      },
                      "required": [
                        "delay",
                        "station",
                        "time",
                        "vehicle",
                        "vehicleinfo",
                        "platform",
                        "platforminfo",
                        "left",
                        "canceled",
                        "direction",
                        "stops",
                        "occupancy",
                        "walking"
                      ]
                    },
                    "timebetween": {
                      "type": "string",
                      "description": "The time between arrival and departure at the transfer station, in seconds including delays."
                    },
                    "station": {
                      "type": "string"
                    },
                    "stationinfo": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
                        },
                        "@id": {
                          "type": "string"
                        },
                        "locationX": {
                          "type": "string",
                          "description": "The longitude of the station"
                        },
                        "locationY": {
                          "type": "string",
                          "description": "The latitude of the station"
                        },
                        "standardname": {
                          "type": "string",
                          "description": "The consistent name of this station"
                        },
                        "name": {
                          "type": "string",
                          "description": "The default name of this station"
                        }
                      },
                      "required": [
                        "id",
                        "@id",
                        "locationX",
                        "locationY",
                        "standardname",
                        "name"
                      ]
                    },
                    "vehicle": {
                      "type": "string"
                    },
                    "vehicleinfo": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "shortname": {
                          "type": "string"
                        },
                        "number": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "locationX": {
                          "type": "string"
                        },
                        "locationY": {
                          "type": "string"
                        },
                        "@id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "name",
                        "shortname",
                        "number",
                        "type",
                        "locationX",
                        "locationY",
                        "@id"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "arrival",
                    "departure",
                    "timebetween",
                    "station",
                    "vehicle",
                    "vehicleinfo"
                  ]
                }
              }
            },
            "required": [
              "number",
              "via"
            ],
            "description": "Present when the journey has transfers."
          }
        },
        "required": [
          "id",
          "departure",
          "arrival",
          "duration",
          "remarks",
          "alerts"
        ]
      }
    }
  },
  "required": [
    "version",
    "timestamp",
    "connection"
  ]
}
Headers
Content-Type: application/json
Body
{
  "exception": "RequestedStopNotFoundException",
  "message": "Invalid request, value 'Retie' for parameter 'from' is invalid: Requested stop not found: Retie",
  "at": "JourneyPlanningV1Controller.java:209",
  "stackTrace": []
}
Headers
Content-Type: application/json
Body
{
  "exception": "JourneyPlanNotFoundException",
  "message": "Journey planner did not return any result",
  "at": "NmbsRivRawDataRepository.java:398",
  "stackTrace": []
}
Headers
Accept: application/xml
Responses200
Headers
Content-Type: application/xml
Access-Control-Allow-Origin: "*"
Body
<connections version="1.4" timestamp="1581855654">
    <connection id="0">
        <departure delay="0" canceled="0" left="0" walking="0">
            <station locationX="2.925809" locationY="51.228212" id="BE.NMBS.008891702"
                     URI="http://irail.be/stations/NMBS/008891702" standardname="Oostende">Oostende
            </station>
            <time formatted="2020-02-16T14:09:00">1581858540</time>
            <vehicle shortname="IC 1814" number="1814" type="IC" locationX="0" locationY="0" URI="http://irail.be/vehicle/IC1814">BE.NMBS.IC1814</vehicle>
            <platform normal="0">6</platform>
            <stops number="1">
                <stop id="0" arrived="0" left="0" isExtraStop="0">
                    <station locationX="3.216726" locationY="51.197226" id="BE.NMBS.008891009"
                             URI="http://irail.be/stations/NMBS/008891009" standardname="Brugge">Brugge
                    </station>
                    <scheduledArrivalTime formatted="2020-02-16T14:23:00">1581859380</scheduledArrivalTime>
                    <arrivalCanceled>0</arrivalCanceled>
                    <arrivalDelay>0</arrivalDelay>
                    <scheduledDepartureTime formatted="2020-02-16T14:25:00">1581859500</scheduledDepartureTime>
                    <departureDelay>0</departureDelay>
                    <departureCanceled>0</departureCanceled>
                    <platform normal="1">?</platform>
                </stop>
            </stops>
            <departureConnection>http://irail.be/connections/8891702/20200216/IC1814</departureConnection>
            <direction>Antwerpen-Centraal</direction>
            <occupancy URI="http://api.irail.be/terms/unknown">unknown</occupancy>
        </departure>
        <arrival delay="0" canceled="0" arrived="0" walking="0">
            <station locationX="4.937415" locationY="51.322032" id="BE.NMBS.008821907"
                     URI="http://irail.be/stations/NMBS/008821907" standardname="Turnhout">Turnhout
            </station>
            <time formatted="2020-02-16T17:47:00">1581871620</time>
            <vehicle shortname="IC 4237" number="4237" type="IC" locationX="0" locationY="0" URI="http://irail.be/vehicle/IC4237">BE.NMBS.IC4237</vehicle>
            <platform normal="1">2</platform>
            <direction>Turnhout</direction>
            <departureConnection>http://irail.be/connections/8821907/20200216/IC4237</departureConnection>
        </arrival>
        <vias number="1">
            <via id="0">
                <arrival delay="0" canceled="0" arrived="0" walking="0">
                    <station locationX="4.432221" locationY="51.19923" id="BE.NMBS.008821121" URI="http://irail.be/stations/NMBS/008821121" standardname="Antwerpen-Berchem">Antwerpen-Berchem</station>
                    <time formatted="2020-02-16T15:52:00">1581864720</time>
                    <platform normal="1">10</platform>
                    <direction>Antwerpen-Centraal</direction>
                    <vehicle shortname="IC 1814" number="1814" type="IC" locationX="0" locationY="0" URI="http://irail.be/vehicle/IC1814">BE.NMBS.IC1814</vehicle>
                    <departureConnection>http://irail.be/connections/8821121/20200216/IC1814</departureConnection>
                </arrival>
                <departure delay="0" canceled="0" left="0" walking="0">
                    <station locationX="4.432221" locationY="51.19923" id="BE.NMBS.008821121" URI="http://irail.be/stations/NMBS/008821121" standardname="Antwerpen-Berchem">Antwerpen-Berchem</station>
                    <time formatted="2020-02-16T16:39:00">1581867540</time>
                    <platform normal="1">5</platform>
                    <direction>Turnhout</direction>
                    <vehicle shortname="IC 4237" number="4237" type="IC" locationX="0" locationY="0" URI="http://irail.be/vehicle/IC4237">BE.NMBS.IC4237</vehicle>
                    <stops number="1">
                        <stop id="0" arrived="0" left="0" isExtraStop="0">
                            <station locationX="4.448437" locationY="51.18296" id="BE.NMBS.008821147"
                                     URI="http://irail.be/stations/NMBS/008821147" standardname="Mortsel">Mortsel
                            </station>
                            <scheduledArrivalTime formatted="2020-02-16T16:42:00">1581867720</scheduledArrivalTime>
                            <arrivalCanceled>0</arrivalCanceled>
                            <arrivalDelay>0</arrivalDelay>
                            <scheduledDepartureTime formatted="2020-02-16T16:43:00">1581867780</scheduledDepartureTime>
                            <departureDelay>0</departureDelay>
                            <departureCanceled>0</departureCanceled>
                            <platform normal="1">?</platform>
                        </stop>
                    </stops>
                    <departureConnection>http://irail.be/connections/8821121/20200216/IC4237</departureConnection>
                    <occupancy URI="http://api.irail.be/terms/unknown">unknown</occupancy>
                </departure>
                <timebetween>2820</timebetween>
                <station locationX="4.432221" locationY="51.19923" id="BE.NMBS.008821121"
                         URI="http://irail.be/stations/NMBS/008821121" standardname="Antwerpen-Berchem">
                    Antwerpen-Berchem
                </station>
                <vehicle shortname="IC 4237" number="4237" type="IC" locationX="0" locationY="0" URI="http://irail.be/vehicle/IC4237">BE.NMBS.IC4237</vehicle>
            </via>
        </vias>
        <duration>13080</duration>
        <remarks number="0"></remarks>
        <alerts number="0"></alerts>
    </connection>
</connections>

Retrieve connections
GET/v1/connections{?from,to,date,time,timesel,format,lang,typeOfTransport,results}

Example searches:

  • /v1/connections?from=Gent-Dampoort&to=Lembeek&format=json

  • /v1/connections?from=De%20Panne&to=Gouvy&date=231126&time=0830&format=json

  • /v1/connections?from=Brussel-Kapellekerk&to=Aarschot&date=231126&time=0830&format=json

The dates in the last two examples are from a weekday timetable snapshot. Use a date in the current timetable when repeating those requests. An unknown station or invalid parameter returns HTTP 400. A search that finds no journey returns HTTP 404.

URI Parameters
HideShow
from
string (required) Example: Gent-Sint-Pieters

The name or id of the station of departure.

to
string (required) Example: Mechelen

The name or id of the destination.

timesel
string (optional) Default: departure Example: departure

Whether the requested time is for departure or arrival. The alias timeSel is also accepted.

Choices: departure arrival

typeOfTransport
string (optional) Default: automatic Example: automatic

The types of transport to include in the search. Automatic will only allow national (normal) trains for travelling between two stations in Belgium, but will still allow international high speed trains for travel outside Belgium.

Choices: automatic trains no_international_trains all

results
number (optional) Example: 6

Maximum number of connections to return. Supply a positive whole number. Omitting it returns the full result set.

time
string (optional) Default: current time in Belgium Example: 1230

The time to query.

The time is formatted as hhmm.

date
string (optional) Default: current date in Belgium Example: 300917

The date to query.

The date is formatted as ddmmyy.

format
string (optional) Default: xml Example: json

The response format

Choices: xml json

lang
string (optional) Default: en Example: en

The language of any text or names in the response.

Choices: nl fr en de


Vehicle

Retrieve information about a vehicle.

Vehicle API

As of November 2017, the following data has been added:

  • isExtraStop indicates that this stop was not part of the original planned route, but was added last-minute by trafic control.

Be aware

Trying to query data way in the past, or way in the future, might result in error 500 responses. If you’re not sure what causes an error 500 response, be sure to check if your query works for the current day, or if the NMBS website has the data for the date you want to look up.

GET /v1/vehicle?id=BE.NMBS.IC1832&date=300917&format=json&lang=en
RequestsJsonXML
Headers
Accept: application/json
Responses200400404
Headers
Content-Type: application/json
Access-Control-Allow-Origin: "*"
Body
{
  "version": "1.4",
  "timestamp": "1489621902",
  "vehicle": "BE.NMBS.IC3033",
  "vehicleinfo": {
    "name": "BE.NMBS.IC3033",
    "locationX": "4.421101",
    "locationY": "51.2172",
    "shortname": "IC 3033",
    "number": "3033",
    "type": "IC",
    "@id": "http://irail.be/vehicle/IC3033"
  },
  "stops": {
    "number": "10",
    "stop": [
      {
        "id": "0",
        "station": "Antwerp-central",
        "stationinfo": {
          "id": "BE.NMBS.008821006",
          "@id": "http://irail.be/stations/NMBS/008821006",
          "locationX": "4.421101",
          "locationY": "51.2172",
          "standardname": "Antwerpen-Centraal",
          "name": "Antwerp-Central"
        },
        "time": "1489658760",
        "delay": "0",
        "platform": "4",
        "platforminfo": {
          "name": "4",
          "normal": "1"
        },
        "canceled": "0",
        "departureDelay": "0",
        "departureCanceled": "0",
        "scheduledDepartureTime": "1489658760",
        "arrivalDelay": "0",
        "arrivalCanceled": "0",
        "left": "0",
        "arrived": "0",
        "isExtraStop": "0",
        "scheduledArrivalTime": "1489658760",
        "departureConnection": "http://irail.be/connections/8821006/20170316/IC3033",
        "occupancy": {
          "@id": "http://api.irail.be/terms/unknown",
          "name": "unknown"
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "version": {
      "type": "string"
    },
    "timestamp": {
      "type": "string"
    },
    "vehicle": {
      "type": "string"
    },
    "vehicleinfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "locationX": {
          "type": "string"
        },
        "locationY": {
          "type": "string"
        },
        "shortname": {
          "type": "string"
        },
        "number": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "@id": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "locationX",
        "locationY",
        "shortname",
        "number",
        "type",
        "@id"
      ]
    },
    "stops": {
      "type": "object",
      "properties": {
        "number": {
          "type": "string"
        },
        "stop": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The index of this stop in an array of stops"
              },
              "station": {
                "type": "string",
                "description": "The name of this station as returned by the nmbs"
              },
              "stationinfo": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The (iRail) id of the station. The NMBS id can be deducted by removing the leading 'BE.NMBS.00'"
                  },
                  "@id": {
                    "type": "string"
                  },
                  "locationX": {
                    "type": "string",
                    "description": "The longitude of the station"
                  },
                  "locationY": {
                    "type": "string",
                    "description": "The latitude of the station"
                  },
                  "standardname": {
                    "type": "string",
                    "description": "The consistent name of this station"
                  },
                  "name": {
                    "type": "string",
                    "description": "The default name of this station"
                  }
                },
                "required": [
                  "id",
                  "@id",
                  "locationX",
                  "locationY",
                  "standardname",
                  "name"
                ]
              },
              "time": {
                "type": "string",
                "description": "Legacy alias of `scheduledDepartureTime`."
              },
              "delay": {
                "type": "string",
                "description": "(Deprecated) The departure delay, in seconds. Use departureDelay instead."
              },
              "platform": {
                "type": "string",
                "description": "The platform from which this train will depart"
              },
              "platforminfo": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The platform name. **Warning** Do not treat this as a number. This value can also be '1B' for example, or '?' when unknown."
                  },
                  "normal": {
                    "type": "string",
                    "description": "Whether or not this is the normal platform. If 0, a platform change has happened in real time."
                  }
                },
                "required": [
                  "name",
                  "normal"
                ]
              },
              "canceled": {
                "type": "string",
                "description": "Whether or not this train has been cancelled"
              },
              "departureDelay": {
                "type": "string",
                "description": "The departure delay, in seconds"
              },
              "departureCanceled": {
                "type": "string",
                "description": "Whether or not this departure has been cancelled"
              },
              "scheduledDepartureTime": {
                "type": "string",
                "description": "The unix timestamp, expressed as seconds since January 1st 1970"
              },
              "arrivalDelay": {
                "type": "string",
                "description": "The arrival delay, in seconds."
              },
              "arrivalCanceled": {
                "type": "string",
                "description": "Whether or not the arrival on this stop is canceled"
              },
              "left": {
                "type": "string"
              },
              "arrived": {
                "type": "string"
              },
              "isExtraStop": {
                "type": "string",
                "description": "Whether or not this is an extra stop which isn't in the original route for train"
              },
              "scheduledArrivalTime": {
                "type": "string",
                "description": "The unix timestamp, expressed as seconds since January 1st 1970"
              },
              "departureConnection": {
                "type": "string",
                "description": "The identifier for this specific departure. Always copy this identifier, never try to compose it yourself, as it might change without warning."
              },
              "occupancy": {
                "type": "object",
                "properties": {
                  "@id": {
                    "type": "string",
                    "description": "The linked-data id of this term"
                  },
                  "name": {
                    "type": "string",
                    "description": "Occupancy level, one of `unknown`, `low`, `medium`, or `high`."
                  }
                },
                "required": [
                  "@id",
                  "name"
                ],
                "description": "The occupancy on this train. `unknown` indicates unavailable data."
              }
            },
            "required": [
              "id",
              "station",
              "time",
              "delay",
              "platform",
              "platforminfo",
              "canceled",
              "departureDelay",
              "departureCanceled",
              "scheduledDepartureTime",
              "arrivalDelay",
              "arrivalCanceled",
              "left",
              "arrived",
              "isExtraStop",
              "scheduledArrivalTime"
            ]
          }
        }
      },
      "required": [
        "number",
        "stop"
      ]
    }
  },
  "required": [
    "vehicle"
  ]
}
Headers
Content-Type: application/json
Body
Missing required parameter: id
Headers
Content-Type: application/json
Body
{
  "exception": "JourneyNotFoundException",
  "message": "Could not find journey with id 'IC999999' at 2026-11-21T00:00. JourneyDetailRef not found",
  "at": "NmbsRivRawDataRepository.java:139",
  "stackTrace": []
}
Headers
Accept: application/xml
Responses200
Headers
Content-Type: application/xml
Access-Control-Allow-Origin: "*"
Body
<vehicleinformation version="1.4" timestamp="1505995100">
    <vehicle locationX="3.216726" locationY="51.197226" shortname="IC 1832" number="1832" type="IC" URI="http://irail.be/vehicle/IC1832">BE.NMBS.IC1832</vehicle>
    <stops number="1">
        <stop id="0" delay="240" canceled="0" left="1" arrived="1" isExtraStop="0">
            <station id="BE.NMBS.008821006" locationX="4.421101" locationY="51.2172" URI="http://irail.be/stations/NMBS/008821006" standardname="Antwerpen-Centraal">Antwerp-Central</station>
            <time formatted="2017-09-21T11:06:00">1505984760</time>
            <platform normal="1">1</platform>
            <departureDelay>240</departureDelay>
            <departureCanceled>0</departureCanceled>
            <scheduledDepartureTime formatted="2017-09-21T11:06:00">1505984760</scheduledDepartureTime>
            <scheduledArrivalTime formatted="2017-09-21T11:06:00">1505984760</scheduledArrivalTime>
            <arrivalDelay>0</arrivalDelay>
            <arrivalCanceled>0</arrivalCanceled>
            <departureConnection>http://irail.be/connections/8821006/20170921/IC1832</departureConnection>
            <occupancy URI="http://api.irail.be/terms/unknown">unknown</occupancy>
        </stop>
    </stops>    
</vehicleinformation>

Retrieve a vehicle
GET/v1/vehicle{?id,date,format,lang}

Retrieve information about a vehicle (train), including stops, occupancy, last known stop location and delays.

URI Parameters
HideShow
id
string (required) Example: BE.NMBS.IC1832
date
string (optional) Default: current date in Belgium Example: 300917

The date to query.

The date is formatted as ddmmyy.

format
string (optional) Default: xml Example: json

The response format

Choices: xml json

lang
string (optional) Default: en Example: en

The language of any text or names in the response.

Choices: nl fr en de


Composition

Retrieve train composition.

Composition API

GET /v1/composition?format=json&id='S51507'&date=300917&lang=en
RequestsJsonXML
Headers
Accept: application/json
Responses200400404
Headers
Content-Type: application/json
Access-Control-Allow-Origin: "*"
Body
{
  "version": "1.4",
  "timestamp": "1581856899",
  "composition": {
    "segments": {
      "number": "1",
      "segment": [
        {
          "id": "0",
          "origin": {
            "locationX": "4.071825",
            "locationY": "50.891925",
            "id": "BE.NMBS.008895802",
            "name": "Denderleeuw",
            "@id": "http://irail.be/stations/NMBS/008895802",
            "standardname": "Denderleeuw"
          },
          "destination": {
            "locationX": "4.071825",
            "locationY": "50.891925",
            "id": "BE.NMBS.008895802",
            "name": "Denderleeuw",
            "@id": "http://irail.be/stations/NMBS/008895802",
            "standardname": "Denderleeuw"
          },
          "composition": {
            "source": "ITR",
            "units": {
              "number": "3",
              "unit": [
                {
                  "id": "0",
                  "materialType": {
                    "parent_type": "AM08M",
                    "sub_type": "c",
                    "orientation": "LEFT"
                  },
                  "hasToilets": "1",
                  "hasSecondClassOutlets": "1",
                  "hasFirstClassOutlets": "1",
                  "hasHeating": "1",
                  "hasAirco": "1",
                  "materialNumber": "8112",
                  "tractionType": "AM/MR",
                  "canPassToNextUnit": "0",
                  "standingPlacesSecondClass": "27",
                  "standingPlacesFirstClass": "9",
                  "seatsCoupeSecondClass": "0",
                  "seatsCoupeFirstClass": "0",
                  "seatsSecondClass": "76",
                  "seatsFirstClass": "16",
                  "lengthInMeter": "27",
                  "hasSemiAutomaticInteriorDoors": "1",
                  "materialSubTypeName": "AM08M_c",
                  "tractionPosition": "1",
                  "hasPrmSection": "1",
                  "hasPriorityPlaces": "1",
                  "hasBikeSection": "1"
                },
                {
                  "id": "1",
                  "materialType": {
                    "parent_type": "AM08M",
                    "sub_type": "b",
                    "orientation": "LEFT"
                  },
                  "hasToilets": "0",
                  "hasSecondClassOutlets": "1",
                  "hasFirstClassOutlets": "1",
                  "hasHeating": "1",
                  "hasAirco": "1",
                  "materialNumber": "8112",
                  "tractionType": "AM/MR",
                  "canPassToNextUnit": "0",
                  "standingPlacesSecondClass": "40",
                  "standingPlacesFirstClass": "0",
                  "seatsCoupeSecondClass": "0",
                  "seatsCoupeFirstClass": "0",
                  "seatsSecondClass": "104",
                  "seatsFirstClass": "0",
                  "lengthInMeter": "27",
                  "hasSemiAutomaticInteriorDoors": "1",
                  "materialSubTypeName": "AM08M_b",
                  "tractionPosition": "1",
                  "hasPrmSection": "0",
                  "hasPriorityPlaces": "1",
                  "hasBikeSection": "0"
                },
                {
                  "id": "2",
                  "materialType": {
                    "parent_type": "AM08M",
                    "sub_type": "a",
                    "orientation": "RIGHT"
                  },
                  "hasToilets": "0",
                  "hasSecondClassOutlets": "1",
                  "hasFirstClassOutlets": "1",
                  "hasHeating": "1",
                  "hasAirco": "1",
                  "materialNumber": "8112",
                  "tractionType": "AM/MR",
                  "canPassToNextUnit": "0",
                  "standingPlacesSecondClass": "37",
                  "standingPlacesFirstClass": "9",
                  "seatsCoupeSecondClass": "0",
                  "seatsCoupeFirstClass": "0",
                  "seatsSecondClass": "68",
                  "seatsFirstClass": "16",
                  "lengthInMeter": "27",
                  "hasSemiAutomaticInteriorDoors": "1",
                  "materialSubTypeName": "AM08M_a",
                  "tractionPosition": "1",
                  "hasPrmSection": "0",
                  "hasPriorityPlaces": "1",
                  "hasBikeSection": "0"
                }
              ]
            }
          }
        }
      ]
    }
  }
}
Headers
Content-Type: application/json
Body
Missing required parameter: id
Headers
Content-Type: application/json
Body
{
  "exception": "JourneyNotFoundException",
  "message": "Could not find journey with id '999999' on date 2026-11-21",
  "at": "GtfsInMemoryDao.java:147",
  "stackTrace": []
}
Headers
Accept: application/xml
Responses200
Headers
Content-Type: application/xml
Access-Control-Allow-Origin: "*"
Body
<composition version="1.4" timestamp="1581856816">
    <composition>
        <segments number="1">
            <segment id="0">
                <origin locationX="4.071825" locationY="50.891925" id="BE.NMBS.008895802"
                        URI="http://irail.be/stations/NMBS/008895802" standardname="Denderleeuw">Denderleeuw
                </origin>
                <destination locationX="4.071825" locationY="50.891925" id="BE.NMBS.008895802"
                             URI="http://irail.be/stations/NMBS/008895802" standardname="Denderleeuw">Denderleeuw
                </destination>
                <composition>
                    <source>ITR</source>
                    <units number="3">
                        <unit id="0">
                            <materialType>
                                <parent_type>AM08M</parent_type>
                                <sub_type>c</sub_type>
                                <orientation>LEFT</orientation>
                            </materialType>
                            <hasToilets>1</hasToilets>
                            <hasSecondClassOutlets>1</hasSecondClassOutlets>
                            <hasFirstClassOutlets>1</hasFirstClassOutlets>
                            <hasHeating>1</hasHeating>
                            <hasAirco>1</hasAirco>
                            <materialNumber>8112</materialNumber>
                            <tractionType>AM/MR</tractionType>
                            <canPassToNextUnit>0</canPassToNextUnit>
                            <standingPlacesSecondClass>27</standingPlacesSecondClass>
                            <standingPlacesFirstClass>9</standingPlacesFirstClass>
                            <seatsCoupeSecondClass>0</seatsCoupeSecondClass>
                            <seatsCoupeFirstClass>0</seatsCoupeFirstClass>
                            <seatsSecondClass>76</seatsSecondClass>
                            <seatsFirstClass>16</seatsFirstClass>
                            <lengthInMeter>27</lengthInMeter>
                            <hasSemiAutomaticInteriorDoors>1</hasSemiAutomaticInteriorDoors>
                            <materialSubTypeName>AM08M_c</materialSubTypeName>
                            <tractionPosition>1</tractionPosition>
                            <hasPrmSection>1</hasPrmSection>
                            <hasPriorityPlaces>1</hasPriorityPlaces>
                            <hasBikeSection>1</hasBikeSection>
                        </unit>
                        <unit id="1">
                            <materialType>
                                <parent_type>AM08M</parent_type>
                                <sub_type>b</sub_type>
                                <orientation>LEFT</orientation>
                            </materialType>
                            <hasToilets>0</hasToilets>
                            <hasSecondClassOutlets>1</hasSecondClassOutlets>
                            <hasFirstClassOutlets>1</hasFirstClassOutlets>
                            <hasHeating>1</hasHeating>
                            <hasAirco>1</hasAirco>
                            <materialNumber>8112</materialNumber>
                            <tractionType>AM/MR</tractionType>
                            <canPassToNextUnit>0</canPassToNextUnit>
                            <standingPlacesSecondClass>40</standingPlacesSecondClass>
                            <standingPlacesFirstClass>0</standingPlacesFirstClass>
                            <seatsCoupeSecondClass>0</seatsCoupeSecondClass>
                            <seatsCoupeFirstClass>0</seatsCoupeFirstClass>
                            <seatsSecondClass>104</seatsSecondClass>
                            <seatsFirstClass>0</seatsFirstClass>
                            <lengthInMeter>27</lengthInMeter>
                            <hasSemiAutomaticInteriorDoors>1</hasSemiAutomaticInteriorDoors>
                            <materialSubTypeName>AM08M_b</materialSubTypeName>
                            <tractionPosition>1</tractionPosition>
                            <hasPrmSection>0</hasPrmSection>
                            <hasPriorityPlaces>1</hasPriorityPlaces>
                            <hasBikeSection>0</hasBikeSection>
                        </unit>
                        <unit id="2">
                            <materialType>
                                <parent_type>AM08M</parent_type>
                                <sub_type>a</sub_type>
                                <orientation>RIGHT</orientation>
                            </materialType>
                            <hasToilets>0</hasToilets>
                            <hasSecondClassOutlets>1</hasSecondClassOutlets>
                            <hasFirstClassOutlets>1</hasFirstClassOutlets>
                            <hasHeating>1</hasHeating>
                            <hasAirco>1</hasAirco>
                            <materialNumber>8112</materialNumber>
                            <tractionType>AM/MR</tractionType>
                            <canPassToNextUnit>0</canPassToNextUnit>
                            <standingPlacesSecondClass>37</standingPlacesSecondClass>
                            <standingPlacesFirstClass>9</standingPlacesFirstClass>
                            <seatsCoupeSecondClass>0</seatsCoupeSecondClass>
                            <seatsCoupeFirstClass>0</seatsCoupeFirstClass>
                            <seatsSecondClass>68</seatsSecondClass>
                            <seatsFirstClass>16</seatsFirstClass>
                            <lengthInMeter>27</lengthInMeter>
                            <hasSemiAutomaticInteriorDoors>1</hasSemiAutomaticInteriorDoors>
                            <materialSubTypeName>AM08M_a</materialSubTypeName>
                            <tractionPosition>1</tractionPosition>
                            <hasPrmSection>0</hasPrmSection>
                            <hasPriorityPlaces>1</hasPriorityPlaces>
                            <hasBikeSection>0</hasBikeSection>
                        </unit>
                    </units>
                </composition>
            </segment>
        </segments>
    </composition>
</composition>

Retrieve the Composition for a train
GET/v1/composition{?format,id,date,lang}

This endpoint is new and hard to test as we need to compare the data with reality. Create a bug report at our Github issue tracker if you find a bug.

We are aware of an issue with the origin and destination fields. Unfortunately this is a bug in the source data which we cannot fix at this moment.

Retrieve the composition of a train. This means a list of all carriages and locomotives with their properties. materialNumber and materialSubTypeName are available for identified units.

URI Parameters
HideShow
id
string (required) Example: 'S51507'

The ID of the train for which you want to fetch the composition.

format
string (optional) Default: xml Example: json

The response format

Choices: xml json

lang
string (optional) Default: en Example: en

The language of any text or names in the response.

Choices: nl fr en de

date
string (optional) Default: current date in Belgium Example: 300917

The date to query.

The date is formatted as ddmmyy.


Disturbances

Retrieve information about current disturbances.

Disturbance API

GET /v1/disturbances?format=json&lang=en
RequestsJsonXML
Headers
Accept: application/json
Responses200
Headers
Content-Type: application/json
Access-Control-Allow-Origin: "*"
Body
{
  "version": "1.4",
  "timestamp": "1581853952",
  "disturbance": [
    {
      "id": "0",
      "title": "Brux.-Midi/Brus.-Zuid - Amsterdam CS (NL): Incident on the Dutch rail network.",
      "description": "Between Brux.-Midi/Brus.-Zuid and Amsterdam CS (NL): Delays and cancellations are possible. Between Rotterdam CS (NL) and Amsterdam CS (NL): Disrupted train traffic. Indefinite duration of the failure. Listen to the announcements, consult the automatic departure boards or plan your trip via the SNCB app or sncb.be for more information.",
      "link": "http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=trouble&messageID=41188&channelFilter=custom2,livemap,rss_line_10,twitter,custom1,timetable&",
      "type": "disturbance",
      "timestamp": "1581853724",
      "richtext": "Between Brux.-Midi/Brus.-Zuid and Amsterdam CS (NL): Delays and cancellations are possible. Between Rotterdam CS (NL) and Amsterdam CS (NL): Disrupted train traffic. Indefinite duration of the failure. Listen to the announcements, consult the automatic departure boards or plan your trip via the SNCB app or sncb.be for more information.",
      "descriptionLinks": {
        "number": "1",
        "descriptionLink": [
          {
            "id": "0",
            "link": "http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=trouble&messageID=41188&channelFilter=custom2,livemap,rss_line_10,twitter,custom1,timetable&",
            "text": "Read more"
          }
        ]
      }
    },
    {
      "id": "1",
      "title": "Soignies / Zinnik: Failure of a level crossing.",
      "description": "Delays between 5 and 15 minutes are possible in both directions. Indefinite duration of the failure. Listen to the announcements, consult the automatic departure boards or plan your trip via the SNCB app or sncb.be for more information.",
      "link": "http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=trouble&messageID=41187&channelFilter=custom2,livemap,rss_line_10,twitter,custom1,timetable&",
      "type": "disturbance",
      "timestamp": "1581849358",
      "richtext": "Delays between 5 and 15 minutes are possible in both directions. Indefinite duration of the failure. Listen to the announcements, consult the automatic departure boards or plan your trip via the SNCB app or sncb.be for more information.",
      "descriptionLinks": {
        "number": "1",
        "descriptionLink": [
          {
            "id": "0",
            "link": "http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=trouble&messageID=41187&channelFilter=custom2,livemap,rss_line_10,twitter,custom1,timetable&",
            "text": "Read more"
          }
        ]
      }
    },
    {
      "id": "2",
      "title": "Storm warning.",
      "description": "On entire network, from saturday 15/02 evening to sunday 16/02 : Delays and cancellations are possible. Listen to the announcements, consult the automatic departure boards or plan your trip via the SNCB app or sncb.be for more information.",
      "link": "http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=trouble&messageID=41174&channelFilter=timetable,custom1,twitter,rss_line_10,livemap,custom2&",
      "type": "disturbance",
      "timestamp": "1581767543",
      "richtext": "On entire network, from saturday 15/02 evening to sunday 16/02 : Delays and cancellations are possible. Listen to the announcements, consult the automatic departure boards or plan your trip via the SNCB app or sncb.be for more information.",
      "descriptionLinks": {
        "number": "1",
        "descriptionLink": [
          {
            "id": "0",
            "link": "http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=trouble&messageID=41174&channelFilter=timetable,custom1,twitter,rss_line_10,livemap,custom2&",
            "text": "Read more"
          }
        ]
      }
    },
    {
      "id": "3",
      "title": "Brux.-Nord/Brus.-Noord - Schaerbeek / Schaarbeek",
      "description": "We are conducting work for you between Brux.-Nord/Brus.-Noord and Schaerbeek / Schaarbeek. Detailed information only available in French (FR) and in Dutch (NL).",
      "link": "http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=works&messageID=41159&channelFilter=rss_line_90&",
      "type": "planned",
      "timestamp": "1581691640",
      "richtext": "We are conducting work for you between Brux.-Nord/Brus.-Noord and Schaerbeek / Schaarbeek. Detailed information only available in French (FR) and in Dutch (NL).",
      "descriptionLinks": {
        "number": "2",
        "descriptionLink": [
          {
            "id": "0",
            "link": "http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=works&messageID=41159&channelFilter=rss_line_90&",
            "text": "Read more"
          },
          {
            "id": "1",
            "link": "http://www.belgianrail.be/jp/download/brail_him/1581691545283_NL-03003S.pdf",
            "text": "Download"
          }
        ]
      }
    },
    {
      "id": "4",
      "title": "Ostende / Oostende - Anvers-Central / Antwerpen-Centraal",
      "description": "We are conducting work for you between Ostende / Oostende and Anvers-Central / Antwerpen-Centraal. Detailed information only available in French (FR) and in Dutch (NL).",
      "link": "http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=works&messageID=40825&channelFilter=timetable,rss_line_90,custom2&",
      "type": "planned",
      "timestamp": "1581691528",
      "richtext": "We are conducting work for you between Ostende / Oostende and Anvers-Central / Antwerpen-Centraal. Detailed information only available in French (FR) and in Dutch (NL).",
      "descriptionLinks": {
        "number": "2",
        "descriptionLink": [
          {
            "id": "0",
            "link": "http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=works&messageID=40825&channelFilter=timetable,rss_line_90,custom2&",
            "text": "Read more"
          },
          {
            "id": "1",
            "link": "http://www.belgianrail.be/jp/download/brail_him/1580998838767_NL-02045S.pdf",
            "text": "Download"
          }
        ]
      }
    }
  ]
}
Headers
Accept: application/xml
Responses200
Headers
Content-Type: application/xml
Access-Control-Allow-Origin: "*"
Body
<disturbances version="1.4" timestamp="1581854029">
    <disturbance id="0" type="disturbance">
        <title>Soignies / Zinnik: Failure of a level crossing.</title>
        <description><![CDATA[The trains are running normally again.]]></description>
        <link>
            <![CDATA[http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=trouble&messageID=41187&channelFilter=custom2,livemap,rss_line_10,twitter,custom1,timetable&]]></link>
        <timestamp>1581853971</timestamp>
        <richtext><![CDATA[The trains are running normally again.]]></richtext>
        <descriptionLinks number="1">
            <descriptionLink id="0"><link>http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&amp;tplParamHimMsgInfoGroup=trouble&amp;messageID=41187&amp;channelFilter=custom2,livemap,rss_line_10,twitter,custom1,timetable&amp;</link><text>Read more</text></descriptionLink>
        </descriptionLinks>
    </disturbance>
    <disturbance id="1" type="disturbance">
        <title>Brux.-Midi/Brus.-Zuid - Amsterdam CS (NL): Incident on the Dutch rail network.</title>
        <description>
            <![CDATA[Between Brux.-Midi/Brus.-Zuid and Amsterdam CS (NL): Delays and cancellations are possible. Between Rotterdam CS (NL) and Amsterdam CS (NL): Disrupted train traffic. Indefinite duration of the failure. Listen to the announcements, consult the automatic departure boards or plan your trip via the SNCB app or sncb.be for more information.]]></description>
        <link>
            <![CDATA[http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=trouble&messageID=41188&channelFilter=custom2,livemap,rss_line_10,twitter,custom1,timetable&]]></link>
        <timestamp>1581853724</timestamp>
        <richtext>
            <![CDATA[Between Brux.-Midi/Brus.-Zuid and Amsterdam CS (NL): Delays and cancellations are possible. Between Rotterdam CS (NL) and Amsterdam CS (NL): Disrupted train traffic. Indefinite duration of the failure. Listen to the announcements, consult the automatic departure boards or plan your trip via the SNCB app or sncb.be for more information.]]></richtext>
        <descriptionLinks number="1">
            <descriptionLink id="0"><link>http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&amp;tplParamHimMsgInfoGroup=trouble&amp;messageID=41188&amp;channelFilter=custom2,livemap,rss_line_10,twitter,custom1,timetable&amp;</link><text>Read more</text></descriptionLink>
        </descriptionLinks>
    </disturbance>
    <disturbance id="2" type="disturbance">
        <title>Storm warning.</title>
        <description>
            <![CDATA[On entire network, from saturday 15/02 evening to sunday 16/02 : Delays and cancellations are possible. Listen to the announcements, consult the automatic departure boards or plan your trip via the SNCB app or sncb.be for more information.]]></description>
        <link>
            <![CDATA[http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=trouble&messageID=41174&channelFilter=timetable,custom1,twitter,rss_line_10,livemap,custom2&]]></link>
        <timestamp>1581767543</timestamp>
        <richtext>
            <![CDATA[On entire network, from saturday 15/02 evening to sunday 16/02 : Delays and cancellations are possible. Listen to the announcements, consult the automatic departure boards or plan your trip via the SNCB app or sncb.be for more information.]]></richtext>
        <descriptionLinks number="1">
            <descriptionLink id="0"><link>http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&amp;tplParamHimMsgInfoGroup=trouble&amp;messageID=41174&amp;channelFilter=timetable,custom1,twitter,rss_line_10,livemap,custom2&amp;</link><text>Read more</text></descriptionLink>
        </descriptionLinks>
    </disturbance>
    <disturbance id="3" type="planned">
        <title>Brux.-Nord/Brus.-Noord - Schaerbeek / Schaarbeek</title>
        <description>
            <![CDATA[We are conducting work for you between Brux.-Nord/Brus.-Noord and Schaerbeek / Schaarbeek. Detailed information only available in French (FR) and in Dutch (NL).]]></description>
        <link>
            <![CDATA[http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=works&messageID=41159&channelFilter=rss_line_90&]]></link>
        <timestamp>1581691640</timestamp>
        <richtext>
            <![CDATA[We are conducting work for you between Brux.-Nord/Brus.-Noord and Schaerbeek / Schaarbeek. Detailed information only available in French (FR) and in Dutch (NL).]]></richtext>
        <descriptionLinks number="2">
            <descriptionLink id="0"><link>http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&amp;tplParamHimMsgInfoGroup=works&amp;messageID=41159&amp;channelFilter=rss_line_90&amp;</link><text>Read more</text></descriptionLink>
            <descriptionLink id="1"><link>http://www.belgianrail.be/jp/download/brail_him/1581691545283_NL-03003S.pdf</link><text>Download</text></descriptionLink>
        </descriptionLinks>
    </disturbance>
    <disturbance id="4" type="planned">
        <title>Ostende / Oostende - Anvers-Central / Antwerpen-Centraal</title>
        <description>
            <![CDATA[We are conducting work for you between Ostende / Oostende and Anvers-Central / Antwerpen-Centraal. Detailed information only available in French (FR) and in Dutch (NL).]]></description>
        <link>
            <![CDATA[http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&tplParamHimMsgInfoGroup=works&messageID=40825&channelFilter=timetable,rss_line_90,custom2&]]></link>
        <timestamp>1581691528</timestamp>
        <richtext>
            <![CDATA[We are conducting work for you between Ostende / Oostende and Anvers-Central / Antwerpen-Centraal. Detailed information only available in French (FR) and in Dutch (NL).]]></richtext>
        <descriptionLinks number="2">
            <descriptionLink id="0"><link>http://www.belgianrail.be/jp/nmbs-realtime/help.exe/en?tpl=showmap_external&amp;tplParamHimMsgInfoGroup=works&amp;messageID=40825&amp;channelFilter=timetable,rss_line_90,custom2&amp;</link><text>Read more</text></descriptionLink>
            <descriptionLink id="1"><link>http://www.belgianrail.be/jp/download/brail_him/1580998838767_NL-02045S.pdf</link><text>Download</text></descriptionLink>
        </descriptionLinks>
    </disturbance>
</disturbances>

Retrieve the current disturbances
GET/v1/disturbances{?format,lang}

As of November 2017, additional measures have been taken to improve reliability of this endpoint, even if the original NMBS RSS feed is not available. During short RSS or NMBS website outages, this endpoint should keep providing the last known status.

Retrieve information about the current disturbances on the rail network. This data is sourced from the NMBS RSS feed, cleaned up and properly formatted. Descriptions can contain line breaks. Related links are listed in descriptionLinks.descriptionLink. You can distinguish between scheduled changes (works) and unscheduled issues (disturbances) based on the type field.

URI Parameters
HideShow
format
string (optional) Default: xml Example: json

The response format

Choices: xml json

lang
string (optional) Default: en Example: en

The language of any text or names in the response.

Choices: nl fr en de


Occupancy

Give feedback about occupancy on a vehicle at a certain stop

Feedback API

POST /feedback/occupancy
RequestsJson
Headers
Content-Type: application/json
Body
{
  "connection": "http://irail.be/connections/8871308/20160722/IC4516",
  "from": "http://irail.be/stations/NMBS/008871308",
  "date": "20160722",
  "vehicle": "http://irail.be/vehicle/IC4516",
  "occupancy": "http://api.irail.be/terms/low"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "connection": {
      "type": "string",
      "description": "Legacy field accepted for compatibility."
    },
    "from": {
      "type": "string",
      "description": "The station id for which station feedback is posted. **It is discouraged** to calculate or compose this id, but copy it from an API response or stations.csv instead."
    },
    "date": {
      "type": "string",
      "description": "The train journey start date in yyyymmdd format"
    },
    "vehicle": {
      "type": "string",
      "description": "The vehicle URI for which feedback is posted. **Never** calculate or compose this id, but copy it from an API response."
    },
    "occupancy": {
      "type": "string",
      "enum": [
        "http://api.irail.be/terms/low",
        "http://api.irail.be/terms/medium",
        "http://api.irail.be/terms/high"
      ],
      "description": "The occupancy term which defines the reported occupancy in this train."
    }
  },
  "required": [
    "from",
    "date",
    "vehicle",
    "occupancy"
  ]
}
Responses200400
Headers
Content-Type: application/json
Headers
Content-Type: application/json

Post feedback to iRail
POST/feedback/occupancy

The response contains the submitted report. Missing or invalid fields return HTTP 400.

The following data should be included in the POST request:

Caution

Semantic ids can change at any time without warning. You should not calculate or compose semantic ids, but rather re-use ids included in previous API answers


Log endpoint

The live usage feed is currently unavailable. The former unversioned /logs/ route returns HTTP 404.

Logs API

GET /v1/logs
RequestsJson
Headers
Accept: application/json
Responses200
Headers
Content-Type: application/json
Body
[]

Retrieve the last logs
GET/v1/logs

The endpoint currently returns an empty JSON array.


Log and Feedback data

The historical usage-log and occupancy-feedback export directories are currently unavailable. GTFS timetable exports are published separately.

Generated by aglio on 21 Nov 2026