ParseForge Scrapers

MBTA Boston Live Transit Scraper

parseforge/mbta-transit-scraper

BusinessAutomationOther

Scrapes MBTA transit data including routes, stops, vehicles, predictions, alerts, schedules, and shapes. Returns each record as a flat row with all attributes.

Run this scraper See the API call
Total users
2
Monthly active
1
Total runs
109
Bookmarked
0
Rating
Not rated yet
Last modified
12 days ago

Overview

ParseForge

MBTA Boston Live Transit Scraper

Scrape live MBTA Boston transit data for routes, stops, vehicles, predictions, alerts, and more. Every record comes with its full set of attributes, ready for export to CSV, JSON, Excel, or XML. No API key required.

The MBTA's official API requires an API key and has rate limits. This Actor reads the public MBTA v3 API directly, returning live and scheduled transit data for the Boston area. Filter by route, stop, transit mode, or direction, and get each record in a flat, consistent schema.

Who uses it What they scrape MBTA for
Transit app developers Build real-time arrival displays and trip planners
Urban planners Analyze service patterns and stop usage
Data journalists Report on MBTA performance and disruptions
Researchers Study public transit behavior and accessibility
Commuters Check live arrivals and service alerts

What it does

This Actor collects MBTA transit data by mode, including routes, stops, vehicles, predictions, alerts, trips, schedules, shapes, facilities, and lines, and returns each record as a flat row.

  • πŸš‡ Routes and lines: Get all MBTA routes with their modes, names, and line groupings.
  • 🚏 Stops and facilities: Retrieve station details, including accessibility features like elevators and escalators.
  • 🚌 Live vehicles: Track current vehicle positions across the network.
  • ⏱️ Predictions: Get next arrival and departure times for any stop or route.
  • ⚠️ Alerts: Monitor service disruptions and advisories in real time.
  • πŸ—“οΈ Schedules and trips: Access timetables and scheduled trips for planning.
  • πŸ—ΊοΈ Shapes: Download route geometry polylines for mapping.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with MBTA data

πŸ“± Build a real-time arrival board.

A developer runs the Actor with mode=predictions and a stop filter to power a station display showing next train and bus arrivals.

🚨 Monitor service disruptions.

A transit advocate runs the Actor with mode=alerts and a route filter to track and report on MBTA service issues.

πŸ—ΊοΈ Map the MBTA network.

A GIS analyst runs the Actor with mode=shapes to download route geometry for a custom transit map.

πŸ“Š Analyze stop usage.

An urban planner runs the Actor with mode=stops and a transit mode filter to study station accessibility and ridership patterns.

⏰ Plan a commute.

A commuter runs the Actor with mode=schedules and a stop filter to get the day's timetable for their station.

Why choose this scraper

What you get
No API key Uses the public MBTA v3 API without registration
Live and scheduled Covers real-time predictions, vehicles, and static schedules
Flexible filters Narrow by route, stop, mode, or direction
Flat output Each record is a simple row, ready for analysis
Multiple formats Export to CSV, JSON, Excel, or XML

How it compares

This Actor covers all MBTA data modes, while the competitor focuses only on live arrivals and departures.

Feature ParseForge MBTA Live Arrivals Scraper - Boston Transit Data
Live arrival predictions Yes Yes
Live vehicle positions Yes Not listed
Service alerts Yes Not listed
Schedules and timetables Yes Not listed
Route geometry (shapes) Yes Not listed
Stop and facility details Yes Not listed

Configure the run

Drive the Actor with a data mode and optional filters for route, stop, transit mode, and direction. Filters run as each record is read, so only matching data reaches your dataset. The Input tab lists every parameter.

A first run with the defaults:

{
  "maxItems": 10
}

A larger pull:

{
  "maxItems": 200
}

Pricing

Pay-per-result: $0.0385 per result collected. You pay only for the results written to your dataset.

