PHPackages                             edofre/laravel-ns-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. edofre/laravel-ns-api

ActiveLibrary[API Development](/categories/api)

edofre/laravel-ns-api
=====================

Laravel wrapper for the NS API

V1.0.0(9y ago)128MITPHPPHP &gt;=5.6.4

Since Feb 4Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Edofre/laravel-ns-api)[ Packagist](https://packagist.org/packages/edofre/laravel-ns-api)[ Docs](https://github.com/edofre/laravel-ns-api)[ RSS](/packages/edofre-laravel-ns-api/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Laravel NS API wrapper
======================

[](#laravel-ns-api-wrapper)

[![Latest Stable Version](https://camo.githubusercontent.com/aee3073ba833442d3253da3b2b6eccb4e8dc69169638c7cf9081421d27d4796c/68747470733a2f2f706f7365722e707567782e6f72672f65646f6672652f6c61726176656c2d6e732d6170692f762f737461626c65)](https://packagist.org/packages/edofre/laravel-ns-api)[![Total Downloads](https://camo.githubusercontent.com/fce44e6d7e40e67fe47afebe1e0bd55b6703943bba8ad215826db808a7b7e9f6/68747470733a2f2f706f7365722e707567782e6f72672f65646f6672652f6c61726176656c2d6e732d6170692f646f776e6c6f616473)](https://packagist.org/packages/edofre/laravel-ns-api)[![Latest Unstable Version](https://camo.githubusercontent.com/f4df76366337fa01285e018542e75bb9e423eafd00b869740d8ec349e592201d/68747470733a2f2f706f7365722e707567782e6f72672f65646f6672652f6c61726176656c2d6e732d6170692f762f756e737461626c65)](https://packagist.org/packages/edofre/laravel-ns-api)[![License](https://camo.githubusercontent.com/2a69c94d2bcf68df1951ebdf7ed080d731b696d0bf44e4f5d07640f90d9c56ef/68747470733a2f2f706f7365722e707567782e6f72672f65646f6672652f6c61726176656c2d6e732d6170692f6c6963656e7365)](https://packagist.org/packages/edofre/laravel-ns-api)[![composer.lock](https://camo.githubusercontent.com/da521e4eb7611c581a072e81239ae5239bb8c5c49ba9a2c784130db6773d5e62/68747470733a2f2f706f7365722e707567782e6f72672f65646f6672652f6c61726176656c2d6e732d6170692f636f6d706f7365726c6f636b)](https://packagist.org/packages/edofre/laravel-ns-api)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

To install, either run

```
$ php composer.phar require edofre/laravel-ns-api

```

or add

```
"edofre/laravel-ns-api": "v1.0.0"

```

to the `require` section of your `composer.json` file.

Configuration
-------------

[](#configuration)

Publish assets and configuration files

```
php artisan vendor:publish --tag=config

```

In the above configuration file you will need to enter your NS API username and password

### Example

[](#example)

#### Get all the stations

[](#get-all-the-stations)

```
$api = new NsApi();
$stations = $api->getStations();
```

#### Get all the departing trains from a station

[](#get-all-the-departing-trains-from-a-station)

```
$api = new NsApi();
$station = new Station('UT', '','','','','','','','','');
$departing_trains = $api->getDepartures($station);
```

#### Get all the disturbances from a station

[](#get-all-the-disturbances-from-a-station)

```
$api = new NsApi();
$station = new Station('ut', '', '', '', '', '', '', '', '', '');
// We want the actual disturbances and not the unplanned disturbances
$disturbances = $api->getDisturbances($station, true , false);
```

#### Get the prices for a route

[](#get-the-prices-for-a-route)

```
$api = new NsApi();
$from_station = new Station('ZL', '', '', '', '', '', '', '', '', '');
$via_station = new Station('DH', '', '', '', '', '', '', '', '', '');
$to_station = new Station('HT', '', '', '', '', '', '', '', '', '');
$prices = $api->getPrices($from_station, $to_station, $via_station);
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3432d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/01cd9d2772b5c19c989c92093a092bd087524cee9629b0e715ccb4125a69f2e8?d=identicon)[edofre](/maintainers/edofre)

---

Top Contributors

[![Edofre](https://avatars.githubusercontent.com/u/710429?v=4)](https://github.com/Edofre "Edofre (74 commits)")

---

Tags

apilaravelnstrein

### Embed Badge

![Health badge](/badges/edofre-laravel-ns-api/health.svg)

```
[![Health](https://phpackages.com/badges/edofre-laravel-ns-api/health.svg)](https://phpackages.com/packages/edofre-laravel-ns-api)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.5M923](/packages/statamic-cms)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k8.8M83](/packages/openai-php-laravel)[unopim/unopim

UnoPim Laravel PIM

10.3k2.2k](/packages/unopim-unopim)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

72287.1k1](/packages/mozex-anthropic-laravel)[aimeos/aimeos-headless

Aimeos headless ecommerce system

2.5k2.3k](/packages/aimeos-aimeos-headless)[nickurt/laravel-postcodeapi

Universal PostcodeApi for Laravel 11.x/12.x/13.x

97228.0k](/packages/nickurt-laravel-postcodeapi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
