GTFS Transit Fare Tables avatar

GTFS Transit Fare Tables

Pricing

from $2.40 / 1,000 fare rows

Go to Apify Store
GTFS Transit Fare Tables

GTFS Transit Fare Tables

Public-transit fares from any GTFS feed as one clean row per fare, with prices, currencies, zone and station names, media, rider categories and transfer rules resolved.

Pricing

from $2.40 / 1,000 fare rows

Rating

0.0

(0)

Developer

Saffo

Saffo

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Features

Limited permissions

Share

Transit Fares from GTFS Feeds: one joined row per fare

Public-transit fares from any GTFS feed as one clean row per fare, with prices, currencies, zone and station names, media, rider categories and transfer rules resolved.

What it does

The actor reads transit fares from the GTFS static feeds that transit agencies publish for developers and turns the fare files into one flat row per fare. Each row has the price and currency next to readable origin and destination names (station names for zone fares, area names for v2 fares), the route or fare network, the fare medium, the rider category, the transfer allowance and the feed version it came from. Both fare models of the standard, GTFS-Fares v1 (fare_attributes.txt and fare_rules.txt) and GTFS-Fares v2 (fare_products.txt, fare_leg_rules.txt and friends), come out in the same shape. The actor reads only the fare and lookup files of each zip through HTTP byte-range requests, so a large feed costs a few hundred kilobytes of download instead of the whole file. The fares are exactly as published in the feed at the time of the run.

Who it is for

  • Transit and mobility analysts who compare fare levels between systems without writing a GTFS parser.
  • Fare-equity researchers who need youth, senior and reduced prices next to the full fare.
  • Trip-cost and journey-planner developers, travel apps and AI agents that answer "how much is the fare from A to B".

How to use it

  1. Open the actor on Apify Store and go to its Input tab.
  2. Fill in feedUrls; every other field has a default (see Input below).
  3. Click Start. The run ends at the limits below, or earlier at the "Maximum cost per run" you set.
  4. When the run ends, open the Output tab: view the results as a table, or export them as JSON, CSV or Excel.

Input

FieldTypeDefaultDescription
feedUrlsarrayrequiredDirect http(s) URLs of GTFS static feed zip files, one per transit system (at most 20). Agencies list them on their developer or open-data pages.
maxItemsinteger1000Stop after this many fare rows in total across all feeds. At most 10000 per run.
includeRiderCategoriesbooleanfalseAlso output one row per rider category price (youth, senior, reduced) when the feed lists them.
maxFeedSizeMbinteger300Largest zip the actor downloads in full when the server ignores HTTP Range requests; larger feeds are skipped.

Example input:

{
"feedUrls": [
"https://www.bart.gov/dev/schedules/google_transit.zip"
],
"maxItems": 5
}

Feed URLs: agencies list the address of their GTFS static zip on their developer or open-data page (often called "GTFS", "schedule data" or "developer resources"). Use the direct link to the .zip file.

Output

Each result is one dataset item:

FieldTypeDescription
urlstringWeb address of the item: its own page, or the page it was read from.
titlestringTitle of the item as shown on the page.
pricenumber or nullPrice as a number, in currency; null when the page shows none.
currencystring or nullISO 4217 currency code of price, for example USD.
fareModelstringGTFS fare model the row comes from: gtfs-fares-v1 (fare_attributes and fare_rules) or gtfs-fares-v2 (fare_products and fare_leg_rules).
fareIdstringFeed identifier of the fare: fare_id in v1 or fare_product_id in v2.
riderCategorystring or nullName of the rider category the price applies to (for example youth or senior); null for the default fare.
paymentTimingstring or nullWhen the fare is paid in v1 feeds: on-board or before-boarding; null in v2 rows.
fareMediaobject or nullFare medium the v2 price applies to; null for v1 rows and v2 products without a medium.
agencyobject or nullTransit agency that sells the fare; null when a multi-agency feed does not say which one.
routeobject or nullRoute the v1 fare is limited to; null when the fare applies to every route.
networkobject or nullFare network of a v2 leg rule; null for v1 rows and for rules that apply to any network.
originobject or nullFare zone (v1) or area (v2) where the trip starts; null means any origin.
destinationobject or nullFare zone (v1) or area (v2) where the trip ends; null means any destination.
containsZoneIdstring or nullv1 contains_id, a zone the trip must pass through for this fare; null when not set.
legGroupIdstring or nullv2 leg_group_id of the leg rule; null for v1 rows and for products sold outside leg rules (passes).
timeframeGroupIdstring or nullv2 from_timeframe_group_id that limits when the fare applies; null when it applies at all times.
transfersobjectTransfer allowance included in the fare.
feedobjectVersion metadata of the feed the fare was read from.
fetchedAtstringWhen the page was read (ISO 8601, UTC).