Results collected Approximate cost
100 results $3.85
1,000 results $38.50
10,000 results $385.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the MBTA Boston Live Transit Scraper.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to MBTA through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/mbta-transit-scraper"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting no results?

Check your filters. For predictions and schedules, you must provide a routeFilter or stopFilter. For trips and shapes, a routeFilter is required. Also ensure your route or stop IDs are correct.

Why are times in a different timezone?

All times are in America/New_York. If you need UTC, you can convert after export.

How do I get more than 10 records?

Increase the maxItems input. The default is 10, but you can set it up to 1,000,000.

Why is my sort not working?

Make sure you use a valid field name and prefix with '-' for descending order. For example, '-arrival_time' sorts by arrival time descending.

Can I get data for a specific direction?

Yes, use the directionId input. 0 is typically outbound, 1 is inbound, or choose 'any'.

FAQ

Question Answer
Do I need an MBTA API key? No. This Actor uses the public MBTA v3 API, which does not require an API key for basic access.
What data modes are available? You can scrape routes, stops, vehicles, predictions, alerts, trips, schedules, shapes, facilities, and lines.
How do I filter results? Use the routeFilter, stopFilter, transitMode, and directionId inputs to narrow results. Filters are applied as data is fetched.
Can I get live vehicle positions? Yes, set mode to 'vehicles' to get current positions of buses, trains, and ferries.
What timezone are the times in? All times are returned in the local Boston timezone (America/New_York).
How many records can I get? You can set maxItems up to 1,000,000 records per run.
Can I include related resources? Yes, use the 'include' input to side-load related resources like route, stop, trip, or vehicle details.
What export formats are supported? You can export data to CSV, JSON, Excel, or XML.
Is this Actor free to use? The Actor runs on the Apify platform, and usage is subject to Apify's pricing. The MBTA API itself is free.
Can I schedule this Actor to run periodically? Yes, you can set up a schedule in Apify to run the Actor at regular intervals, such as every minute for live data.

Related actors

Browse the full ParseForge collection for more scrapers.

πŸ†˜ Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Massachusetts Bay Transportation Authority. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

Input

FieldTypeWhat it doesDefault
mode string (10 options) Choose what to scrape. Predictions and Schedules require routeFilter or stopFilter. Trips and Shapes require routeFilter. Times are returned in the local Boston (America/New_York) timezone. routes
maxItems integer How many transit records to collect per run. 10
sectionCaptionFilters string Narrow results by route, stop, or transit mode. not set
routeFilter string Comma-separated route IDs (e.g. 'Red,Orange,Green-B,1,77'). Used by predictions, vehicles, alerts, and stops. not set
stopFilter string Comma-separated stop IDs (e.g. 'place-pktrm,70061'). Used by predictions and alerts. not set
transitMode string (6 options) Filter by transit mode (route_type). Heavy rail = subway, light rail = trolley, bus = local bus, ferry = harbor ferry, commuter-rail = MBTA Commuter Rail. all
directionId string (3 options) Direction of travel: 0 (typically Outbound / South / West), 1 (Inbound / North / East), or any. any
sort string Sort field. Prefix with '-' for descending (e.g. 'arrival_time', '-departure_time', 'name', '-severity'). Leave blank for default ordering. not set
include string Comma-separated list of related resources to side-load (e.g. 'route,stop,trip,vehicle'). Useful for predictions and schedules. not set

Pricing

from $28.87 per 1,000 results

Charged forWhat it isPrice each
result Single result in the default dataset. $0.02887 to $0.0385

Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.

API

One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.

POST Β· run and get results
curl -X POST "https://api.apify.com/v2/acts/parseforge~mbta-transit-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "helloWorld": 123
  }'

Examples

Input that runs as-is.

input.json
{
  "helloWorld": 123
}

Reviews

No reviews yet. Be the first.

Issues

We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.

Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.

Related scrapers

Run MBTA Boston Live Transit Scraper on Apify All scrapers