GTFS Realtime Overview

Providing users transit data updates in real time greatly enhances their experience of your transit services. Providing up-to-date information about current arrival and departure times allows users to smoothly plan their trips. As a result, in case of an unfortunate delay, a rider would be relieved to know that they can stay home a little bit longer.

GTFS realtime is a feed specification that allows public transportation agencies to provide application developers with real-time updates about their fleet. This feed is an extension to GTFS (General Transit Feed Specification), an open data format for public transportation schedules and associated geographic information. GTFS realtime is designed for ease of implementation, good GTFS interoperability, and a focus on passenger information.

This specification was designed through a partnership of the initial Live Transit Updates partner agencies, a number of transit developers, and Google. The specification is published under the Apache 2.0 License.

What is Live Transit Updates for Google Maps?

Live Transit Updates is a service providing real-time transit updates to users of Google Maps and Google Maps for mobile. These updates include live departure and arrival times to transit stations and service alerts.

Live Transit Updates provide 2 types of real-time updates to users: live departure times and service alerts. Transit partners provide these updates in their feeds. We created the GTFS realtime feed format to complement the widely-used GTFS format for static transit schedules. Your feed needs to be available on a location where we can fetch it periodically. The system immediately processes feed updates as Live Transit Updates information.

How do I start?

For Google to provide live updates on your fleet, we first need to have your static schedule information available through Google Maps. If you don’t yet provide your static schedule information, please follow the instructions to participate.

  1. If your static transit information is available in Google Maps, please fill out the contact form. We will get back to you on how to create the appropriate feeds with real-time updates.
  2. Continue reading the Overview section below.
  3. Decide which feed types you will provide.
  4. Take a look at example feeds.
  5. Create your own feeds using the reference.
  6. Publish your feed.

Overview of GTFS realtime feed types

The specification currently supports the following types of information:

  • Trip updates: Delays, cancellations, changed routes
  • Service alerts: Stop moved; unforeseen events affecting a station, route or the entire network
  • Vehicle positions: Information about transit vehicles including location and congestion level

Updates for each information type are provided in a separate feed. Feeds are served via HTTP and updated frequently. The file itself is a regular binary file, so any type of webserver can host and serve the file (other transfer protocols may be used as well). Alternatively, web application servers could also be used which, in response to a valid HTTP GET request, return the feed. There are no constraints on how frequently nor on the exact method of how the feed should be updated or retrieved.

Because GTFS realtime allows you to present the actual status of your fleet, the feed needs to be updated regularly - preferably whenever new data comes in from your Automatic Vehicle Location system.

More about Feed types...

Data format

The GTFS realtime data exchange format is based on Protocol Buffers.

Protocol buffers are a language- and platform-neutral mechanism for serializing structured data (think XML, but smaller, faster, and simpler). The data structure is defined in a gtfs-realtime.proto file, which then is used to generate source code to easily read and write your structured data from and to a variety of data streams, using a variety of languages, such as Java, C++, or Python.

More about Protocol Buffers....

Data structure

The hierarchy of elements and their type definitions are specified in the gtfs-realtime.proto file.

This text file is used to generate the necessary libraries in your choice of programming language. These libraries provide the classes and functions needed for generating valid GTFS realtime feeds. The libraries make feed creation easier and ensure that only valid feeds are produced.

More about the data structure...

Getting help

To participate in discussions on GTFS realtime and suggest changes or additions to the specification, join the GTFS realtime discussion group.

Additional resources are available on the Community page.

Google Maps and live Transit updates

One of the possible applications that uses GTFS realtime is Live Transit Updates, a feature within Google Maps that provides users with real-time transit information.

If you provide a transportation service that is open to the public, and operates with fixed schedules and routes, we welcome your participation; it is simple and free.