Reference · built on requestCommons signalTransit, roads & mobility

PTV Timetable API

Timetables, stops, routes, disruptions, and real-time departures for Victoria's trains, trams, and buses, signed with a free key.

About

Public Transport Victoria exposes the data behind its own apps as the PTV Timetable API, Version 3, on timetableapi.ptv.vic.gov.au. It returns scheduled timetable, route, and stop data for every metropolitan and regional train, tram, and bus service in Victoria, Night Network included, plus real-time data for metropolitan train, tram, and bus where operators supply it, disruptions, stop facilities, and myki outlets. Every request carries a devid and an HMAC-SHA1 signature computed with your key. Train timetable data update daily; the remaining data weekly.

Through Fibric, an operator polls the stops beside your sites and proposes a roster or notice change with the departure or disruption attached.

This is a reference listing. It documents what Fibric would read from PTV Timetable API and what it could propose, based on the publisher's published interfaces. Fibric builds it under a managed deployment when you request it; selecting it here installs nothing.

Inputs

  • Departures for all routes or one route at a stop through /v3/departures, with scheduled_departure_utc, estimated_departure_utc, at_platform, and platform_number
  • Runs expanded with VehiclePosition (latitude, longitude, bearing, datetime_utc, expiry_time) and VehicleDescriptor (operator, low_floor, air_conditioned)
  • Disruptions through /v3/disruptions, by route, stop, or id, filtered by route_types, disruption_modes, and disruption_status
  • Stopping patterns for a run through /v3/pattern, and stops on a route or near a coordinate through /v3/stops
  • Routes, route_types, and directions, and a /v3/search across stops, routes, and myki outlets
  • Stop facilities (Metro and V/Line stations only) and a fare estimate by zone

Proposed actions

Read-only. This feed informs operators; it changes nothing.

Proposed actions are target capabilities. Every action runs propose-first and needs a validated deployment and the appropriate permissions.

What you can build

  • Staff the gate to the trams that are actually arriving

    Departures with expand=Run,VehiclePosition for the stop by the venue show each tram's estimated time and position. Event Surge proposes when extra staff start and keeps the departure rows it used.

    With Event Surge

  • Explain a late clock-in with the departure record

    A missed start is matched to the stop's scheduled against estimated departure at that time. If the service ran late or was cancelled, the operator proposes an excused mark with the row attached.

    With No-Show Response

  • Put planned disruptions into next week's roster

    Disruptions by route with from_date and to_date show which lines will be off. Schedule Notice drafts the message to affected staff for your approval and records who received it.

    With Schedule Notice

Requirements

  • An email to APIKeyRequest@ptv.vic.gov.au with the subject line 'PTV Timetable API – request for key'
  • Code that signs each request: HMAC-SHA1 over the path and query including devid, case-sensitive, appended as signature
  • The route_type and stop_id values for the stops beside your sites, taken from /v3/route_types and /v3/stops
  • The attribution 'Source: Licensed from Public Transport Victoria under a Creative Commons Attribution 4.0 International Licence'
Authentication
A user Id (devid) and API key requested by email from APIKeyRequest@ptv.vic.gov.au; each request carries devid and an HMAC-SHA1 signature of the request path computed with the key.

Limits

  • Real-time data exist only for metropolitan train, tram, and bus, and only where the operator supplies them; regional bus is still being added
  • Not designed for downloading the whole timetable; PTV points bulk users to its GTFS dataset on DataVic
  • include_cancelled applies to metropolitan train only; stop facilities cover Metro and V/Line stations only
  • PTV provides no technical support, and keys unused for three months may be disabled

Access and pricing

Reference listing. Public feed access is separate from Fibric integration. If you request this feed, your quote covers the build, usage, and support.

Request PTV Timetable API ↗

Questions and answers

How do I get a PTV Timetable API key?
Email APIKeyRequest@ptv.vic.gov.au with the subject 'PTV Timetable API – request for key'. PTV replies with a 128-bit GUID key and a user Id. The address answers key requests only; PTV gives no technical support. Keys idle for three months may be disabled.
How is a request signed?
Take the path and query string without the base URL, append devid, and compute an HMAC-SHA1 with your key. Append the hex result as signature. The hash is case-sensitive, so any change of case in the path needs a new signature.
How often do the data change?
PTV says train timetable data are updated daily and the remaining data weekly, allowing for planned changes such as holidays. Real-time departures, disruptions, and vehicle positions are only current if you call the API dynamically rather than caching a dump.
Ask about PTV Timetable API

Ask about the capabilities and requirements in this listing.

For project-specific requirements, contact Fibric.