canonical: https://jentic.com/apis/bart.gov/bart

# Bart Gov BART Legacy API

Jentic publishes the only available OpenAPI specification for the BART Legacy API, keeping it validated and agent-ready. The Bay Area Rapid Transit (BART) Legacy API exposes real-time train departure estimates, station information, route data, schedule data, and service advisories for the San Francisco Bay Area's rapid transit network. A public testing key (MW9S-E7SL-26DU-VV8V) is documented for development. Useful for transit-aware mobile apps, commute assistants, and data-driven research into Bay Area transit operations.

## For AI agents

Look up BART real-time departures, stations, routes, schedules, and service advisories for Bay Area public transit. Used by agents that build commute assistants and transit dashboards.

## Scope

Does not handle ticket purchase, fare payment, or BART parking reservations - use for transit data, schedules, and advisories only.

## Capabilities

- Retrieve real-time estimated departures for any BART station
- List all BART stations with platform, address, and coordinate metadata
- Look up route definitions and the stations served on each route
- Pull schedule information and plan trips between two stations
- Read service advisories, elevator status, and current train counts
- Check the BART API version for compatibility checks

## Use cases

### Commute Assistant Notifications

Drive a personalised commute assistant that surfaces the next BART departures from the user's home or work station and warns about service advisories before they leave the office. The /etd.aspx endpoint returns real-time estimated departures by station, while /bsa.aspx exposes service advisories and elevator status. Suitable for mobile commute apps, smart-display widgets, and chat-based assistants.

Example prompt: Call GET /etd.aspx with orig=EMBR and key=<api_key> and return the next two southbound departures with destination and minutes.

### Trip Planning for Bay Area Visitors

Power trip planning experiences for visitors and locals using BART's schedule and route endpoints. /sched.aspx supports trip planning between two stations on a given date and time, returning legs, transfer points, and durations. Pair with /stn.aspx for station addresses and coordinates so that a map UI can display the journey end to end.

Example prompt: Call GET /sched.aspx with orig=BERK, dest=SFIA, and a target departure time, then return the suggested itinerary with departure, arrival, and any transfer.

### Transit Operations and Accessibility Dashboards

Build internal or public-facing dashboards that monitor BART operations including elevator status, service advisories, and active train counts. /bsa.aspx provides advisory text and elevator updates that are critical for accessibility-focused users. Combine with /route.aspx and /stn.aspx for a full system view, refreshing on a short interval to surface incidents quickly.

Example prompt: Call GET /bsa.aspx for elevator advisories and post any out-of-service elevator updates to a Slack channel within five minutes.

### AI Agent Bay Area Transit Assistant via Jentic

Run an AI assistant that answers transit questions like 'when's the next train to SFO from Powell' through Jentic. The agent searches Jentic for an intent like 'get next bart departures', loads the BART operation, and executes the call with the API key held in your Jentic One instance. Useful for chat copilots embedded in city guide apps or workplace assistants.

Example prompt: Search Jentic for 'get bart real-time departures', execute /etd.aspx with orig=POWL, and return the next train heading toward SFIA with minutes until departure.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /etd.aspx | Get real-time estimated departures |
| GET | /stn.aspx | List stations |
| GET | /route.aspx | Get route information |
| GET | /sched.aspx | Get schedule information or plan a trip |
| GET | /bsa.aspx | Get service advisories, elevator status, or train count |
| GET | /version.aspx | Get API version metadata |

## Key resources

- **Real-Time Estimates** — Live estimated departures by station and direction
- **Stations** — Station metadata including names, abbreviations, and coordinates
- **Routes** — BART route definitions and the stations they serve
- **Schedules** — Scheduled trips and trip planning between stations
- **Advisories** — Service advisories, elevator status, and active train counts
- **System** — API version and system-level metadata

## Why Jentic

- **Setup:** Wiring the BART Legacy API by hand means appending your key as a query parameter, learning the .aspx endpoints for departures, stations, routes, and advisories, and parsing the legacy response formats yourself. Through Jentic you install once, import the BART Legacy API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** BART carries its station abbreviations and time parameters as query parameters rather than as a resource in the URL path, so scope the agent to the operations it needs, such as getting real-time departures or a schedule. You choose that operation set, and since this API is read-only there are no write operations to add.
- **Credential handling:** Your BART API key is stored once, encrypted, by your own Jentic One instance and injected as the key query parameter at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get the next train from a BART station' or 'plan a BART trip', and Jentic returns the matching BART operation with its input schema, including station abbreviations and time parameters, so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Transit App** — Multi-agency transit data for trip planning and real-time arrivals.
- **MTA** — New York transit data for cross-city or multi-network apps.

## FAQ

### Why is there no official OpenAPI spec for the BART Legacy API?

BART does not publish an OpenAPI specification for its legacy data API. Jentic generates and maintains this spec so that AI agents and developers can call it via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the BART Legacy API use?

The API uses an API key passed as the key query parameter on every request. BART publishes a public testing key (MW9S-E7SL-26DU-VV8V) for development. When called through Jentic, the API key is held in your Jentic One instance and injected at execution time.

### Can I get real-time train departures with the BART API?

Yes. Call GET /etd.aspx with the originating station abbreviation (for example, orig=EMBR) and the API key. The response includes estimated departures by destination with minutes until arrival.

### What are the rate limits for the BART Legacy API?

BART does not publish formal rate limits for the legacy API; the public testing key is intended for low-volume development use. For production traffic, request a dedicated key from BART and cache station and route metadata locally to reduce repeat calls.

### How do I plan a BART trip through Jentic?

Install the Jentic SDK with pip install jentic, search for 'plan a bart trip', and execute /sched.aspx with origin and destination station codes. Jentic injects the API key as a query parameter and returns the itinerary JSON, which the agent can summarise as a text reply.

### Does the BART API expose elevator status?

Yes. The /bsa.aspx endpoint surfaces service advisories, elevator status, and current train count. It is the primary data source for accessibility-focused features and operational monitoring.

### Can I limit what my agent is allowed to do with the BART Legacy API?

Yes. Because you run Jentic One yourself, your own rules decide which BART operations your agent may call, so you can grant only the ones it needs, such as getting real-time departures from /etd.aspx or planning a trip with /sched.aspx, while leaving out station, route, or advisory lookups. Since the BART Legacy API is read-only, there are no write operations to expose, so a scoped agent can only read the transit data you allow. Your BART API key is stored by your own Jentic One instance and injected as the key query parameter at execution time, so it never reaches the agent's prompt or logs.
