GTFS-RT feeds
HSL provides GTFS-RT feeds for service alerts, trip updates and vehicle positions that complement the static GTFS data.
Note that if you are not using the static GTFS package, you most likely want to use Digitransit APIs which provide the same data in a more ready-to-use format.
Endpoints
The API supports only GET requests to these endpoints. There is are no parameters for filtering data etc.
| Data type | Endpoint |
|---|---|
| Service alerts | https://realtime.hsl.fi/realtime/service-alerts/v2/hsl |
| Trip updates | https://realtime.hsl.fi/realtime/trip-updates/v2/hsl |
| Vehicle positions | https://realtime.hsl.fi/realtime/vehicle-positions/v2/hsl |
Update intervals
GTFS-RT feeds are updated with the following intervals:
| Data type | Update interval |
|---|---|
| Service alerts | 5 minutes and when new alerts are published |
| Trip updates | 15 seconds |
| Vehicle positions | 1 second |
Data format
The feeds are using version 2.0 of GTFS-RT specification. See Google's documentation for more details about GTFS-RT format.
The feeds should conform to the GTFS-RT specification, but there are some HSL-specific implementation details that could be useful to know.
Trip updates
-
Trip IDs are not available
- Combination of
route_id,start_date,start_timeanddirection_idshould be used to uniquely identify trips - This is because trip IDs in the static GTFS feed are not stable and will change when the static feed is regenerated
- Combination of
uncertaintyis set to0for stops which the vehicle has passed
Vehicle positions
- Trip IDs are not available (explained in previous section)
schedule_relationshipis eitherSCHEDULED(default) orADDED(used for buses when there is more than one bus serving the same trip)-
occupancy_statusis only available for vehicles that have passenger counting availableNOT_ACCEPTING_PASSENGERSis never used as a value
-
current_statusdepends on whether the vehicle has HFP events available- If the vehicle has events:
IN_TRANSIT_TOwhen vehicle is traveling to the next stop,INCOMING_ATwhen the vehicle has entered the stop radius (i.e. afterDUEevent),STOPPED_ATwhen the vehicle has stopped to the stop (i.e. afterARSevent) - If the vehicle does not have events: only
IN_TRANSIT_TOandSTOPPED_ATare used.STOPPED_ATis used when the corresponding HFP message contains stop ID, e.g. when the vehicle is close to the stop
- If the vehicle has events:
-
Vehicle
idis in format<operator_id>/<vehicle_id>- Operators are listed in the HFP documentation
Service alerts
-
Each
informed_entitycontains a singleagency_id,route_idorstop_idagency_idis alwaysHSLand is present when the alert affects all HSL traffic
