Main navigation

Go to content

Documentation: up to date departure times

The web-service for up to date departure times allows users to request an up to date overview for a station which shows all departing trains for the next hour.


Request

Up to date departure information can be obtained using the following url:

https://webservices.ns.nl/ns-api-avt?station=${Name or abbreviation of Station}

Parameter Description Required
station The code (abbreviation) or short name or medium-length name or full name or synonym of the station's name Ja

At least 10 departure times will be sent back and at least all the departure times for the next hour. An example of a request for up to date departure times from Utrecht Centraal station:

https://webservices.ns.nl/ns-api-avt?station=ut

Because more than 10 trains leave Utrecht Centraal each hour, the response contains all departure information for the next hour.

An example of a request for up to date departure times from Kampen station:

https://webservices.ns.nl/ns-api-avt?station=Kampen

Because only 2 trains leave Kampen each hour, 10 departure times are listed in the response.

Response

The response consists of the element ActueleVertrekTijden that contains an element VertrekkendeTrein for each departing train.

A VertrekkendeTrein can have the following elements:

  • RitNummer (1): The train's identification number
  • VertrekTijd (1): Departure time in minutes
  • VertrekVertraging (0..1): Delay in minutes
  • VertrekVertragingTekst (0..1): Delay presentation text
  • EindBestemming (1): The train's planned final destination
  • TreinSoort (1): Train type (Intercity, Sprinter etc.)
  • RouteTekst (0..1): Brief description of the train's route. A maximum of 4 station stops are included, so this is usually a summary of the full route.
  • Vervoerder (1): The train's carrier.
  • VertrekSpoor (1): The train's departing platform. This attribute "wijziging" indicates whether or not the departing platform has been changed.
  • ReisTip (0..1): A line of text offering a tip geeft about the journey. Here attention is brought to any possible unexpected details. E.g. an Intercity train that stops at all stations.
  • Comments (0..1). Textual comments related to the departing train. Consists of 0 or more Comment-elements, that consist only of lines of text. Nearly always includes journey alterations, such as "No service today".