Skill: hjanuschka/wienerlinien (version 1.0.0)

--- name: wienerlinien description: Vienna public transport (Wiener Linien) real-time data. Use when asking about departures, schedules, disruptions, elevator status, or directions in Vienna's public transport (U-Bahn, tram, bus, night bus). Queries stops, lines, and traffic info. --- # Wiener Linien Real-Time API Query Vienna's public transport for real-time departures, disruptions, elevator outages, and service information. ## Quick Reference | Endpoint | Purpose | |----------|---------| | `/monitor` | Real-time departures at a stop | | `/trafficInfoList` | All current disruptions | | `/trafficInfo` | Specific disruption details | | `/newsList` | Service news & elevator maintenance | **Base URL:** `https://www.wienerlinien.at/ogd_realtime` --- ## Finding Stop IDs Stops are identified by **RBL numbers** (Rechnergestütztes Betriebsleitsystem). Use the reference data: ```bash # Search stops by name curl -s "https://www.wienerlinien.at/ogd_realtime/doku/ogd/wienerlinien-ogd-haltepunkte.csv" | grep -i "stephansplatz" # Format: StopID;DIVA;StopText;Municipality;MunicipalityID;Longitude;Latitude ``` **Common Stop IDs (RBL):** | Stop | RBL IDs | Lines | |------|---------|-------| | 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, Trams | --- ## 1. Real-Time Departures (`/monitor`) Get next departures at one or more stops. ### Request ```bash # Single stop curl -s "https://www.wienerlinien.at/ogd_realtime/monitor?stopId=252" # Multiple stops curl -s "https://www.wienerlinien.at/ogd_realtime/monitor?stopId=252&stopId=4116" # With disruption info curl -s "https://www.wienerlinien.at/ogd_realtime/monitor?stopId=252&activateTrafficInfo=stoerungkurz&activateTrafficInfo=stoerunglang&activateTrafficInfo=aufzugsinfo" ``` ### Parameters | Param | Required | Description | |-------|----------|-------------| | `stopId` | Yes (1-n) | RBL stop ID(s) | | `activateTrafficInfo` | No | Include disruptions: `stoerungkurz`, `stoerunglang`, `aufzugsinfo` | | `aArea` | No | `1` = include all platforms with same DIVA number | ### Response Structure ```json { "data": { "monitors": [{ "locationStop": { "properties": { "name": "60201234", // DIVA number "title": "Stephansplatz", // Stop name "attributes": { "rbl": 252 } }, "geometry": { "coordinates": [16.3726, 48.2085] // lon, lat (WGS84) } }, "lines": [{ "name": "U1", "towards": "Leopoldau", "direction": "H", // H=hin, R=retour "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 // minutes until departure } }] } }] }] }, "message": { "value": "OK", "messageCode": 1 } } ``` ### Key Fields | Field | Description | |-------|-------------| | `countdown` | Minutes until departure | | `timePlanned` | Scheduled departure | | `timeReal` | Real-time prediction (if available) | | `barrierFree` | Wheelchair accessible | | `trafficjam` | Traffic jam affecting arrival | | `type` | `ptMetro`, `ptTram`, `ptBusCity`, `ptBusNight` | --- ## 2. Disruptions (`/trafficInfoList`) Get all current service disruptions. ### Request ```bash # All disruptions curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList" # Filter by line curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList?relatedLine=U3&relatedLine=U6" # Filter by stop curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList?relatedStop=252" # Filter by type curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList?name=aufzugsinfo" ``` ### Parameters | Param | Description | |-------|-------------| | `relatedLine` | Line name (U1, 13A, etc.) - can repeat | | `relatedStop` | RBL stop ID - can repeat | | `name` | Category: `stoerunglang`, `stoerungkurz`, `aufzugsinfo`, `fahrtreppeninfo` | ### Response ```json { "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" }] } } ``` ### Disruption Categories | Name | Description | |------|-------------| | `stoerunglang` | Long-term disruptions | | `stoerungkurz` | Short-term disruptions | | `aufzugsinfo` | Elevator outages | | `fahrtreppeninfo` | Escalator outages | --- ## 3. Specific Disruption (`/trafficInfo`) Get details for a specific disruption by name. ```bash curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfo?name=eD_265&name=eD_37" ``` --- ## 4. Service News (`/newsList`) Planned maintenance, elevator service windows, news. ```bash # All news curl -s "https://www.wienerlinien.at/ogd_realtime/newsList" # Filter by line/stop/category curl -s "https://www.wienerlinien.at/ogd_realtime/newsList?relatedLine=U6&name=aufzugsservice" ``` ### Categories | Name | Description | |------|-------------| | `aufzugsservice` | Planned elevator maintenance | | `news` | General service news | --- ## Reference Data (CSV) ### Stops (Haltepunkte) - Primary ```bash curl -s "https://www.wienerlinien.at/ogd_realtime/doku/ogd/wienerlinien-ogd-haltepunkte.csv" # StopID;DIVA;StopText;Municipality;MunicipalityID;Longitude;Latitude ``` **StopID is the RBL number used in API calls.** ### Stations (Haltestellen) ```bash curl -s "https://www.wienerlinien.at/ogd_realtime/doku/ogd/wienerlinien-ogd-haltestellen.csv" # DIVA;PlatformText;Municipality;MunicipalityID;Longitude;Latitude ``` ### Lines ```bash curl -s "https://www.wienerlinien.at/ogd_realtime/doku/ogd/wienerlinien-ogd-linien.csv" # LineID;LineText;SortingHelp;Realtime;MeansOfTransport ``` **MeansOfTransport:** `ptMetro`, `ptTram`, `ptBusCity`, `ptBusNight` --- ## Common Use Cases ### "When is the next U1 from Stephansplatz?" ```bash # Stephansplatz U1 platform 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]}' ``` ### "Are there any U-Bahn disruptions?" ```bash 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}' ``` ### "Which elevators are out of service?" ```bash curl -s "https://www.wienerlinien.at/ogd_realtime/trafficInfoList?name=aufzugsinfo" | jq '.data.trafficInfos[] | {station: .attributes.station, location: .attributes.location, status: .attributes.status}' ``` ### "Departures from Karlsplatz with all disruption info" ```bash curl -s "https://www.wienerlinien.at/ogd_realtime/monitor?stopId=143&stopId=144&stopId=4101&stopId=4102&activateTrafficInfo=stoerungkurz&activateTrafficInfo=stoerunglang&activateTrafficInfo=aufzugsinfo" ``` --- ## Error Codes | Code | Meaning | |------|---------| | 311 | Database unavailable | | 312 | Stop does not exist | | 316 | Rate limit exceeded | | 320 | Invalid query parameter | | 321 | Missing required parameter | | 322 | No data in database | --- ## Vehicle Types | Type | Description | |------|-------------| | `ptMetro` | U-Bahn | | `ptTram` | Straßenbahn | | `ptBusCity` | City bus | | `ptBusNight` | Night bus (N lines) | --- ## Tips 1. **Multiple platforms**: A single station may have multiple RBL IDs (one per platform/direction). Query all for complete departures. 2. **Real-time availability**: Check `realtimeSupported` - some lines only have scheduled times. 3. **Countdown vs timeReal**: Use `countdown` for display, `timeReal` for precise timing. 4. **Barrier-free routing**: Filter by `barrierFree: true` for wheelchair users. 5. **Find stop IDs**: Search the CSV files by station name, then use the StopID as `stopId` parameter.

