How to create a GTFS feed

A GTFS feed standardizes transit data for use in trip planning and real-time apps, but its creation and maintenance involve significant complexities. Agencies face challenges like frequent URL or ID changes, inconsistent formatting, and gaps during schedule updates, which disrupt app functionality. Maintaining consistency and adopting best practices are essential to ensure reliability and usability. There are a number of options for creating a GTFS feed.

Option 1: Using the GTFS Builder tool

Using the GTFS Builder tool is the easiest option that removes the requirement for technical knowledge and mapping experience. The GTFS Builder tool enables transit agencies to build and maintain their feed with minimal effort.

The tool collects all required information through a series of forms with optional data imports. Once completed, your transit system's schedules, stops, routes and the paths that each route travels are captured and added to your own custom feed.

Furthermore, the tool hosts the feed, enabling transit agencies to schedule the acquisition of the feed on a regular basis to ensure that transit customers have up to date information when planning their trips.

Not only does the GTFS Builder tool remove the requirement of technical knowledge and mapping experience, a feed for a single route can be created in under an hour depending on the information previously collected for the transit service. Route, trip or stop information can be modified in mere minutes.

  1. Enter transit agency information

    Enter the required and optional information related to your transit agency.

    You can also enter the non-operational days for your agency.

  2. Enter stop information

    Either manually enter your stops or bulk import them from an Excel file. All you need is the stop code, name, description (optional), latitude and longitude.

  3. Enter route information

    Enter route information through a three step process: click add, enter information (short name and route type), click save. You can also add route full name, route description, route display colour and route text colour.

    If entered, Google will use the colors in their trip planner.

  4. Build your trips

    This process will identify the paths that the bus travels for the route and create the route schedule.

    Once you have completed step 4, all necessary information for your GTFS feed has been created.

  5. Validate your feed

    Use validators to make sure the feed is correct:

    These will flag errors like missing stops, bad times, or inconsistent IDs.

  6. Publish or share

    Follow the required processes to share the feed with partners such as Google Transit, Apple Maps, etc.

    Get started with the GTFS Builder tool


Option 2: Manually create a GTFS feed

Creating a GTFS feed is a detailed process that combines data management, technical knowledge, and mapping expertise. At its core, a GTFS feed is a collection of standardized text files that describe your transit system's schedules, stops, and routes. To produce a high-quality feed, you'll need a solid technical understanding of the GTFS file structure and how the different files interconnect. You'll also need GIS support to generate route shapes so that the feed doesn't just list stops, but also accurately reflects the path each bus travels. Finally, building and maintaining a GTFS feed requires significant effort —collecting accurate stop locations, ensuring schedules align with operations, validating data, and updating as services change. Manually creating a GTFS feed will take between 2 days to a couple of weeks depending on the data already available and the technical expertise of the person or team creating the feed.

The following step-by-step guide walks through the process, helping you move from raw transit data to a validated GTFS feed that can be shared with riders and trip-planning applications.

  1. Understand the GTFS structure

    A GTFS feed is a ZIP file containing several text files. At minimum, you need:

    • agency.txt - information about the transit agency
    • stops.txt - list of stops and stations (with lat/long coordinates)
    • routes.txt - all transit routes
    • trips.txt - trips for each route (a trip is a single journey)
    • stop_times.txt - schedules: which stops are served, at what times
    • calendar.txt - days of operation for the service

    Optional files: shapes.txt (geometry of routes), fare_attributes.txt, frequencies.txt, transfers.txt, etc.

    You will need support from a GIS (Geographical Information System) team to create the shape file to enable Google to display the geometry of the routes.

  2. Gather your data

    You'll need:

    • Agency details (name, website, timezone)
    • List of stops (names, lat/long, codes)
    • Routes (bus routes, train lines, etc., with IDs and colors if desired)
    • Trip patterns (which stops a route follows)
    • Timetables (arrival and departure times)
    • Service calendar (e.g., weekdays, weekends, holidays)
  3. Build the required files

    Each file is a plain CSV with required columns. For example:

    agency.txt

    agency_id,agency_name,agency_url,agency_timezone
    1,City Transit,http://www.citytransit.com,America/Chicago

    stops.txt

    stop_id,stop_name,stop_lat,stop_lon
    100,Main & 1st,41.8819,-87.6278
    101,Main & 2nd,41.8820,-87.6200

    routes.txt

    route_id,agency_id,route_short_name,route_long_name,route_type
    10,1,10,Downtown - Airport,3

    trips.txt

    route_id,service_id,trip_id,trip_headsign
    10,WKDY,10A,Downtown

    stop_times.txt

    trip_id,arrival_time,departure_time,stop_id,stop_sequence
    10A,08:00:00,08:00:00,100,1
    10A,08:10:00,08:10:00,101,2

    calendar.txt

    service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
    WKDY,1,1,1,1,1,0,0,20251001,20251231
  4. Zip the files

    Once you've created these .txt files, put them in a ZIP file (no folders inside, just the text files).

  5. Validate your feed

    Use validators to make sure the feed is correct:

    These will flag errors like missing stops, bad times, or inconsistent IDs.

  6. Publish or share

    Follow the required processes to share the feed with partners such as Google Transit, Apple Maps, etc.


Option 3: Use an open source solution

There are several open source tools and projects that can help with building, editing, validating, and maintaining GTFS feeds. Depending on what you need (simple editing, GIS integration, shared work, etc.) some will be more suitable than others.

A simple search will result in numerous open source solutions and you can narrow your search based on the functionality desired when creating the feed. However, there are several things to consider when selecting an open source solution: