🚆 NS Trains — 荷兰火车查询
v1.1.0通过 NS API 查询荷兰火车时刻表、离到站信息、延误及 disruptions,支持行程规划,适合日常通勤查询。
1· 1.8k·0 当前·0 累计
安全扫描
OpenClaw
安全
high confidence技能的代码、指令和请求的环境变量与其声明的查询官方 NS API 的目的一致;包中没有任何内容显得过度或无关。
评估建议
该技能名副其实:它查询官方 NS API,只需要你的 NS 订阅密钥。安装前请考虑:(1) 保持 NS_SUBSCRIPTION_KEY 机密 — 通过运行时密钥管理器注入,而非提交到代码库。(2) 内置的 ns-api.mjs 强制使用 HTTPS 和白名单(gateway.apiportal.ns.nl),并设置 Ocp-Apim-Subscription-Key 头 — 你可以自行查看该文件(已包含)以确认没有联系其他主机。(3) 确保你的环境有兼容的 Node 版本(现代 Node 提供全局 fetch)。(4) 由于代码在本地运行,只有在你信任此技能来源时才授予订阅密钥;如果你从其他渠道获取密钥(或轮换它),如果怀疑密钥已暴露,请从 NS API 门户撤销它。总体而言,该包在其用途上内部一致且最小化。...详细分析 ▾
✓ 用途与能力
名称/描述与实际行为一致:所有脚本都查询 NS 端点(journeys、departures、arrivals、disruptions、stations)。唯一需要的二进制文件是 node,唯一需要的密钥是 NS_SUBSCRIPTION_KEY — 两者都适合调用 NS API。
✓ 指令范围
SKILL.md 指示设置 NS_SUBSCRIPTION_KEY 并运行包含的 node 脚本。脚本只读取环境变量(订阅密钥、可选的通勤站点),调用 NS API 端点,并打印结果。它们不读取无关文件,不向外部主机泄露数据,也不执行任意 shell 命令。
ℹ 安装机制
没有安装规范(仅说明),但该技能包含可运行的 JS 文件。该技能不执行外部下载或包安装。注意:脚本依赖 Node 的内置 fetch(在现代 Node 版本上工作);SKILL.md 只要求 'node' 但未指定最低 Node 版本。
✓ 凭证需求
只需要 NS_SUBSCRIPTION_KEY(以及向后兼容的 NS_API_KEY),加上可选的 NS_HOME_STATION / NS_WORK_STATION 以方便使用。这些变量对于声明的 API 交互是适当且最小的。
✓ 持久化与权限
技能不请求持久性/系统级权限,不设置 always:true,也不修改其他技能或系统配置。自主调用(模型可以调用它)是平台默认设置,在这里并不过度。
安全有层次,运行前请审查代码。
运行时依赖
无特殊依赖
版本
latestv1.1.02026/2/1
安全加固(HTTPS + 通过 nsFetch 添加白名单),添加 SECURITY.md,添加 ns-api.mjs,改进 departures 以解析站名 -> 代码,环境变量向后兼容 NS_API_KEY->NS_SUBSCRIPTION_KEY
● 无害
安装命令
点击复制官方npx clawhub@latest install ns-trains
镜像加速npx clawhub@latest install ns-trains --registry https://cn.longxiaskill.com 镜像可用
本土化适配说明
NS Trains — 荷兰火车查询 安装说明: 安装命令:npx clawhub@latest install ns-trains 支持国内镜像加速,使用 --registry https://cn.longxiaskill.com 参数可加速下载
技能文档
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
For security, prefer injecting these env vars via your runtime secret mechanism rather than committing them anywhere. Avoid printing or sharing your subscription key.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"
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