Travel
BART logo

BART API

bart.gov

BART - Bay Area transit real-time departures, station directory, and trip planning.

Actions
6
Category
Travel
Login
Not required
Output
JSON

Call the BART API

Submit a task, then poll the job until it settles. This example runs act_bart_gov_realtime_departures.

curl -X POST https://api.anakin.io/v1/wire/task \
  -H "X-API-Key: $ANAKIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action_id": "act_bart_gov_realtime_departures",
    "params": {
      "station_code": "EMBR"
    }
  }'

6 actions on bart.gov

Read

  • Realtime Departures

    act_bart_gov_realtime_departuresread1 credit / call

    Returns live departure board rows with train lines, destinations, and ETA minutes for a station code.

    station_code
    string · required

Write

Write actions change state on bart.gov and run as the account you connect.

  • Station Autocomplete

    act_bart_gov_station_autocompletewrite2 credits / call

    Returns station and location matches with names, IDs, and coordinates for a search query.

    search_query
    string · required
    field
    string · required
    rnd
    string
  • Station Stop Directory

    act_bart_gov_station_stop_directorywrite2 credits / call

    Returns the inventory of stops with names, IDs, and coordinates.

    rnd
    string
  • Trip Planner

    act_bart_gov_trip_planner_searchwrite2 credits / call

    Returns multi-modal route options with connections, schedules, transfers, and total fare between origin and destination.

    origin_lid
    string · required
    origin_name
    string · required
    destination_lid
    string · required
    destination_name
    string · required
    rnd
    string
  • Trip Route Geometry

    act_bart_gov_trip_route_geometrywrite2 credits / call

    Returns map polyline geometry and stop coordinates for a planned trip route.

    gis_ctx
    string · required
    rnd
    string
  • Trip Share Summary

    act_bart_gov_trip_share_summarywrite2 credits / call

    Returns printable shareable itinerary text summarizing legs, times, and transfers for a planned trip.

    ctx_recon
    string · required
    rnd
    string

BART API questions

Is there an API for BART?
BART does not offer a public data API for this, but Anakin Wire provides 6 maintained endpoints for bart.gov. You call Anakin's REST API with an action ID and parameters and get structured JSON back; Anakin handles the browser, proxies, anti-bot, and parsing.
How do I scrape BART data?
POST to https://api.anakin.io/v1/wire/task with your API key, the action ID, and its parameters, then poll GET /v1/wire/jobs/{id} until the job settles. There is nothing to install and no scraper to maintain — when bart.gov changes its markup, Anakin updates the action.
Do I need a BART account?
No. Every BART action listed here runs anonymously — no account and no credentials required.
What does the BART API cost?
Usage-based credits, charged per call and refunded automatically when a job fails. New accounts start with 300 free credits and no card. See anakin.io/pricing for the current rates.

More Travel APIs

All Travel sites