NS Trains
Check Dutch train schedules, departures, disruptions, and plan journeys using the NS API. Perfect for daily commute checks.
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 1 · 1.6k · 0 current installs · 0 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description match the actual behavior: all scripts query NS endpoints (journeys, departures, arrivals, disruptions, stations). The only required binary is node and the only required secret is NS_SUBSCRIPTION_KEY — both are appropriate for calling the NS API.
Instruction Scope
SKILL.md instructs setting NS_SUBSCRIPTION_KEY and running the included node scripts. The scripts only read env vars (subscription key, optional commute stations), call NS API endpoints, and print results. They do not read unrelated files, leak data to external hosts, or execute arbitrary shell commands.
Install Mechanism
There is no install spec (instruction-only), but the skill includes runnable JS files. No external downloads or package installs are performed by the skill. Note: scripts rely on Node's built-in fetch (works on modern Node versions); the SKILL.md only requires 'node' but does not specify a minimum Node version.
Credentials
Only NS_SUBSCRIPTION_KEY (and backward-compatible NS_API_KEY) are required, plus optional NS_HOME_STATION / NS_WORK_STATION for convenience. These variables are appropriate and minimal for the stated API interactions.
Persistence & Privilege
Skill does not request persistent/system-wide privileges, does not set always:true, and does not modify other skills or system configuration. Autonomous invocation (model can call it) is the platform default and is not excessive here.
Assessment
This skill appears to be what it says: it queries the official NS API and only needs your NS subscription key. Before installing, consider: (1) Keep NS_SUBSCRIPTION_KEY secret — inject it via your runtime secret manager rather than committing it. (2) The included ns-api.mjs enforces HTTPS and an allowlist (gateway.apiportal.ns.nl) and sets the Ocp-Apim-Subscription-Key header — you can review that file yourself (it's included) to confirm no other hosts are contacted. (3) Ensure your environment has a compatible Node version (modern Node provides global fetch). (4) Because the code runs locally, only grant the subscription key if you trust this skill source; if you obtain the key elsewhere (or rotate it), revoke it from the NS API portal if you suspect exposure. Overall the package is internally consistent and minimal for its purpose.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.1.0
Download zipapicommutelatestnetherlandstrainstransport
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
Runtime requirements
🚆 Clawdis
Binsnode
EnvNS_SUBSCRIPTION_KEY
Primary envNS_SUBSCRIPTION_KEY
SKILL.md
NS Trains Skill
Check Dutch train schedules, departures, disruptions, and plan journeys using the official NS (Nederlandse Spoorwegen) API.
Setup
1. Get an NS subscription key
- Go to NS API Portal
- Create an account and subscribe to the Ns-App product (free tier available)
- Copy your Primary Key
2. Set Environment Variables
export NS_SUBSCRIPTION_KEY="your-subscription-key-here" # preferred
# Back-compat:
export NS_API_KEY="$NS_SUBSCRIPTION_KEY" # legacy name still supported
# Optional: Configure commute stations for quick shortcuts
export NS_HOME_STATION="Utrecht Centraal"
export NS_WORK_STATION="Amsterdam Zuid"
For security, prefer injecting these env vars via your runtime secret mechanism rather than committing them anywhere. Avoid printing or sharing your subscription key.
Quick Usage
🚆 Commute shortcuts
node {baseDir}/scripts/commute.mjs --to-work # Morning: Home → Work
node {baseDir}/scripts/commute.mjs --to-home # Evening: Work → Home
Plan any journey
node {baseDir}/scripts/journey.mjs --from "Utrecht Centraal" --to "Amsterdam Zuid"
Check departures from a station
node {baseDir}/scripts/departures.mjs --station "Amsterdam Centraal"
Check arrivals at a station
node {baseDir}/scripts/arrivals.mjs --station "Rotterdam Centraal"
Search for stations
node {baseDir}/scripts/stations.mjs amsterdam
node {baseDir}/scripts/stations.mjs --search "den haag"
Check current disruptions
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
9 totalSelect a file
Select a file to preview.
Comments
Loading comments…
