skip to navigation
skip to content

nsapi 2.7.4

api wrapper for Dutch Railways (NS)

Query the Dutch railways about your routes, getting info on delays and more. See below for the syntax and example output.


From PyPI

Assuming you already are inside a virtualenv:

pip install nsapi

From Git

Create a new virtualenv (if you are not already in one) and install the necessary packages:

git clone
cd ns-api
mkvirtualenv ns-api
pip install -r requirements.txt

As part of ns-notifications

Alternatively, follow the installation instructions of ns-notifications, which makes extensive use of this library to serve notifications to for example a smartphone. The requirements of both packages can be installed in the same ns-notifications one mentioned in the project; ns-api will be installed through pip from PyPI.

Example application

For example, I use the library to push notifications about my route to my phone through Pushbullet. The program I use to do this has its own repository: ns-notifications.

NS API key

To actually be able to query the Nederlandse Spoorwegen API, you need to request a key. Provide a good reason and you will likely get it mailed to you (it might take some days).

File Type Py Version Uploaded on Size (md5) Source 2016-02-27 12KB