haarlemmertrekvaart 1.1.0

dotnet add package haarlemmertrekvaart --version 1.1.0
NuGet\Install-Package haarlemmertrekvaart -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="haarlemmertrekvaart" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add haarlemmertrekvaart --version 1.1.0
#r "nuget: haarlemmertrekvaart, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install haarlemmertrekvaart as a Cake Addin
#addin nuget:?package=haarlemmertrekvaart&version=1.1.0

// Install haarlemmertrekvaart as a Cake Tool
#tool nuget:?package=haarlemmertrekvaart&version=1.1.0

haarlemmertrekvaart Build status NuGet

Unofficial .NET client for accessing the NS (Nederlandse Spoorwegen) API.

Installation

This package is available on NuGet Gallery. To install the haarlemmertrekvaart package run the following command in the Package Manager Console.

PM> Install-Package haarlemmertrekvaart

Using haarlemmertrekvaart

General

Getting data from NS API is pretty straightforward and hopefully this client will make your life easier. Create a NsClient object and pass a valid ConnectionConfiguration object with your username and developer key.

ConnectionConfiguration connectionConfiguration = new ConnectionConfiguration("joaoantao", "myawesomekey");
NsClient nsClient = new NsClient(connectionConfiguration);

You can request your developer key to NS here. The NS API only supports Basic Access Authentication I would not recommend the use of it in any production environment.

Examples

Stations
var stations = await client.Station.GetAll();
Travel recommendations

Can be used to employ the NS Travel planner for a train journey from one station to another. A travel recommendation consists of multiple travel options, so that the passenger can make a choice. A travel recommendation includes both planned and up to date information. Takes a departure station name and a destination station name as arguments.

var recommendations = await client.TravelPlanner.GetAll("Rotterdam+Centraal", "Amsterdam+Centraal");
Departures

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 in a specific station. Takes a departure station name as argument.

var departures = await client.Departure.GetAll("Amsterdam+Centraal");
Disruptions/Engineering works
var disruptions = await client.Disruption.GetAll("Amsterdam+Centraal", true);

Limits

A maximum of 50,000 requests per day can be made for each service to the NS API.

Notes

A short summary of the NS API conditions:

  • Respect the capacity of the NS servers; try to make proper use of the capacity made available to you. If NS expects abuse, you may be immediately cut off.
  • The API is a beta-service. NS can make adjustments (sometimes technical in nature) or terminate the service at any time.
  • The developer who is given access to the API is responsible for what is done with his/her connection.
  • You are not permitted to use the NS logo in applications that you develop.
  • It is forbidden to use the API in such a way that false information is broadcast.

More documentation can be found here.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 1,244 10/21/2016