NS APIs

    We've put together a number of APIs you can use. The first are the APIs that are developed for the NS app and other apps of NS.
    You can read all about it in the documentation. To be able to use the APIs, you need to log in with your NS account (or create one for free). We assume you have some knowledge of REST interfaces.

Go to the documentation

Features

Places

Autocomplete with locations from the entire Netherlands, station facilities, shops, opening hours, OV-fiets availability, etc.

Virtual train

See where your train is, the speed, rolling stock, facilities on the train and expected crowdedness.

Rail tracks

Get GeoJSON location data of rail tracks, for displaying on a map

Journey planner

Plan your journey and request disruptions.

How does it work?

APIs are ways to retrieve data. We developed various APIs which the NS apps use. We made this available for you so more people can use it.

The movie clip gives a short explanation how an API works. If you need more information, check out the Wikipedia page, or Google for REST APIs.

 

Go to the documentation

Frequently Asked Questions

What does it cost?

Use of the APIs is free, but there are limits for usage. These limits are created you can use the service for free, but for higher usage we need to make individual agreements. NS can limit and/or cancel usage at any time. Please contact us if you have any questions.

Why is the documentation in English, but are some APIs partly in Dutch?

We would like to make the APIs available for everyone. English makes it wider accessible. However, some terms are typical for the Dutch rail system and there are no existing English words for that. To avoid confusion, these words are kept in Dutch.

I have an idea/suggestion, who can I contact?

Please use the contact form in the documentation section, we will send you a reply asap.

What is the M-lab?

M-lab is a department within NS that develops apps for travelers, including the NS app and NS International app.

I've never used APIs before, can you explain how it works and provide some examples?

Maybe this site is not for you.... We assume you know what a REST API does and there are many examples on the internet.

How can I get started?

Request an API key in the documentation section. You need this API key to make requests.

Want to start?

Go to the documentation