path: README.md
content: # Wiener Linien Skill

A skill for querying Vienna's public transport (Wiener Linien) real-time data including departures, disruptions, and elevator status.

## Overview

This skill provides tools to access Wiener Linien's real-time API for:
- **Real-time departures** at any stop
- **Service disruptions** (short-term and long-term)
- **Elevator outages** at U-Bahn stations
- **Stop search** by name to find RBL stop IDs

## Scripts

### `search-stop.sh` - Find Stop IDs

Search for stops by name to get their RBL (stop) IDs needed for departure queries.

```bash
./search-stop.sh stephansplatz
./search-stop.sh kagran
```

### `departures.sh` - Real-Time Departures

Get next departures from one or more stops. Supports multiple stop IDs for stations with multiple platforms.

```bash
./departures.sh 252              # Single stop
./departures.sh 252 4116 4119    # Multiple platforms (Stephansplatz)
```

### `disruptions.sh` - Service Disruptions

Get current disruptions, optionally filtered by line.

```bash
./disruptions.sh                 # All disruptions
./disruptions.sh U1 U3           # Only U1 and U3
./disruptions.sh 27A             # Specific bus line
```

### `elevators.sh` - Elevator Outages

Get elevator outages at stations, optionally filtered by line.

```bash
./elevators.sh                   # All elevator outages
./elevators.sh U6                # U6 stations only
```

## Common Stop IDs (RBL)

| Stop | RBL IDs | Lines |
|------|---------|-------|
| 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, Trams |

## API Reference

See [SKILL.md](SKILL.md) for complete API documentation including:
- Full endpoint specifications
- Response structures
- Error codes
- Reference data (CSV downloads)

