BVG (Berliner Verkehrsbetriebe) Route Planner
by @jaysonsantos
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.
clawhub install bvg-route📖 About This Skill
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
When to use
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
References
Examples (triggers)
Notes for implementers
/journeys endpoint requires base IBNR codes only (6 digits), not the full ID with :: suffixes.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.
urllib.parse.quote() or equivalent. Examples:%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.
/stops?query=... to resolve names → base IBNR.stopovers=true to build readable step lists; include entrances=true when walking-to-entrance accuracy is important.results=3 then offer the top 2–3 to the user.