The Virtual train API collects information about the GPS position of the train. It contains a web interface to request trains, and a websocket to receive the position.
Most APIs use train numbers (ritnummer in Dutch), which is more or less the same for each day. It’s not possible to request for another date.
?features=zitplaatsin the url is optional; this will enrich the data with the number of available seats. The
?features=druktein the url is optional; this will enrich the data with the crowd forecast. Multiple features can be combined with a comma, e.g.
|ritnummer||Number of the train|
|vervoerder||Train operator, e.g. NS|
|materieelnummer||Number of the train coach|
|type||Type of train coach|
|faciliteiten||Facilities in this train available, i.e. TOILET, STROOM (power), WIFI, STILTE (silence zone), TOEGANKELIJK (wheelchair accessible), FIETS (bike parking), BISTRO (restaurant)|
|afbeelding||Image of this type of train|
|zitplaatsen||Optional information about the available seats in this coach. These are: staanplaatsEersteKlas (standing space first class), staanplaatsTweedeKlas (standing space second class), zitplaatsEersteKlas (seats first class), zitplaatsTweedeKlas (seats second class), klapstoelEersteKlas (tip-up chairs first class), klapstoelTweedeKlas (tip-up chairs second class).|
|ingekort||Whether this train is shorter than usual|
|length||Number of coaches|
This request will give you all the information about all trains. The response shows all the stops the train will make. The response is over 10MB, so please use this resource with caution.
You can request train positions from
The GPS location of trains also has a websocket. If you'd like to have access to this websocket, please contact us.
If you don’t have a train number, you can look it up based on a materieelnummer (coach number). This materieelnummer is displayed in all trains above the doors.
The response code will be 204 when there is no train number for that coach number. The response code will be 200 and includes the train number as integer in the response.
It’s possible to request the expected number of people on the train, as well as the capacity of the train.
It’s possible to request the list with trains that are shorter than usual. This is only the case when the train reaches capacity.