Example output (real items from a test run):

[
{
"url": "https://www.bart.gov/dev/schedules/google_transit.zip",
"title": "Bay Area Rapid Transit South San Francisco → South San Francisco",
"price": 7.55,
"currency": "USD",
"fareModel": "gtfs-fares-v1",
"fareId": "1",
"riderCategory": null,
"paymentTiming": "before-boarding",
"fareMedia": null,
"agency": {
"id": "BART",
"name": "Bay Area Rapid Transit",
"fareUrl": null
},
"route": null,
"network": null,
"origin": {
"id": "SSAN",
"name": "South San Francisco",
"stopCount": 2
},
"destination": {
"id": "SSAN",
"name": "South San Francisco",
"stopCount": 2
},
"containsZoneId": null,
"legGroupId": null,
"timeframeGroupId": null,
"transfers": {
"maxTransfers": null,
"unlimited": true,
"durationSeconds": null
},
"feed": {
"publisher": "Bay Area Rapid Transit",
"version": "72",
"startDate": "2026-01-12",
"endDate": "2026-08-30"
},
"fetchedAt": "2026-11-17T09:47:43.253Z"
},
{
"url": "https://www.bart.gov/dev/schedules/google_transit.zip",
"title": "Bay Area Rapid Transit South San Francisco → San Bruno",
"price": 4.25,
"currency": "USD",
"fareModel": "gtfs-fares-v1",
"fareId": "2",
"riderCategory": null,
"paymentTiming": "before-boarding",
"fareMedia": null,
"agency": {
"id": "BART",
"name": "Bay Area Rapid Transit",
"fareUrl": null
},
"route": null,
"network": null,
"origin": {
"id": "SSAN",
"name": "South San Francisco",
"stopCount": 2
},
"destination": {
"id": "SBRN",
"name": "San Bruno",
"stopCount": 2
},
"containsZoneId": null,
"legGroupId": null,
"timeframeGroupId": null,
"transfers": {
"maxTransfers": null,
"unlimited": true,
"durationSeconds": null
},
"feed": {
"publisher": "Bay Area Rapid Transit",
"version": "72",
"startDate": "2026-01-12",
"endDate": "2026-08-30"
},
"fetchedAt": "2026-11-17T09:47:43.253Z"
}
]

A v2 row from the MBTA feed (Local Bus one-way fare on a CharlieCard, read from the November 2026 feed) looks like this:

{
"url": "https://cdn.mbta.com/MBTA_GTFS.zip",
"title": "Local Bus one-way fare",
"price": 1.7,
"currency": "USD",
"fareModel": "gtfs-fares-v2",
"fareId": "prod_local_bus_smartcard",
"riderCategory": null,
"paymentTiming": null,
"fareMedia": { "id": "charliecard", "name": "CharlieCard", "type": "transit-card" },
"agency": { "id": "1", "name": "MBTA", "fareUrl": "https://www.mbta.com/fares" },
"route": null,
"network": { "id": "local_bus", "name": null },
"origin": { "id": "area_route_354_downtown", "name": "Route 354 - Downtown", "stopCount": 3 },
"destination": { "id": "area_route_354_outside_downtown", "name": "Route 354 - Outside Downtown", "stopCount": 86 },
"containsZoneId": null,
"legGroupId": "leg_local_bus_smartcard",
"timeframeGroupId": null,
"transfers": { "maxTransfers": 1, "unlimited": false, "durationSeconds": 7200 },
"feed": { "publisher": "MBTA", "version": "Fall 2026, 2026-11-13T21:35:28+00:00, version D", "startDate": "2026-11-06", "endDate": "2026-12-12" },
"fetchedAt": "2026-11-17T09:44:50.075Z"
}

Download the dataset as JSON, CSV or Excel, or read it through the Apify API.

Pricing

Pay per event: a small fee per run plus a fee per result saved. Platform usage is included in these prices.

EventWhen it is chargedFree planBronze planSilver planGold planPlatinum planDiamond plan
Run started (run-started)Flat fee once per run; covers starting the run and reading the feed directories.$0.025$0.02$0.018$0.016$0.016$0.016
Fare row (fare-row)One resolved fare row saved to the dataset.$0.0037$0.003$0.0027$0.0024$0.0024$0.0024

Example (lowest plan price): a run that saves 100 results costs $0.016 + 100 × $0.0024 = $0.256. That is $2.40 per 1,000 results plus $0.016 per run. You pay only for results saved to the dataset; set "Maximum cost per run" in the run options and the actor stops there.

