名称: wienerlinien
描述: 维也纳公共交通(Wiener Linien)实时数据。适用于查询维也纳公共交通(地铁、有轨电车、公交车、夜班车)的发车时间、时刻表、运营中断、电梯状态或路线信息。可查询站点、线路和交通信息。
查询维也纳公共交通的实时发车信息、运营中断、电梯停运和服务公告。
| 端点 | 用途 |
|---|---|
/monitor |
站点实时发车信息 |
/trafficInfoList |
所有当前运营中断信息 |
/trafficInfo |
特定运营中断详情 |
/newsList |
服务新闻与电梯维护信息 |
基础 URL: https://www.wienerlinien.at/ogd_realtime
站点通过 RBL 编号(计算机辅助运营系统)识别。请使用以下参考数据:
# 按名称搜索站点
curl -s "https://www.wienerlinien.at/ogd_realtime/doku/ogd/wienerlinien-ogd-haltepunkte.csv" | grep -i "stephansplatz"
# 格式:StopID;DIVA;StopText;Municipality;MunicipalityID;Longitude;Latitude
常用站点 ID (RBL):
| 站点 | RBL ID | 线路 |
|---|---|---|
| Stephansplatz | 252, 4116, 4119 | U1, U3 |
| Karlsplatz | 143, 144, 4101, 4102 | U1, U2, U4 |
| Westbahnhof | 1346, 1350, 1368 | U3, U6 |
| Praterstern | 4205, 4210 | U1, U2 |
| Schwedenplatz | 1489, 1490, 4103 | U1, U4 |
| Schottentor | 40, 41, 4118 | U2, 有轨电车 |
/monitor)获取一个或多个站点的下一班发车信息。
# 单个站点
curl -s "https://www.wienerlinien.at/ogd_realtime/monitor?stopId=252"
# 多个站点
curl -s "https://www.wienerlinien.at/ogd_realtime/monitor?stopId=252&stopId=4116"
# 包含运营中断信息
curl -s "https://www.wienerlinien.at/ogd_realtime/monitor?stopId=252&activateTrafficInfo=stoerungkurz&activateTrafficInfo=stoerunglang&activateTrafficInfo=aufzugsinfo"
| 参数 | 是否必需 | 描述 |
|---|---|---|
stopId |
是 (1-n) | RBL 站点 ID(可多个) |
activateTrafficInfo |
否 | 包含的运营中断类型:stoerungkurz(短期中断)、stoerunglang(长期中断)、aufzugsinfo(电梯信息) |
aArea |
否 | 1 = 包含所有具有相同 DIVA 编号的站台 |
{
"data": {
"monitors": [{
"locationStop": {
"properties": {
"name": "60201234", // DIVA 编号
"title": "Stephansplatz", // 站点名称
"attributes": { "rbl": 252 }
},
"geometry": {
"coordinates": [16.3726, 48.2085] // 经度, 纬度 (WGS84)
}
},
"lines": [{
"name": "U1",
"towards": "Leopoldau",
"direction": "H", // H=去程, R=回程
"type": "ptMetro",
"barrierFree": true,
"realtimeSupported": true,
"trafficjam": false,
"departures": {
"departure": [{
"departureTime": {
"timePlanned": "2025-01-08T19:30:00.000+0100",
"timeReal": "2025-01-08T19:31:30.000+0100",
"countdown": 3 // 距离发车的分钟数
}
}]
}
}]
}]
},
"message": { "value": "OK", "messageCode": 1 }
}
| 字段 | 描述 |
|---|---|
countdown |
距离发车的分钟数 |
timePlanned |
计划发车时间 |
timeReal |
实时预测发车时间(如可用) |
barrierFree |
是否无障碍通行(轮椅可通行) |
trafficjam |
是否受交通拥堵影响 |
type |
车辆类型:ptMetro(地铁)、ptTram(有轨电车)、ptBusCity(城市公交)、ptBusNight(夜班公交) |
/trafficInfoList)获取所有当前的服务中断信息。
# 所有中断
curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList"
# 按线路筛选
curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList?relatedLine=U3&relatedLine=U6"
# 按站点筛选
curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList?relatedStop=252"
# 按类型筛选
curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList?name=aufzugsinfo"
| 参数 | 描述 |
|---|---|
relatedLine |
线路名称(如 U1, 13A 等)- 可重复 |
relatedStop |
RBL 站点 ID - 可重复 |
name |
类别:stoerunglang(长期中断)、stoerungkurz(短期中断)、aufzugsinfo(电梯信息)、fahrtreppeninfo(自动扶梯信息) |
{
"data": {
"trafficInfos": [{
"name": "eD_23",
"title": "Gumpendorfer Straße",
"description": "U6 Bahnsteig Ri. Siebenhirten - Aufzug außer Betrieb",
"priority": "1",
"time": {
"start": "2025-01-08T06:00:00.000+0100",
"end": "2025-01-08T22:00:00.000+0100"
},
"relatedLines": ["U6"],
"relatedStops": [4611],
"attributes": {
"status": "außer Betrieb",
"station": "Gumpendorfer Straße",
"location": "U6 Bahnsteig Ri. Siebenhirten"
}
}],
"trafficInfoCategories": [{
"id": 1,
"name": "aufzugsinfo",
"title": "Aufzugsstörungen"
}]
}
}
| 名称 | 描述 |
|---|---|
stoerunglang |
长期运营中断 |
stoerungkurz |
短期运营中断 |
aufzugsinfo |
电梯停运信息 |
fahrtreppeninfo |
自动扶梯停运信息 |
/trafficInfo)根据名称获取特定运营中断的详细信息。
curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfo?name=eD_265&name=eD_37"
/newsList)计划维护、电梯服务窗口、新闻公告。
# 所有新闻
curl -s "https://www.wienerlinien.at/ogd_realtime/newsList"
# 按线路/站点/类别筛选
curl -s "https://www.wienerlinien.at/ogd_realtime/newsList?relatedLine=U6&name=aufzugsservice"
| 名称 | 描述 |
|---|---|
aufzugsservice |
计划电梯维护 |
news |
常规服务新闻 |
curl -s "https://www.wienerlinien.at/ogd_realtime/doku/ogd/wienerlinien-ogd-haltepunkte.csv"
# StopID;DIVA;StopText;Municipality;MunicipalityID;Longitude;Latitude
StopID 即为 API 调用中使用的 RBL 编号。
curl -s "https://www.wienerlinien.at/ogd_realtime/doku/ogd/wienerlinien-ogd-haltestellen.csv"
# DIVA;PlatformText;Municipality;MunicipalityID;Longitude;Latitude
curl -s "https://www.wienerlinien.at/ogd_realtime/doku/ogd/wienerlinien-ogd-linien.csv"
# LineID;LineText;SortingHelp;Realtime;MeansOfTransport
MeansOfTransport(交通方式): ptMetro、ptTram、ptBusCity、ptBusNight
# Stephansplatz U1 站台 RBL: 4116
curl -s "https://www.wienerlinien.at/ogd_realtime/monitor?stopId=4116" | jq '.data.monitors[].lines[] | select(.name=="U1") | {line: .name, towards: .towards, departures: [.departures.departure[].departureTime.countdown]}'
curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList?relatedLine=U1&relatedLine=U2&relatedLine=U3&relatedLine=U4&relatedLine=U6" | jq '.data.trafficInfos[] | {title, description, lines: .relatedLines}'
curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList?name=aufzugsinfo" | jq '.data.trafficInfos[] | {station: .attributes.station, location: .attributes.location, status: .attributes.status}'
curl -s "https://www.wienerlinien.at/ogd_realtime/monitor?stopId=143&stopId=144&stopId=4101&stopId=4102&activateTrafficInfo=stoerungkurz&activateTrafficInfo=stoerunglang&activateTrafficInfo=aufzugsinfo"
| 代码 | 含义 |
|---|---|
| 311 | 数据库不可用 |
| 312 | 站点不存在 |
| 316 | 超出速率限制 |
| 320 | 查询参数无效 |
| 321 | 缺少必需参数 |
| 322 | 数据库中无数据 |
| 类型 | 描述 |
|---|---|
ptMetro |
地铁 |
ptTram |
有轨电车 |
ptBusCity |
城市公交 |
ptBusNight |
夜班公交 (N 线路) |
多个站台:一个车站可能有多个 RBL ID(每个方向/站台一个)。查询所有 ID 以获取完整的发车信息。
实时数据可用性:检查 realtimeSupported 字段——部分线路仅提供计划时间。
倒计时与实时时间:使用 countdown 用于显示,使用 timeReal 获取精确时间。
无障碍路线规划:通过 barrierFree: true 筛选,为轮椅使用者提供信息。
查找站点 ID:通过站点名称搜索 CSV 文件,然后使用 StopID 作为 stopId 参数。