silvanwakker / ns-api-php-wrapper
Provides a PHP wrapper for the Nederlandse Spoorwegen API.
dev-master
2018-05-26 12:24 UTC
Requires
- php: ^7.1
- guzzlehttp/guzzle: ^6.3
This package is not auto-updated.
Last update: 2024-09-29 04:26:01 UTC
README
Provides a PHP wrapper for the Nederlandse Spoorwegen API.
View the online documentation at: https://www.ns.nl/reisinformatie/ns-api.
Installation
composer require silvanwakker/ns-api-php-wrapper
Usage
Creating an instance:
$username = 'YOUR NS API USERNAME'; $password = 'YOUR NS API PASSWORD'; $client = new Client($username, $password);
Examples
Get the prices:
$from = 'Kampen'; $to = 'Zwolle'; $prices = $client->getPrices($from, $to);
Contributing
This is my first ever attempt at creating a wrapper for an API. If you have any suggestions, questions or improvements please create an issue and/or pull request on this repository.