← 返回
AI智能 中文

Swiss Public Transport

Swiss Public Transport real-time information. Use when querying train, bus, tram, or boat schedules in Switzerland. Supports station search, departure boards, journey planning from A to B, and connection details. Use for queries like "When does the next train leave from Zürich?" or "How do I get from Bern to Geneva?" or "Show departures at Basel SBB".
瑞士公共交通实时信息。用于查询瑞士火车、巴士、电车或船只的时刻表。支持站点搜索、出发表、路线规划及换乘详情。适用于“苏黎世下一班火车何时出发”、“如何从伯尔尼去日内瓦”或“显示巴塞尔SBB出发信息”等查询。
xenofex7
AI智能 clawhub v1.0.0 1 版本 99954.3 Key: 无需
★ 3
Stars
📥 2,129
下载
💾 263
安装
1
版本
#latest

概述

Swiss Public Transport

Query Swiss public transport (SBB, BLS, ZVV, etc.) using the official transport.opendata.ch API.

Quick Commands

Search stations

curl -s "https://transport.opendata.ch/v1/locations?query=Zürich" | jq -r '.stations[] | "\(.name) (\(.id))"'

Get next departures

curl -s "https://transport.opendata.ch/v1/stationboard?station=Zürich%20HB&limit=10" | \
  jq -r '.stationboard[] | "\(.stop.departure[11:16]) \(.category) \(.number) → \(.to)"'

Plan journey from A to B

curl -s "https://transport.opendata.ch/v1/connections?from=Zürich&to=Bern&limit=3" | \
  jq -r '.connections[] | "Departure: \(.from.departure[11:16]) | Arrival: \(.to.arrival[11:16]) | Duration: \(.duration[3:]) | Changes: \(.transfers)"'

Get connection details with sections

curl -s "https://transport.opendata.ch/v1/connections?from=Zürich%20HB&to=Bern&limit=1" | \
  jq '.connections[0].sections[] | {from: .departure.station.name, to: .arrival.station.name, departure: .departure.departure, arrival: .arrival.arrival, transport: .journey.category, line: .journey.number}'

API Endpoints

/v1/locations - Search stations

curl "https://transport.opendata.ch/v1/locations?query=<station-name>"

Parameters:

  • query (required): Station name to search
  • type (optional): Filter by type (station, address, poi)

/v1/stationboard - Departure board

curl "https://transport.opendata.ch/v1/stationboard?station=<station>&limit=<number>"

Parameters:

  • station (required): Station name or ID
  • limit (optional): Number of results (default 40)
  • transportations[] (optional): Filter by type (ice_tgv_rj, ec_ic, ir, re_d, ship, s_sn_r, bus, cableway, arz_ext, tramway_underground)
  • datetime (optional): Date/time in ISO format

/v1/connections - Journey planner

curl "https://transport.opendata.ch/v1/connections?from=<start>&to=<destination>&limit=<number>"

Parameters:

  • from (required): Starting station
  • to (required): Destination station
  • via[] (optional): Intermediate station(s)
  • date (optional): Date (YYYY-MM-DD)
  • time (optional): Time (HH:MM)
  • isArrivalTime (optional): 0 (departure, default) or 1 (arrival)
  • limit (optional): Number of connections (max 16)

Helper Script

Use scripts/journey.py for formatted journey planning:

python3 scripts/journey.py "Zürich HB" "Bern"
python3 scripts/journey.py "Basel" "Lugano" --limit 5

Notes

  • All times are in Swiss local time (CET/CEST)
  • Station names support autocomplete (e.g., "Zürich" finds "Zürich HB")
  • API returns JSON by default
  • No API key required
  • Real-time data includes delays and platform changes

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 15:55 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 714 📥 244,036
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,362 📥 318,826
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,059 📥 797,982