VOR AnachB: 奥地利公共交通 API 集成 - Openclaw Skills

作者:互联网

2026-03-24

AI教程

什么是 奥地利公共交通 (VOR AnachB)?

此技能为 VOR AnachB(奥地利东部运输联运)系统提供了强大的接口,覆盖了奥地利整个公共交通网络。通过利用 HAFAS (Hacon Fahrplan-Auskunfts-System) API,开发者可以通过 Openclaw Skills 将火车、巴士、电车和地铁服务的实时数据直接集成到他们的 AI 工作流中。

该技能使智能体能够执行复杂的交通任务,例如查找唯一的站点 ID、规划城市之间的多模式出行以及监控实时延迟。它是构建针对奥地利地区的旅游助手、物流工具或通勤自动化脚本的重要工具。

下载入口:https://github.com/openclaw/skills/tree/main/skills/manmal/a-nach-b

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install a-nach-b

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 a-nach-b。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

奥地利公共交通 (VOR AnachB) 应用场景

  • 为任何奥地利交通枢纽或本地站点识别唯一的站点 ID (extId)。
  • 获取维也纳中央火车站或萨尔茨堡中央火车站等站点的实时出发时刻表及延迟信息。
  • 规划两个地点之间的详细行程,包括中转点和时长。
  • 监控铁路、巴士或电车等不同交通类别的活动服务中断。
  • 开发需要精确奥地利交通时刻表的位置感知应用。
奥地利公共交通 (VOR AnachB) 工作原理
  1. 用户或智能体使用地点名称启动搜索,从 HAFAS 数据库中检索特定的站点 ID。
  2. 智能体使用站点 ID 调用特定脚本来获取实时出发数据或服务中断警报。
  3. 对于路线规划,技能处理起点和终点 ID 以生成旅行方案列表,包括每一段行程详情。
  4. 所有请求都格式化为 JSON 并发送到 HAFAS 端点,确保将高保真数据返回到 Openclaw Skills 进行进一步处理。

奥地利公共交通 (VOR AnachB) 配置指南

要集成此技能,请确保 Shell 脚本在您的环境中可用并具有执行权限。在 Openclaw Skills 内使用演示端点不需要专门的 API 密钥。

# 使脚本可执行
chmod +x search.sh departures.sh route.sh disruptions.sh

# 通过搜索站点测试设置
./search.sh "Stephansplatz"

奥地利公共交通 (VOR AnachB) 数据架构与分类体系

该技能将公共交通数据组织成结构化的 JSON 响应。关键实体包括:

实体 关键字段
站点 name, extId (站点 ID), coordinates (WGS84), type
出发 line (U1, S1, RJ), direction, departure (时间), delay, platform
行程/路线 duration, changes, legs (包含线路信息的航段数组)
中断 category (TRAIN, BUS 等), message, priority
name: anachb
description: Austrian public transport (VOR AnachB) for all of Austria. Query real-time departures, search stations/stops, plan routes between locations, and check service disruptions. Use when asking about Austrian trains, buses, trams, metro (U-Bahn), or directions involving public transport in Austria.

VOR AnachB - Austrian Public Transport API

Query Austrian public transport for real-time departures, route planning, and service disruptions using the HAFAS API.

Quick Reference

Script Purpose
search.sh Find stations/stops by name
departures.sh Real-time departures at a station
route.sh Plan a trip between two locations
disruptions.sh Current service disruptions

API: HAFAS (Hacon Fahrplan-Auskunfts-System)
Endpoint: https://vao.demo.hafas.de/gate


1. Search Stations/Stops

Find station IDs by name:

./search.sh "Stephansplatz"
./search.sh "Wien Hauptbahnhof"
./search.sh "Linz"
./search.sh "Salzburg Hbf"

Returns station names, IDs (extId), and coordinates.

Response fields:

  • name: Station name
  • extId: Station ID for use in other queries
  • type: S (Station), A (Address), P (POI)
  • coordinates: WGS84 coordinates (lon/lat in 1e-6 format)

2. Real-Time Departures

Get next departures from a station:

./departures.sh  [count]

# Examples:
./departures.sh 490132000        # Wien Stephansplatz, 10 departures
./departures.sh 490132000 20     # Wien Stephansplatz, 20 departures
./departures.sh 490060200        # Wien Hauptbahnhof
./departures.sh 444130000        # Linz Hbf
./departures.sh 455000100        # Salzburg Hbf

Response fields:

  • line: Line name (U1, S1, RJ, etc.)
  • direction: Final destination
  • departure: Scheduled departure time
  • delay: Delay in minutes (if any)
  • platform: Platform/track number

3. Route Planning

Plan a trip between two stations:

./route.sh   [results]

# Examples:
./route.sh 490132000 490060200        # Stephansplatz → Hauptbahnhof
./route.sh 490132000 444130000 5      # Wien → Linz, 5 results
./route.sh "Graz Hbf" "Wien Hbf"      # Search by name (slower)

Response fields:

  • departure: Departure time
  • arrival: Arrival time
  • duration: Trip duration
  • changes: Number of transfers
  • legs: Array of trip segments with line info

4. Disruptions

Check current service disruptions:

./disruptions.sh [category]

# Examples:
./disruptions.sh            # All disruptions
./disruptions.sh TRAIN      # Train disruptions only
./disruptions.sh BUS        # Bus disruptions only

Common Station IDs

Station ID
Wien Stephansplatz 490132000
Wien Hauptbahnhof 490134900
Wien Westbahnhof 490024300
Wien Praterstern 490056100
Wien Karlsplatz 490024600
Wien Schwedenplatz 490119500
Linz Hbf 444116400
Salzburg Hbf 455000200
Graz Hbf 460086000
Innsbruck Hbf 481070100
Klagenfurt Hbf 492019500
St. P?lten Hbf 431543300
Wiener Neustadt Hbf 430521000
Krems a.d. Donau 431046400

Tip: Always use ./search.sh to find the correct station ID.


Transport Types

Code Type
ICE/RJ/RJX High-speed trains
IC/EC InterCity/EuroCity
REX/R Regional Express/Regional
S S-Bahn (suburban rail)
U U-Bahn (Vienna metro)
STR Tram/Stra?enbahn
BUS Bus
AST Demand-responsive transport

API Details (for advanced usage)

The scripts use the HAFAS JSON API. For custom queries:

curl -s -X POST "https://vao.demo.hafas.de/gate" r
  -H "Content-Type: application/json" r
  -d '{
    "svcReqL": [{
      "req": { ... },
      "meth": "METHOD_NAME",
      "id": "1|1|"
    }],
    "client": {"id": "VAO", "v": "1", "type": "AND", "name": "nextgen"},
    "ver": "1.73",
    "lang": "de",
    "auth": {"aid": "nextgen", "type": "AID"}
  }'

Available methods:

  • LocMatch - Location/station search
  • StationBoard - Departures/arrivals
  • TripSearch - Route planning
  • HimSearch - Disruptions/service messages
  • JourneyDetails - Details of a specific journey

Tips

  1. Find station IDs first: Always use search.sh to find the correct station ID before querying departures or routes.

  2. Station vs Stop: Major stations have multiple platforms - the main station ID covers all platforms.

  3. Real-time data: Departures include real-time delays when available.

  4. Austria-wide: This API covers all Austrian public transport, not just Vienna.

  5. Cross-border: Some routes extend to neighboring countries (Germany, Czech Republic, etc.).