微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🚇

柏林实时公交路线智能规划

bvg-route · vv0.0.2
专业技能 安全 S 级 作者 jaysonsantos 公开目录收录
1k 下载 227 安装 4.7k 收藏 4.5k 浏览

简介

基于BVG官方API的柏林公共交通规划工具,提供实时准确的地铁、公交、火车换乘方案,助力高效出行。

原始描述

Route planning for Berlin public transport (BVG) using the v6.bvg.transport.rest API. Use when the user asks for: (1) route suggestions between two addresses or stops, (2) live next-departure info for a stop, (3) arrival-time–based journey planning (arrive-by or depart-at). Supports outputting 2–3 options ranked by travel time, transfers, and walking, and returning step-by-step directions and refresh tokens for live updates.

通过你的 Agent 添加

安装目录:bvg-route/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/bvg-route/
Codex CLI~/.codex/skills/bvg-route/
DeepSeek Harness~/.agents/skills/bvg-route/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心功能

BVG Route Planner 是专为柏林都市圈打造的公共交通路线规划工具,基于 v6.bvg.transport.rest 官方开放 API 构建,提供三大核心能力:

  1. 智能路线规划:支持「出发地→目的地」多方案对比,自动计算最快路径、最少换乘、最短步行三种策略,返回 2-3 条可选路线及预计到达时间。
  2. 实时到站查询:输入站点名称即可获取最近 20 分钟内 U-Bahn、S-Bahn、公交、电车的实时到站信息,含延误预警。
  3. 时间约束规划:支持「最晚到达时间」(arrive-by)和「指定出发时间」(depart-at)两种模式,满足通勤、约会等准时性需求。

显著优点

  • 数据权威性:直连柏林公共交通公司(BVG)官方 API,非第三方爬虫,数据实时性、准确性有保障
  • 覆盖完整:涵盖柏林-勃兰登堡全区域的 U-Bahn、S-Bahn、区域列车、公交、电车、夜间线路
  • 细节丰富:提供站台编号、步行距离/时间、换乘等待时长、线路终点方向等实用信息
  • 零配置使用:无需注册账号或 API Key,开箱即用
  • 刷新机制:支持 journey refreshToken,可持续追踪实时延误变化

局限性与注意事项

  • 地理范围限定:仅支持柏林及周边 VBB 区域,德国其他城市或国际路线无法查询
  • API 依赖风险:v6.bvg.transport.rest 为社区维护的非官方接口(非 BVG 直属),存在服务变更或限流可能
  • 无离线能力:需持续联网,地铁站内信号弱时体验下降
  • 语言局限:API 返回数据主要为德语(站点名、线路名),英文用户需适应
  • 高峰期限流:官方建议速率约 100 req/min,高频调用可能触发限流

适合人群

用户类型 使用场景
柏林新居民/留学生 熟悉线路网络,规划日常通勤
短期游客 查询机场→市区、景点间路线
准时通勤族 arrive-by 模式确保不迟到
夜生活人群 查询 Nachtbus 夜间线路时刻

常规风险提示

  • 隐私安全:本 Skill 不收集用户位置或行程数据,但 API 调用会暴露 IP 至 v6.bvg.transport.rest 服务器
  • 数据时效:实时数据依赖 BVG 系统更新,极端天气或突发事件时可能存在延迟
  • 站点名称模糊匹配:建议优先使用准确站名(如 "U Alexanderplatz" 而非 "Alex"),或先用 /locations 查询确认 ID

技术实现亮点:Skill 采用纯 Markdown 文档(T-MD 分类),无可执行代码,通过标准化的 API 调用规范确保安全性,获 CLS S 级安全认证。

技能正文


name: bvg-route description: "Route planning for Berlin public transport (BVG) using the v6.bvg.transport.rest API. Use when the user asks for: (1) route suggestions between two addresses or stops, (2) live next-departure info for a stop, (3) arrival-time–based journey planning (arrive-by or depart-at). Supports outputting 2–3 options ranked by travel time, transfers, and walking, and returning step-by-step directions and refresh tokens for live updates."

BVG Route Planner Skill

Purpose

  • Provide concise, actionable public-transport directions in Berlin using the v6.bvg.transport.rest API.

When to use

  • User asks for directions between two places in Berlin (addresses, stop names, or coordinates).
  • User asks for next departures from a stop/station.
  • User requests to arrive by a specific time (arrive-by) or depart at a specific time.

Core behavior

  1. Resolve from and to into either stop IDs (preferred) or address/POI objects using GET /locations or /locations/nearby.
  2. Call GET /journeys with arrival or departure parameter as requested, request results=3 and stopovers=true to construct step-by-step legs.
  3. Format 2–3 options: show total travel time, number of transfers, walking time, and estimated departure/arrival times.
  4. Provide step-by-step instructions for the selected journey: walk to stop A (distance/time), take line X toward Y, get off at stop B (platform if available), final walk to destination.
  5. When appropriate, include the journey refreshToken and a GET /journeys/:ref refresh step to update realtime delays.
  6. For simple next-departure queries, use GET /stops/:id/departures with duration=20 (or configurable) and return the nearest 3 departures.

Outputs

  • Human-readable routes with departure times, transfers, walking distances, estimated arrival, and concise step list.
  • Machine-friendly JSON (optional) containing journey id, refreshToken, legs, and stop IDs for programmatic refreshes.

References

Examples (triggers)

  • "How do I get from Invalidenstraße 43 10115 to Leibnizstraße 62 by public transport?"
  • "When is the next U-Bahn from U Rosenthaler Platz?"
  • "Find journeys that arrive at Deutsche Oper by 17:50 tonight, fastest option first."

Notes for implementers

  • IBNR format (CRITICAL): The /journeys endpoint requires base IBNR codes only (6 digits), not the full ID with :: suffixes.
    • ❌ Wrong: de:11000:900110001::3 or de:11000:900110001
    • ✅ Correct: 900110001 (extract base 6-digit code from /stops results)
    • Process: Call /stops?query=... first, extract the 6-digit id from results, use that for /journeys.
  • URL encoding (CRITICAL): All query string parameters must be properly URL-encoded using urllib.parse.quote() or equivalent. Examples:
    • Space → %20
    • ö → %C3%B6
    • ü → %C3%BC
    • Ä → %C3%84
    • Special chars like &, ?, # → their percent-encoded equivalents
    • Example: Schönhauser Allee → Sch%C3%B6nhauser%20Allee
    • Every API call with address/stop name strings in query params must encode before building the URL.
  • Prefer stop/station IDs when calling /journeys (more reliable than fuzzy names): Use /stops?query=... to resolve names → base IBNR.
  • Use stopovers=true to build readable step lists; include entrances=true when walking-to-entrance accuracy is important.
  • Request results=3 then offer the top 2–3 to the user.
  • Handle timezone-aware ISO datetimes; default to Europe/Berlin if none provided.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

apitravelberlinpublic-transportautomation

同类 Skill