anachb

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

VOR AnachB - Austrian Public Transport API

VOR AnachB - 奥地利公共交通API

Query Austrian public transport for real-time departures, route planning, and service disruptions using the HAFAS API.
通过HAFAS API查询奥地利公共交通的实时发车信息、路线规划以及服务中断情况。

Quick Reference

快速参考

ScriptPurpose
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

脚本用途
search.sh
按名称搜索站点
departures.sh
查询站点的实时发车信息
route.sh
规划两地间的行程
disruptions.sh
查询当前服务中断情况
API: HAFAS(Hacon Fahrplan-Auskunfts-System)
端点:
https://vao.demo.hafas.de/gate

1. Search Stations/Stops

1. 搜索站点

Find station IDs by name:
bash
./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)

按名称查找站点ID:
bash
./search.sh "Stephansplatz"
./search.sh "Wien Hauptbahnhof"
./search.sh "Linz"
./search.sh "Salzburg Hbf"
返回站点名称、ID(extId)和坐标。
响应字段:
  • name
    : 站点名称
  • extId
    : 用于其他查询的站点ID
  • type
    : S(车站)、A(地址)、P(兴趣点)
  • coordinates
    : WGS84坐标(格式为1e-6的经纬度)

2. Real-Time Departures

2. 实时发车信息

Get next departures from a station:
bash
./departures.sh <station-id> [count]
获取站点的下一班发车信息:
bash
./departures.sh <station-id> [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

---
./departures.sh 490132000 # 维也纳斯蒂芬广场,10条发车信息 ./departures.sh 490132000 20 # 维也纳斯蒂芬广场,20条发车信息 ./departures.sh 490060200 # 维也纳火车总站 ./departures.sh 444130000 # 林茨火车总站 ./departures.sh 455000100 # 萨尔茨堡火车总站

**响应字段:**
- `line`: 线路名称(U1、S1、RJ等)
- `direction`: 最终目的地
- `departure`: 计划发车时间
- `delay`: 延误时长(分钟,如有)
- `platform`: 站台/轨道编号

---

3. Route Planning

3. 路线规划

Plan a trip between two stations:
bash
./route.sh <from-id> <to-id> [results]
规划两个站点之间的行程:
bash
./route.sh <from-id> <to-id> [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

---
./route.sh 490132000 490060200 # 斯蒂芬广场 → 火车总站 ./route.sh 490132000 444130000 5 # 维也纳 → 林茨,5条结果 ./route.sh "Graz Hbf" "Wien Hbf" # 按名称搜索(速度较慢)

**响应字段:**
- `departure`: 发车时间
- `arrival`: 到达时间
- `duration`: 行程时长
- `changes`: 换乘次数
- `legs`: 包含线路信息的行程分段数组

---

4. Disruptions

4. 服务中断情况

Check current service disruptions:
bash
./disruptions.sh [category]
查询当前服务中断情况:
bash
./disruptions.sh [category]

Examples:

示例:

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

---
./disruptions.sh # 所有中断情况 ./disruptions.sh TRAIN # 仅火车服务中断 ./disruptions.sh BUS # 仅公交服务中断

---

Common Station IDs

常用站点ID

StationID
Wien Stephansplatz490132000
Wien Hauptbahnhof490134900
Wien Westbahnhof490024300
Wien Praterstern490056100
Wien Karlsplatz490024600
Wien Schwedenplatz490119500
Linz Hbf444116400
Salzburg Hbf455000200
Graz Hbf460086000
Innsbruck Hbf481070100
Klagenfurt Hbf492019500
St. Pölten Hbf431543300
Wiener Neustadt Hbf430521000
Krems a.d. Donau431046400
Tip: Always use
./search.sh
to find the correct station ID.

站点ID
维也纳斯蒂芬广场490132000
维也纳火车总站490134900
维也纳西站490024300
维也纳普拉特门站490056100
维也纳卡尔广场站490024600
维也纳瑞典广场站490119500
林茨火车总站444116400
萨尔茨堡火车总站455000200
格拉茨火车总站460086000
因斯布鲁克火车总站481070100
克拉根福火车总站492019500
圣珀尔滕火车总站431543300
维也纳新城火车总站430521000
多瑙河畔克雷姆斯站431046400
提示: 请始终使用
./search.sh
查找正确的站点ID。

Transport Types

交通类型

CodeType
ICE/RJ/RJXHigh-speed trains
IC/ECInterCity/EuroCity
REX/RRegional Express/Regional
SS-Bahn (suburban rail)
UU-Bahn (Vienna metro)
STRTram/Straßenbahn
BUSBus
ASTDemand-responsive transport

代码类型
ICE/RJ/RJX高速列车
IC/EC城际列车/欧洲城际列车
REX/R区域特快/区域列车
SS-Bahn(市郊铁路)
UU-Bahn(维也纳地铁)
STR有轨电车/Straßenbahn
BUS公交
AST响应式需求交通

API Details (for advanced usage)

API详情(高级用法)

The scripts use the HAFAS JSON API. For custom queries:
bash
curl -s -X POST "https://vao.demo.hafas.de/gate" \
  -H "Content-Type: application/json" \
  -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

脚本使用HAFAS JSON API。如需自定义查询:
bash
curl -s -X POST "https://vao.demo.hafas.de/gate" \
  -H "Content-Type: application/json" \
  -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"}
  }'
可用方法:
  • LocMatch
    - 地点/站点搜索
  • StationBoard
    - 发车/到达信息
  • TripSearch
    - 路线规划
  • HimSearch
    - 中断情况/服务消息
  • JourneyDetails
    - 特定行程详情

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.).
  1. 先查找站点ID: 在查询发车信息或路线前,请始终使用
    search.sh
    查找正确的站点ID。
  2. 车站 vs 站点: 大型车站有多个站台,主车站ID覆盖所有站台。
  3. 实时数据: 发车信息包含可用的实时延误数据。
  4. 覆盖全奥地利: 该API覆盖全奥地利的公共交通,而非仅维也纳。
  5. 跨境路线: 部分路线延伸至邻国(德国、捷克共和国等)。