Worked examples: the full BART table of 2,500 origin-destination fares costs $0.02 + 2,500 × $0.003 = $7.52; a run that stops at 500 fare rows costs $0.02 + 500 × $0.003 = $1.52. A feed without fare files saves no rows, so it costs only the run fee.

Limits

  • One run saves at most 10,000 results and loads at most 20 pages. Larger jobs: split the start URLs over several runs.

  • Default memory 512 MB; no proxy.

  • When a limit is reached, the run ends normally and keeps every result saved so far; the status message says which limit it was.

  • Each feed counts as one page, so one run reads up to 20 feeds; duplicate URLs are read once.

  • Feeds without fare files (fare_attributes.txt or fare_products.txt) return no rows; many agencies publish schedules only.

  • When a server ignores byte-range requests, the actor downloads the whole zip to a temporary file, up to maxFeedSizeMb; larger feeds are skipped.

  • The actor obeys each feed host's robots.txt and skips a feed whose path it disallows. Feeds that need a login are not supported.

  • Rows from feeds on transitchicago.com are never returned: the CTA Developer License does not allow selling CTA data as a stand-alone product.

  • Fares are as published by the agency in its feed, not live ticket prices, and may be out of date when the agency has not updated its feed. The actor makes no guarantee about their accuracy.

  • The actor is not affiliated with or endorsed by BART, MBTA, MassDOT, CTA or any other transit agency. Each feed's data licence governs how you may reuse its data. MBTA data is provided by the Massachusetts Department of Transportation under the MassDOT Developers License Agreement.

Use with AI agents

AI agents can call this actor as a tool through the Apify MCP server. Add it to an MCP client (Claude Desktop, Cursor, VS Code and others):

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com/?tools=saffo/transit-fare-tables"
}
}
}

Or call it over HTTP and get the results in the response:

curl -X POST "https://api.apify.com/v2/acts/saffo~transit-fare-tables/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
-d '{"feedUrls":["https://www.bart.gov/dev/schedules/google_transit.zip"],"maxItems":5}'

An agent asked for the fare between two stations calls the actor with the agency's feed URL and a maxItems that covers the table, then filters the rows by origin.name and destination.name.

FAQ

How much does it cost?

You pay per event: from $0.0024 per fare row plus $0.016 per run. The Pricing section lists the price on every Apify plan. Platform usage is included, and the run stops at the maximum cost per run you set.

Can I use it from an AI agent or my own code?

Yes. Add it to any MCP client through the Apify MCP server, or call the Apify API; the examples under Use with AI agents show both. Results come back as JSON.

How many results can one run return?

Up to 10,000 results from at most 20 pages. For more, split the input over several runs.

Does it collect personal data?

No. It saves only the fields listed under Output and leaves out names, e-mail addresses, phone numbers and profiles of private persons.

Why do some feeds return no rows?

The agency publishes no fare files in its GTFS feed. Fares are optional in GTFS, and many feeds carry only stops, routes and timetables. The run log names every feed that was skipped and why.

What is the difference between v1 and v2 rows?

v1 rows (gtfs-fares-v1) are zone fares: a price for a trip from one fare zone to another, optionally limited to a route, with the payment timing and transfer allowance. v2 rows (gtfs-fares-v2) are fare products tied to leg rules: a price per network, area pair, fare medium and time frame, with transfers read from the transfer rules. Both use the same fields; the ones a model does not have are null.

Are the youth and senior prices included?

Only when you turn on includeRiderCategories and the feed lists rider-category prices. Each base fare is then followed by one row per category, with the category name in riderCategory.

More actors by the same author on Apify Store:

  • Brand Ownership Lookup: Parent Company & Ultimate Owner: For each brand, product or company name, returns the owning company, the chain up to the ultimate parent with its LEI and stock tickers, and its major institutional shareholders, all from Wikidata.
  • Google Play Developer Portfolio Tracker: Every app a Google Play developer page lists, with rating, installs, price, monetisation, release and update dates and its change since the last run, one row per app.
  • Google Play Ratings by Country: Compares the star rating Google Play shows in each country for the apps you list, with star shares, price, spread and change since the last run, one report per app. Not affiliated with Google.

Support

Open an issue on the actor's Issues tab.

Changelog

0.1 (2026-11-17)

  • First release: fare rows from GTFS static feeds for both fare models (GTFS-Fares v1 and v2) in one output shape, with zone, area and station names, fare media, networks, rider-category prices and transfer allowances; only the fare and lookup files are read, through HTTP byte-range requests.