NS reisinformatie
Actuele vertrektijden, vertragingen en storingen op het spoor. Gratis, met een sleutel uit het API-portaal van NS.
Kaart laden …
Wat je ermee kunt bouwen1
Wat kun je ermee?1 ideeën
Hoe vaak is jouw trein te laat?
Sla de vertrektijden van één station een maand lang op en tel de vertragingen.
Interessante koppelingen
Vergelijkbare bronnen
- RT
APIOpenAPI 3.0.1 · gelezen 16 okt 2026
Gratis sleutel nodig, mee te sturen in de header Ocp-Apim-Subscription-Key. Zonder sleutel: HTTP 401 (getest). De sleutel van Open Data Index blijft op de server. getest
JSON
Basisadres
https://gateway.apiportal.ns.nl/reisinformatie-api
Endpoints 15
- GET
/api/v3/tripsTrips - GET
/api/v3/trips/tripSingle trip - GET
/api/v3/trips/booked-tripBooked trip - GET
/api/v3/priceDomestic prices (verouderd) - GET
/api/v3/disruptionsDisruptions (verouderd) - GET
/api/v3/disruptions/{type}/{id}Single disruption (verouderd) - GET
/api/v3/disruptions/station/{stationCode}Station disruptions (verouderd) - GET
/api/v2/stationsStations (verouderd) - GET
/api/v2/stations/nearestGet stations closest to provided coordinates (verouderd) - GET
/api/v2/priceDomestic prices - GET
/api/v2/journeyJourney details - GET
/api/v2/departuresDepartures (verouderd) - GET
/api/v2/arrivalsArrivals (verouderd) - GET
/api/v1/calamitiesCalamities (verouderd) - GET
/api/openapiOpenAPI Spec
Meer API's met dezelfde sleutel 4 · uit de documentatie van de aanbieder uit de beschrijving
Disruptions API (v3)
Storingen, calamiteiten en werkzaamheden, actueel en gepland, met trajecten, oorzaak, verwachte duur en alternatief vervoer.
https://gateway.apiportal.ns.nl/disruptions/v3- GET
/disruptions/v3?isActive&typeLijst van storingen, calamiteiten en werkzaamheden; isActive=true voor alleen wat nu speelt - GET
(single disruption)Eén storing op id - GET
(personal disruptions)Storingen voor opgeslagen reizen - POST
(sync saved trips)Opgeslagen reizen synchroniseren
Open Data Index haalt dit elke 10 minuten op en bewaart de geschiedenis (zie Nu op het spoor).
Spoorkaart API (v1)
Het spoornet als GeoJSON, in trajectdelen van station naar station, plus storingen en routes als kaartlagen.
https://gateway.apiportal.ns.nl/Spoorkaart-API/api/v1- GET
/spoorkaartHet hele spoornet (763 trajectdelen, LineString, eigenschappen from/to) - GET
/storingenStoringen en werkzaamheden als lijnen met stations, niveau en type - GET
/storingen/{id}Eén storing als GeoJSON (.geojson via ?extension) - GET
(route)Route tussen stations als lijn (drie varianten)
Open Data Index gebruikt /spoorkaart (wekelijks) voor de kaart op deze pagina.
Places API (v2)
Plaatsen rond het spoor, zoals stations en hun voorzieningen, OV-fietsen, deelauto's, haltes, adressen en openingstijden.
https://gateway.apiportal.ns.nl/places-api- GET
/api/v2/placesLijst van plaatsen (vervangt autosuggest) - GET
/v2/autosuggest?q&typeZoeken op tekst (verouderd) - GET
(OV-fiets availability)Beschikbaarheid van OV-fietsen - GET
(nearby me locations, v1–v5)Locaties in de buurt van een punt - GET
(stationfacility lift locations)Liften op stations - GET
(modality details, v1–v5)Details van een vervoersmiddel, ook via QR-code
Virtual Train API (v1)
De trein zelf, zoals samenstelling, materieel, drukte-prognose, perroninformatie, ingekorte treinen en afbeeldingen van treinstellen.
https://gateway.apiportal.ns.nl/virtual-train-api/v1- GET
(getTrainInformation…, op ritnummer en station)Samenstelling en materieel van een trein - GET
(getPrognose)Verwachte drukte - GET
(getIngekort, v3)Ingekorte treinen - GET
(getPlatformInfo)Perroninformatie - GET
(getVehicles)Voertuigen en hun positie - GET
/images/{image}Afbeelding van een treinstel (png)
Filteren uit de beschrijving
Geen algemene filtertaal: elk endpoint heeft zijn eigen query-parameters (zie hieronder).
Parameters 30
dateTime | Datetime that the user want to depart from his origin or or arrive at his destination · bij 4 endpoints | uit de beschrijving |
travelClass | Class of travel to use when calculating product prices · bij 4 endpoints | uit de beschrijving |
lang | Language to use for localizing the travel advice. Only a small subset of text is translated, mainly notes. Defaults to Dutch · bij 3 endpoints | uit de beschrijving |
fromStation | NS station code of the origin station · bij 3 endpoints | uit de beschrijving |
toStation | NS station code of the destination station · bij 3 endpoints | uit de beschrijving |
nsr | NSR number for the customer making this request. Since the replacement of the NSRA backend in Reisinfo with PAS, we do not use the NSR … · bij 2 endpoints | uit de beschrijving |
accessibilityEquipment1 | Accessibility equipment to use when searching for trip assistance options (AVG/PAS) · bij 2 endpoints | uit de beschrijving |
accessibilityEquipment2 | Accessibility equipment to use when searching for trip assistance options (AVG/PAS) · bij 2 endpoints | uit de beschrijving |
product | Name of the product that will be used in travel · bij 2 endpoints | uit de beschrijving |
discount | Discount of travel to use when calculating product prices · bij 2 endpoints | uit de beschrijving |
travelRequestType | directionsOnly only plans a google directions (walk/bike/car) advice · bij 2 endpoints | uit de beschrijving |
ctxRecon | Reconstruction context to use as basis for finding trip. Can be found in the /api/v3/trips output · bij 2 endpoints | uit de beschrijving |
travelType | Return the price for a single or return trip. Defaults to single · bij 2 endpoints | uit de beschrijving |
isJointJourney | Set to true to return the price including joint journey discount · bij 2 endpoints | uit de beschrijving |
adults | Number of adults to return the price for. Defaults to 1 · bij 2 endpoints | uit de beschrijving |
children | Number of children to return the price for. Defaults to 0 · bij 2 endpoints | uit de beschrijving |
routeId | Specific identifier for the route to take between the two stations. This routeId is returned in the /api/v3/trips call. · bij 2 endpoints | uit de beschrijving |
plannedArrivalTime | Planned arrival time of the trip. Is used to find the correct route, if multiple routes are possible between the origin and destination … · bij 2 endpoints | uit de beschrijving |
limit | The limit is only applied when call is performed with q parameter. If invoked by countrycodes only, no limit is applied · bij 2 endpoints | uit de beschrijving |
station | NS Station code for the station to return departures for. Can be left empty if uicCode parameter is provided. · bij 2 endpoints | uit de beschrijving |
uicCode | UIC code for the station to return departures for. Can be left empty if station parameter is provided. · bij 2 endpoints | uit de beschrijving |
maxJourneys | Number of departures or departures to return. Defaults to 40 · bij 2 endpoints | uit de beschrijving |
originUicCode | UIC code of the origin station · bij v3/trips | uit de beschrijving |
originLat | Latitude of the origin location. Should be used together with originLng. If the origin is a station, just provide the uicCode instead of … · bij v3/trips | uit de beschrijving |
originLng | Longitude of the origin location. Should be used together with originLat. If the origin is a station, just provide the uicCode instead of … · bij v3/trips | uit de beschrijving |
originName | Name of the origin location. Will be returned in the response · bij v3/trips | uit de beschrijving |
destinationUicCode | UIC code of the destination station · bij v3/trips | uit de beschrijving |
destinationLat | Latitude of the destination location. Should be used together with destinationLng. If the destination is a station, just provide the … · bij v3/trips | uit de beschrijving |
destinationLng | Longitude of the destination location. Should be used together with destinationLat. If the destination is a station, just provide the … · bij v3/trips | uit de beschrijving |
destinationName | Name of the destination location. Will be returned in the response · bij v3/trips | uit de beschrijving |
Limieten en valkuilen
- De beschrijving noemt als server https://apigateway.ns.nl/reisinformatie-api, maar de werkende gateway is https://gateway.apiportal.ns.nl/reisinformatie-api. getest
- 300 verzoeken per 5 minuten voor niet-betalende gebruikers; daarboven HTTP 429 met een Retry-After-kop. uit de beschrijving
- De NS-voorwaarden verbieden het NS-logo in je toepassing en het zo bewerken van gegevens dat er onjuiste informatie ontstaat. uit de beschrijving
- Antwoorden komen gecomprimeerd (gzip); gebruik curl --compressed of een client die dat zelf uitpakt. getest
- Arrivals en departures in deze API zijn verouderd: NS verwijst naar https://gateway.apiportal.ns.nl/timetable-api/v2/. uit de beschrijving
- Het NS-portaal toont de API-definities alleen na inloggen; alleen de spec van de Reisinformatie-API is via de gateway op te vragen. getest
Probeer het HTTP 200 · 315 ms · 16 okt
https://gateway.apiportal.ns.nl/reisinformatie-api/api/v2/departures?station=UT&maxJourneys=2
{
"payload": {
"source": "DVS",
"departures": [
{
"direction": "Venlo",
"name": "NS 3525",
"plannedDateTime": "2026-10-16T08:24:00+0200",
"plannedTimeZoneOffset": 120,
"actualDateTime": "2026-10-16T08:24:00+0200",
"actualTimeZoneOffset": 120,
"plannedTrack": "18",
"actualTrack": "18",
"product": {
"number": "3525",
"categoryCode": "IC",
"shortCategoryName": "NS Intercity",
"longCategoryName": "Intercity",
"operatorName": "NS",
"operatorCode": "NS",
"type": "TRAIN"
},
"trainCategory": "IC",
"cancelled": false,
"routeStations": [
{
"uicCode": "8400319",
"mediumName": "'s-Hertogenbosch"
},
{
"uicCode": "8400206",
"mediumName": "Eindhoven C."
}
],
"messages": [],
"departureStatus": "ON_STATION"
},
{
"direction": "Zaandam",
"name": "NS 2722",Ingekort antwoord, opgeslagen bij het oogsten. Klik op het adres voor het echte, actuele antwoord.
Gelezen uit OpenAPI-beschrijving, 15 paden (met sleutel). Labels: uit de beschrijving staat in wat de api zelf publiceert. getest uit onze eigen kleine aanroep. platform geldt voor elk api van dit platform, volgens de documentatie. ervaring zelf ondervonden bij het bouwen van open data index.
Meer in dit thema
Bekijk hoe deze pagina is opgebouwd
bron: ns-reisinformatie blokken: [] secties: - ideeen - koppelingen - vergelijkbaar cache: tag: bron:ns-reisinformatie ververs: na statuscheck, als de bron nieuwer is statuscheck: methode: API-portaal bereikbaar verwacht: elke minuut
Bron: content/bronnen/ns-reisinformatie.yaml · Markdown




