fare_containers.txt
has been renamed to fare_media.txt
, as part its recent adoption in the GTFS specification.In 2020, Interline and the Metropolitan Transportation Commission released a beta version of fares and transfer discounts for eight SF Bay Area transit agencies. Since then, we’ve been working together to improve data coverage and its schema. As of this August, the Regional GTFS Feed now includes fares and transfer discounts for over 30 Bay Area transit agencies. The updated dataset uses the adopted GTFS-Fares v2 “base implementation,” as well a few proposed additions to the GTFS-Fares v2 data schema. This data is now available for use, and our team is updating it on an ongoing basis.
In this blog post we’ll cover:
- GTFS-Fares v2 in action
- GTFS-Fares v2 base implementation and future additions to the specification
- SF Bay Area transit agencies with GTFS-Fares v2 data
- Using GTFS-Fares v2 data for the Bay Area
GTFS-Fares v2 in action
If you have an Apple iPhone running iOS 16, you can see the estimated costs of transit journeys. This data is sourced from the the Regional Feed.
All of the above fares information is defined in the Regional GTFS Feed using the GTFS-Fares v2 specification. Here are extracts of the relevant GTFS files from the feeds for the itinerary displayed on the iPhone:
fare_products.txt
fare_product_id | fare_product_name | amount | currency | rider_category_id | fare_media_id |
---|---|---|---|---|---|
AC:local:single | AC Transit local fare | 2.25 | USD | adult | clipper |
BA:matrix:FTVL-EMBR | generated | 2.15 | USD | adult | clipper |
fare_media.txt Updated
fare_media_id | fare_media_name | fare_media_type |
---|---|---|
clipper | Clipper | 2 |
fare_leg_rules.txt
leg_group_id | from_area_id | to_area_id | network_id | fare_product_id |
---|---|---|---|---|
AC | AC:local | AC:local | AC | AC:local:single |
BA | FTVL | EMBR | BA | BA:matrix:FTVL-EMBR |
stop_areas.txt
area_id | stop_id |
---|---|
AC:local | 55227 |
AC:local | 55550 |
FTVL | FTVL |
EMBR | EMBR |
Note that this data schema has changed since the examples in our first release blog post. This new schema was adopted as part of the GTFS-Fares v2 “base implementation,” which we will now discuss in more detail.
GTFS-Fares v2 base implementation and future additions to the specification
Since the original GTFS-Fares v2 proposal, many stakeholders in GTFS have provided additional input. In May, stakeholders voted to adopt the core of the refined GTFS-Fares v2 proposal as a “base implementation”.
The “base implementation” simplifies the organization of fare_leg_rules.txt
, fare_transfer_rules.txt
, and fare_products.txt
. This is a breaking change, so consumers who implemented their GTFS processing software against the original proposal will need to update their tools.
To fully capture the complexity of Bay Area transit fares and transfer discounts requires additional data tables and fields that were included in the original proposal but not in the “base implementation.”
Here is an overview of all the GTFS-Fares v2 tables and columns/fields included in the Regional GTFS Feed:
GTFS file | Spec version(s) | Columns added for extensions | Documentation |
---|---|---|---|
fare_products.txt |
"base" with additional columns for extensions |
|
See gtfs.org reference |
fare_leg_rules.txt |
"base" with additional columns for extensions |
|
See gtfs.org reference |
fare_transfer_rules.txt |
"base" with additional columns for extensions |
|
See gtfs.org reference |
areas.txt |
"base" | See gtfs.org reference | |
stop_areas.txt |
"base" | See gtfs.org reference | |
fare_media.txt |
"base" as of March 14, 2023 Updated | See gtfs.org reference | |
rider_categories.txt |
extension |
|
See proposal Google Doc |
routes.txt |
extension |
|
See proposal Google Doc |
* fare_leg_rules.txt transfer_only
and fare_transfer_rules.txt filter_fare_product_id
are two fields proposed for describing partial credit on inter-agency transfers. Thanks to the Transit app team for proposing these additions to make some of the transfer discounts in the Regional GTFS Feed more explicit for consuming software to parse.
Interline and MTC will continue to produce these “extensions” to the “base” data schema, and we’ll continue to work with data consumers, MobilityData, and other stakeholders to finalize their adoption into the GTFS spec.
SF Bay Area transit agencies with GTFS-Fares v2 data
Interline and MTC now produce fares, intra-agency transfer discounts, and inter-agency transfer discounts for the following agencies:
511 operator code | Operator full name |
---|---|
3D | Tri Delta Transit |
AC | AC Transit (including transbay routes) |
AF | Angel Island Tiburon Ferry |
AM | Capitol Corridor |
BA | Bay Area Rapid Transit (BART) |
CC | County Connection |
CE | Altamont Corridor Express (ACE) |
CM | Commute.org Shuttles |
CT | Caltrain |
DE | Dumbarton Express Consortium |
EM | Emery Go-Round |
FS | Fairfield and Suisun Transit |
GF | Golden Gate Ferry |
GG | Golden Gate Transit |
MA | Marin Transit |
MV | MVgo Mountain View |
PE | Petaluma Transit |
RV | Rio Vista Delta Breeze |
SA | Sonoma Marin Area Rail Transit |
SB | San Francisco Bay Ferry |
SC | Valley Transportation Authority (VTA) |
SF | San Francisco Municipal Transportation Agency (SFMTA) |
SI | San Francisco International Airport (SFO) |
SM | SamTrans |
SO | Sonoma County Transit |
SR | Santa Rosa CityBus |
SS | City of South San Francisco |
ST | SolTrans |
TD | Tideline Water Taxi |
UC | Union City Transit |
VC | Vacaville City Coach |
VN | VINE Transit |
WC | Western Contra Costa (WestCat) |
WH | Livermore Amador Valley Transit Authority (LAVTA) |
Fares are included for Clipper Card, cash, and a wide variety of passes. (Clipper Card is the contact-less payment card and system operated by MTC and available on buses, trains, and ferries throughout the Bay Area.) Transfer discounts between routes operated by the same agency (intra-agency transfers) are included for all methods of payment. Transfer discounts between routes operated by different agencies (inter-agency transfers) are only included for Clipper Card.
Our team is updating these fares and transfer discounts on a monthly basis.
Using GTFS-Fares v2 data for the Bay Area
Download the daily Regional Feed like so:
- Sign up for a 511 Open Data API token
- Download from
http://api.511.org/transit/datafeeds?api_key=[your_key]&operator_id=RG
We welcome questions sent to the 511SFBayDeveloperResources mailing list.
Acknowledgements
Credit and many thanks to project team members including Ian Rees (Interline), Nome Dickerson (Garnet Consulting), Nisar Kapeel and Kapeel Daryani (MTC), and our partners at Bay Area transit agencies.