GTFS · · 4 min read

Easily inspect GTFS Realtime using Transitland's website or API

Web browsers and text editors can't open GTFS Realtime. But with Transitland, you now can.

GTFS Realtime feeds provide live updates about vehicle positions, trip updates, and service alerts, but they can be challenging to inspect due to their Protocol Buffer format. This binary format is highly efficient for data transmission but requires special tools to decode. You can't just open it up in a text editor or a web browser.

Transitland now offers two convenient ways to parse and view GTFS Realtime feeds: through our web interface and via our REST API.

Inspecting GTFS Realtime on the Transitland Website

The Transitland website now provides an intuitive interface for viewing GTFS Realtime data directly in your browser. Let's walk through how to use this feature using Portland TriMet's GTFS Realtime feed as an example.

Finding a GTFS Realtime Feed

  1. Navigate to www.transit.land and go to the "Source Feeds" section
  2. Look for feeds with the GTFS Realtime format designation
  3. Click on any GTFS Realtime feed to view its details
browsing Transitland website for GTFS Realtime feeds

For this example, we'll use the TriMet GTFS Realtime feed at https://www.transit.land/feeds/f-trimet~rt

Viewing Real-time Data

On the feed page, you'll see comprehensive information about the feed including:

⏱️
Learn more about how Transitland caches GTFS Realtime feeds.

The most exciting feature is the "GTFS Realtime Feed Messages" section, which provides three ways to inspect each type of real-time data:

screenshot of https://www.transit.land/feeds/f-trimet~rt

Interactive JSON Viewer

When you click "View as JSON" for any real-time endpoint, a modal window opens showing:

Interactive JSON viewer for TriMet GTFS Realtime vehicle positions feed

The JSON viewer displays the data in a structured format that's easy to read and understand, showing all the fields defined in the GTFS Realtime specification.

Accessing GTFS Realtime via the Transitland API

For programmatic access or integration into your applications, the Transitland REST API provides direct access to Transitland's cached GTFS Realtime data.

API Endpoint Structure

The API uses the following endpoint pattern:

GET https://transit.land/api/v2/rest/feeds/{feed_key}/download_latest_rt/{rt_type}.{format}

Where:

Example API Call

To access TriMet's cached GTFS Realtime service alerts through the Transitland REST API in JSON format:

curl https://transit.land/api/v2/rest/feeds/f-trimet~rt/download_latest_rt/alerts.json?apikey=YOUR_API_KEY

API Response Format

When requesting JSON format, the API returns data in the standard GTFS Realtime JSON structure. For example:

{
  "header": {
    "gtfsRealtimeVersion": "2.0",
    "incrementality": "FULL_DATASET",
    "timestamp": "1753153829"
  },
  "entity": [
    {
      "alert": {
        "activePeriod": [
          {
            "start": "1675370449"
          }
        ],
        "descriptionText": {
          "translation": [
            {
              "text": "No service to the eastbound stop at SW Tualatin-Sherwood Rd & Langer Farms (Stop ID 13837) due to Tualatin-Sherwood Rd project."
            }
          ]
        },
        "headerText": {
          "translation": [
            {
              "text": ""
            }
          ]
        },
        "informedEntity": [
          {
            "routeId": "97"
          },
          {
            "stopId": "13837"
          }
        ],
        "url": {
          "translation": [
            {
              "text": "https://trimet.org/alerts/"
            }
          ]
        }
      },
      "id": "164849"
    }

Finding Available GTFS Realtime Feeds

To discover available GTFS Realtime feeds, use the feeds REST endpoint with the spec=gtfs-rt parameter:

curl https://transit.land/api/v2/rest/feeds?spec=gtfs-rt&apikey=YOUR_API_KEY

You can also filter by other criteria to find feeds relevant to your needs.

Benefits of Using Transitland for GTFS Realtime

Transitland's website and API provide simplified access:

Transitland also offers comprehensive coverage:

🔍
Don't see a GTFS Realtime feed available through Transitland? Help add it the Transitland Atlas feed registry.

Alternatively, transit agency staff are welcome to email us GTFS Realtime feed URLs at hello@transit.land. You may also share auth credentials, which we will keep private.
Finally, please note that some agencies do not allow Transitland to redistribute their feeds in full. In these cases, GTFS Realtime feed export is not allowed through either the Transitland API or website.

Getting Started

Whether you're an analyst learning your way around GTFS data or an agency staffer trying to quickly debug your own systems, Transitland provides the tools you need to automatically parse and read GTFS Realtime feeds. The combination of our web interface and REST API makes it simple to explore real-time transit data without the complexity of Protocol Buffer conversion tools.

Read next