← 返回
开发者工具 Key 中文

NS Trains

Check Dutch train schedules, departures, disruptions, and plan journeys using the NS API. Perfect for daily commute checks.
通过NS API查询荷兰火车时刻表、出发时间、中断情况并规划行程,适合日常通勤查询。
eggressive
开发者工具 clawhub v1.1.0 1 版本 100000 Key: 需要
★ 1
Stars
📥 2,133
下载
💾 33
安装
1
版本
#api#commute#latest#netherlands#trains#transport

概述

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

  1. Go to NS API Portal
  2. Create an account and subscribe to the Ns-App product (free tier available)
  3. 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

CommandDescription
----------------------
`commute.mjs [work\home]`Quick commute check (requires NS_HOME_STATION & NS_WORK_STATION)
journey.mjs --from X --to YPlan a journey between any stations
departures.mjs --station XList departures from a station
arrivals.mjs --station XList arrivals at a station
stations.mjs [query]Search for station names
disruptions.mjsCheck 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

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-03-28 15:52 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,239
developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,237
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,808