## Requirements

- `curl` - HTTP requests
- `jq` - JSON parsing

## License

Uses Wiener Linien Open Data: https://www.wienerlinien.at/open-data


path: departures.sh
content: #!/bin/bash
# Get real-time departures from a Wiener Linien stop
# Usage: ./departures.sh <stop-id> [stop-id2] [stop-id3] ...
#
# Example: ./departures.sh 252 4116  (Stephansplatz platforms)

if [ -z "$1" ]; then
    echo "Usage: $0 <stop-id> [stop-id2] ..."
    echo ""
    echo "Find stop IDs with: ./search-stop.sh <name>"
    echo "Example: $0 252 4116"
    exit 1
fi

# Build stopId query params
PARAMS=""
for STOP_ID in "$@"; do
    PARAMS="${PARAMS}&stopId=${STOP_ID}"
done
# Remove leading &
PARAMS="${PARAMS:1}"

# Include all traffic info
URL="https://www.wienerlinien.at/ogd_realtime/monitor?${PARAMS}&activateTrafficInfo=stoerungkurz&activateTrafficInfo=stoerunglang&activateTrafficInfo=aufzugsinfo"

curl -s "$URL" | jq '
  .data.monitors[] | {
    stop: .locationStop.properties.title,
    rbl: .locationStop.properties.attributes.rbl,
    lines: [
      .lines[] | {
        line: .name,
        towards: .towards,
        type: .type,
        barrierFree: .barrierFree,
        nextDepartures: [.departures.departure[:5][] | {
          countdown: .departureTime.countdown,
          planned: .departureTime.timePlanned,
          real: .departureTime.timeReal
        }]
      }
    ]
  }
'


path: disruptions.sh
content: #!/bin/bash
# Get current Wiener Linien disruptions
# Usage: ./disruptions.sh [line1] [line2] ...
#
# Example: ./disruptions.sh           (all disruptions)
# Example: ./disruptions.sh U1 U3     (U1 and U3 only)

# Build relatedLine query params
PARAMS=""
for LINE in "$@"; do
    PARAMS="${PARAMS}&relatedLine=${LINE}"
done

if [ -n "$PARAMS" ]; then
    # Remove leading &
    PARAMS="${PARAMS:1}"
    URL="https://www.wienerlinien.at/ogd_realtime/trafficInfoList?${PARAMS}"
else
    URL="https://www.wienerlinien.at/ogd_realtime/trafficInfoList"
fi

curl -s "$URL" | jq '
  .data.trafficInfos // [] | map({
    title: .title,
    description: .description,
    lines: .relatedLines,
    category: (
      if .refTrafficInfoCategoryId == 1 then "Elevator"
      elif .refTrafficInfoCategoryId == 2 then "Long disruption"
      elif .refTrafficInfoCategoryId == 3 then "Short disruption"
      else "Other"
      end
    ),
    time: .time,
    station: .attributes.station,
    status: .attributes.status
  })
'


path: elevators.sh
content: #!/bin/bash
# Get elevator outages at Wiener Linien stations
# Usage: ./elevators.sh [line]
#
# Example: ./elevators.sh       (all elevator outages)
# Example: ./elevators.sh U6    (U6 only)

if [ -n "$1" ]; then
    URL="https://www.wienerlinien.at/ogd_realtime/trafficInfoList?name=aufzugsinfo&relatedLine=$1"
else
    URL="https://www.wienerlinien.at/ogd_realtime/trafficInfoList?name=aufzugsinfo"
fi

curl -s "$URL" | jq '
  .data.trafficInfos // [] | map({
    station: .attributes.station,
    location: .attributes.location,
    status: .attributes.status,
    reason: .attributes.reason,
    lines: .relatedLines,
    towards: .attributes.towards
  })
'


path: search-stop.sh
content: #!/bin/bash
# Search Wiener Linien stops by name
# Usage: ./search-stop.sh <name>
#
# Returns: StopID (RBL), DIVA, StopText, Longitude, Latitude

QUERY="${1:-}"

if [ -z "$QUERY" ]; then
    echo "Usage: $0 <stop-name>"
    echo "Example: $0 stephansplatz"
    exit 1
fi

echo "Searching for stops matching: $QUERY"
echo "---"
echo "StopID;DIVA;StopText;Municipality;Longitude;Latitude"
curl -s "https://www.wienerlinien.at/ogd_realtime/doku/ogd/wienerlinien-ogd-haltepunkte.csv" | grep -i "$QUERY" | head -20


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)