Discover/BART API
live

BART APIbart.gov

Get live BART train departure estimates, station codes, and service alerts. 3 endpoints covering all Bay Area Rapid Transit stations in real time.

Endpoint health
verified 6d ago
get_stations
get_departures
get_alerts
3/3 passing latest checkself-healing
Endpoints
3
Updated
22d ago

What is the BART API?

The BART API provides 3 endpoints for real-time Bay Area Rapid Transit data: station listings with abbreviated codes, live platform-level departure estimates via get_departures, and current service alerts including elevator and escalator outages. Every departure response includes destination, estimated times, and car counts, making it suitable for building transit displays, commute tools, or service-monitoring integrations.

Try it

No input parameters required.

api.parse.bot/scraper/a3c68648-205d-4b57-a97b-b4d0bf6edcab/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/a3c68648-205d-4b57-a97b-b4d0bf6edcab/get_stations' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace bart-gov-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: BART Real-Time Departures API — bounded, re-runnable."""
from parse_apis.bart_real_time_departures_api import Bart, StationCode, StationNotFound

client = Bart()

# List all stations — each has a name and code for further lookups.
for station in client.stations.list(limit=5):
    print(station.name, station.code)

# Drill into one station's real-time departures via constructible resource.
embr = client.station(code=StationCode.EMBR)
board = embr.departures()
print(board.station_name, board.updated)
for platform in board.platforms:
    print(platform.name)
    for dep in platform.departures:
        print(f"  {dep.destination}: {dep.estimates[0].time}, {dep.estimates[0].cars}")

# Fetch system-wide alerts and advisories in one call.
alerts = client.alertreports.fetch()
print(alerts.as_of)
for sa in alerts.current_service_alerts:
    print(sa.type, sa.message[:80])
for eq in alerts.escalator_alerts:
    print(eq.station, eq.location, eq.reason)

# Typed error handling for an invalid station code.
try:
    bad = client.station(code="ZZZZ")
    bad.departures()
except StationNotFound as exc:
    print(f"Station not found: {exc.station_code}")

print("exercised: stations.list / station.departures / alertreports.fetch / StationNotFound")
All endpoints · 3 totalmissing one? ·

Fetch the list of all BART stations and their abbreviated codes. Each station has a human-readable name and a short code (e.g. 'EMBR' for Embarcadero). These codes are required input for get_departures.

Input

No input parameters required.

Response
{
  "type": "object",
  "fields": {
    "stations": "array of station objects each containing name (string) and code (string)"
  },
  "sample": {
    "data": {
      "stations": [
        {
          "code": "12TH",
          "name": "12th St. Oakland City Center"
        },
        {
          "code": "EMBR",
          "name": "Embarcadero"
        },
        {
          "code": "MONT",
          "name": "Montgomery St."
        }
      ]
    },
    "status": "success"
  }
}

About the BART API

Station Lookup and Departure Estimates

Start with get_stations to retrieve the full list of BART stations. Each object in the response includes a name (e.g. "Embarcadero") and a code (e.g. EMBR). These codes are required as the station_code parameter for get_departures. Passing an unrecognized or malformed code to get_departures returns a stale_input error, so always source codes from get_stations rather than hardcoding them.

Real-Time Platform Departures

get_departures accepts a single required parameter, station_code, and returns a station_name, an updated timestamp, and a platforms array. Each platform object contains a name and a departures array whose entries include the destination and estimates — the per-train countdown values and car counts. This structure mirrors how BART displays information on its own departure boards, organized by direction and platform.

Alerts and Advisories

get_alerts requires no inputs and returns a snapshot of the current system status as of an as_of timestamp. The response separates content into six arrays: current_service_alerts (each with a type and message), planned_service_advisories, elevator_alerts, escalator_alerts, planned_elevator_advisories, and planned_escalator_advisories. Elevator and escalator alert objects include station, station_code, location, reason, and estimated_return, which is useful for accessibility-aware routing tools. Planned advisory objects carry a description and a url for further detail.

Reliability & maintenanceVerified

The BART API is a managed, monitored endpoint for bart.gov — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when bart.gov changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official bart.gov API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
6d ago
Latest check
3/3 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Build a real-time departure board app for a specific station using get_departures platform and estimates data
  • Send push notifications when elevator or escalator outages are reported at a commuter's home station via get_alerts elevator_alerts
  • Display next-train countdowns on a smart home display by polling get_departures for a saved station_code
  • Aggregate planned_service_advisories from get_alerts to surface weekend or holiday schedule changes to users
  • Cross-reference escalator_alerts with station_code to warn wheelchair or mobility-aid users before they travel
  • Monitor current_service_alerts messages in get_alerts to detect active disruptions and surface them in a commute app
  • Enumerate all valid station codes once from get_stations to populate a station picker UI without hardcoding values
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does BART have an official developer API?+
Yes. BART publishes a free official REST API at https://api.bart.gov/docs/overview/index.aspx. It requires a free API key and covers real-time estimates, schedules, fares, and route information.
What does get_departures return for each train, and can I filter by destination?+
Each entry in the departures array includes a destination name and estimates (countdown times and car counts). The endpoint returns all departures across all platforms for the requested station; there is no server-side filter by destination. Filter client-side using the destination field after fetching the full response.
Does the API cover historical departure data or only the current moment?+
The API covers only live, current-state data. get_departures reflects the latest estimates as of the updated timestamp, and get_alerts reflects conditions as of as_of. No historical or archival departure records are exposed. You can fork this API on Parse and revise it to store responses over time and build a historical dataset.
Does the API include fare information or trip planning between two stations?+
Not currently. The API covers station listings, real-time departure estimates, and service alerts. Fare data and multi-station trip planning are not included in any of the three endpoints. You can fork it on Parse and revise to add a fare or trip-planning endpoint.
How current is the departure data returned by get_departures?+
Each response includes an updated timestamp indicating when the departure estimates were last refreshed. Freshness depends on the underlying BART system feed; under normal conditions this is updated every minute or less, but the timestamp in the response is the authoritative indicator of data age.
Page content last updated . Spec covers 3 endpoints from bart.gov.
Related APIs in Maps GeoSee all →
mbta.com API
Track real-time subway, bus, and commuter rail departures across Greater Boston, check schedules and service alerts, and find detailed information about routes and stops. Plan your commute with up-to-the-minute MBTA transit data and never miss your connection.
nationalrail.co.uk API
Check live train departure and arrival times at UK stations, search for specific stations, and get real-time service disruption alerts. Stay informed about rail service delays and changes to plan your journeys efficiently.
amtrak.com API
Search for Amtrak trains across stations, compare fares, and discover discounts to plan your rail journey with current pricing and availability. Get detailed train information, autocomplete station names, and find the cheapest routes for your travel dates.
bahn.com API
Search German train schedules and stations, find connections between destinations, and compare ticket prices across Deutsche Bahn routes. Get real-time station information and transit association details to plan your train journey efficiently.
rfi.it API
Check real-time train schedules and station information across Italy's railway network, search for stations, and get live alerts about delays and service disruptions. Monitor train circulation status and access detailed station mappings to plan your journeys efficiently.
bahn.de API
Access data from bahn.de.
citymapper.com API
Get real-time transit information including live stop arrivals, service status, and line details across major cities worldwide. Search for nearby transit options and stay informed with service alerts to plan your commute efficiently.
ratp.fr API
Monitor real-time traffic conditions and service disruptions across Paris's RATP and RER networks to plan your commute efficiently. Get instant updates on line statuses, delays, and service alerts for all metro and regional rail lines.