Skip to content
Back to skills

Ns Trains

DSecurity

Check Dutch train schedules, departures, disruptions, and plan journeys using the NS API. Perfect for daily commute checks.

  • 10 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 7, 2026
toolsgobashnodeapidocumentation

Works with

  • api

Security analysis

D50/100
  • criticalModifies startup scripts or system services for persistence
  • criticalModifies startup scripts or system services for persistence

Pro scans all 8 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add Demerzels-lab/elsamultiskillagent --skill ns-trains --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ns Trains?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ns Trains
[![Security: D β€” Skills Directory](https://www.skillsdirectory.com/api/skills/demerzels-lab-ns-trains/badge)](https://www.skillsdirectory.com/skills/demerzels-lab-ns-trains)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ns-trains
description: Check Dutch train schedules, departures, disruptions, and plan journeys using the NS API. Perfect for daily commute checks.
metadata: {"openclaw":{"emoji":"πŸš†","requires":{"bins":["node"],"env":["NS_API_KEY"]},"primaryEnv":"NS_API_KEY"}}
---

# NS Trains Skill

Check Dutch train schedules, departures, disruptions, and plan journeys using the official NS (Nederlandse Spoorwegen) API.

## Setup

### 1. Get an NS API Key

1. Go to [NS API Portal](https://apiportal.ns.nl/)
2. Create an account and subscribe to the **Ns-App** product (free tier available)
3. Copy your **Primary Key**

### 2. Set Environment Variables

```bash
export NS_API_KEY="your-api-key-here"

# Optional: Configure commute stations for quick shortcuts
export NS_HOME_STATION="Utrecht Centraal"
export NS_WORK_STATION="Amsterdam Zuid"
```

Add to `~/.bashrc` or `~/.zshrc` for persistence.

## Quick Usage

### πŸš† Commute shortcuts
```bash
node {baseDir}/scripts/commute.mjs --to-work   # Morning: Home β†’ Work
node {baseDir}/scripts/commute.mjs --to-home   # Evening: Work β†’ Home
```

### Plan any journey
```bash
node {baseDir}/scripts/journey.mjs --from "Utrecht Centraal" --to "Amsterdam Zuid"
```

### Check departures from a station
```bash
node {baseDir}/scripts/departures.mjs --station "Amsterdam Centraal"
```

### Check arrivals at a station
```bash
node {baseDir}/scripts/arrivals.mjs --station "Rotterdam Centraal"
```

### Search for stations
```bash
node {baseDir}/scripts/stations.mjs amsterdam
node {baseDir}/scripts/stations.mjs --search "den haag"
```

### Check current disruptions
```bash
node {baseDir}/scripts/disruptions.mjs
node {baseDir}/scripts/disruptions.mjs --from "Utrecht" --to "Amsterdam"
```

## Natural Language

Just ask:
- "When is the next train to Amsterdam?"
- "Check trains from Utrecht to Rotterdam"
- "Any train disruptions today?"
- "Plan my commute to work"
- "What time does the train arrive?"

## Output

Returns journey options with:
- Departure/arrival times
- Real-time delays
- Duration
- Transfers
- Platform numbers
- Disruption warnings
- Crowdedness forecast (🟒 low / 🟑 medium / πŸ”΄ high)

## Commands Reference

| Command | Description |
|---------|-------------|
| `commute.mjs [work\|home]` | Quick commute check (requires NS_HOME_STATION & NS_WORK_STATION) |
| `journey.mjs --from X --to Y` | Plan a journey between any stations |
| `departures.mjs --station X` | List departures from a station |
| `arrivals.mjs --station X` | List arrivals at a station |
| `stations.mjs [query]` | Search for station names |
| `disruptions.mjs` | Check current disruptions |

## API Endpoints Used

- `/reisinformatie-api/api/v3/trips` - Journey planning
- `/reisinformatie-api/api/v2/arrivals` - Arrivals
- `/reisinformatie-api/api/v2/departures` - Departures  
- `/reisinformatie-api/api/v3/disruptions` - Disruptions
- `/reisinformatie-api/api/v2/stations` - Station search

## Reference

- NS API Portal: https://apiportal.ns.nl/
- Documentation: https://apiportal.ns.nl/startersguide
- Free tier: 5000 requests/day

Files in this skill

  • SKILL.md3 KB
  • _meta.json287 B
  • scripts/arrivals.mjs3 KB
  • scripts/commute.mjs4.1 KB
  • scripts/departures.mjs3.3 KB
  • scripts/disruptions.mjs4.2 KB
  • scripts/journey.mjs4.3 KB
  • scripts/stations.mjs2.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…