Reference · built on requestCommons signalTransit, roads & mobility

BART Legacy API & GTFS-Realtime

Real-time BART departure estimates, service advisories, elevator status, station data, and keyless GTFS-Realtime feeds.

About

The San Francisco Bay Area Rapid Transit District has run its Legacy API at api.bart.gov since 2010. Commands return XML or JSON: etd for real-time departure estimates, bsa for service advisories, elevator status and train counts, stn for stations, and route and sched for routes, schedules and holidays. BART now points developers to its GTFS and GTFS-Realtime feeds, which need no registration.

An operator reads departures and advisories for the stations that serve your sites and proposes a shuttle hold or a coverage change for your approval.

This is a reference listing. It documents what Fibric would read from BART Legacy API & GTFS-Realtime and what it could propose, based on the publisher's published interfaces. Fibric builds it under a managed deployment when you request it; selecting it here installs nothing.

Inputs

  • Departure estimates per station or ALL: etd.aspx?cmd=etd&orig=<stn>, with minutes, platform, direction, length, color, bikeflag, delay, cancelflag
  • Service advisories typed DELAY or EMERGENCY (bsa.aspx?cmd=bsa), current elevator status (cmd=elev), and train count (cmd=count)
  • Station list with abbreviations, names, coordinates and addresses: stn.aspx?cmd=stns
  • Route information and schedule commands covering trip planning, route and station schedules, and holidays
  • GTFS-Realtime trip updates (api.bart.gov/gtfsrt/tripupdate.aspx) and service alerts (gtfsrt/alerts.aspx)
  • Static GTFS at bart.gov/dev/schedules/google_transit.zip

Proposed actions

Read-only. This feed informs operators; it changes nothing.

Proposed actions are target capabilities. Every action runs propose-first and needs a validated deployment and the appropriate permissions.

What you can build

  • Explain late arrivals with a delay advisory

    Poll cmd=bsa. When an advisory of type DELAY names a line your staff ride, the operator matches it to late punches and proposes a no-show exception with the advisory text attached.

    With No-Show Response, Shift Coverage

  • Hold a shuttle for the next departure

    Read cmd=etd for your station. When a train with delay above zero is due, the operator proposes shifting the shuttle departure and shows the estimate it used.

    With Shuttle Timing

  • Warn arriving guests about an elevator outage

    Read cmd=elev before check-in time. When your nearest station lists an elevator out of service, the operator proposes a pre-arrival note to guests who flagged step-free access.

    With Arrival Prep

Requirements

  • A key parameter on each legacy call, public or registered; a registered key keeps working if the public one is refreshed
  • Station abbreviations from cmd=stns, such as RICH or 12TH
  • json=y on calls where you want JSON; the default output is XML
  • Compliance with the Developer License Agreement: no BART logo or system map, attribution welcome
Authentication
Every Legacy API call carries key=. BART publishes a public key on its developer page for use without registration, or you register your own at api.bart.gov/api/register.aspx. The GTFS and GTFS-Realtime feeds take no key.

Limits

  • plat and dir cannot be combined on etd; with orig=ALL neither can be used
  • The Oakland Airport Connector publishes no real-time arrivals; Pittsburg Center and Antioch trip_ids do not match the GTFS schedule
  • GTFS-Realtime offers trip updates and alerts only; there is no vehicle positions feed
  • BART calls GTFS and GTFS-RT its supported standards and may alter or stop the Legacy API without notice

Access and pricing

Reference listing. Public feed access is separate from Fibric integration. If you request this feed, your quote covers the build, usage, and support.

Request BART Legacy API & GTFS-Realtime ↗

Questions and answers

Do I have to register for a key?
No. BART publishes a public key on its developer API page that works without registration. Registering your own key at api.bart.gov/api/register.aspx keeps your access if the public key is refreshed. The GTFS and GTFS-Realtime feeds require no key at all.
How does a delay show up?
In etd each estimate carries delay in seconds off the scheduled departure and a cancelflag for a cancelled departure. The bsa command returns advisories typed DELAY or EMERGENCY with full text and an sms_text short form.
Is there a vehicle positions feed?
No. BART's GTFS-Realtime page lists trip updates at api.bart.gov/gtfsrt/tripupdate.aspx and service alerts at gtfsrt/alerts.aspx. Train-level detail comes from the Legacy API etd command, which reports platform, direction, length and colour.
Ask about BART Legacy API & GTFS-Realtime

Ask about the capabilities and requirements in this listing.

For project-specific requirements, contact Fibric.