Real-Time Information API

Command: etd

Inputs

Parameter Description
cmd=etd Requests current departure information. (Required)
orig=<station> Specifies the station. Stations are referenced by their abbreviations. You can also use 'ALL' to get all of the current ETD's. (Required)
key=<key> API registration key. (Required)
plat=<platform> This will limit results to a specific platform. Valid platforms depend on the station, but can range from 1-4. (Optional)
dir=<dir> This will limit results to a specific direction. Valid directions are 'n' for Northbound and 's' for Southbound. (Optional)
json=y Returns API output in JSON format. Default output is XML if parameter not specified. (Optional)

Notes

The optional parameters 'plat' and 'dir' should not be used together. If they are, then the 'dir' parameter will be ignored and just the platform parameter will be used.

If 'ALL' is used for the orig station, then 'plat' and 'dir' cannot be used.

Results

XML Sample

<?xml version="1.0" encoding="utf-8"?>
<root>
  <uri>
    <![CDATA[http://api.bart.gov/api/etd.aspx?cmd=etd&orig=RICH]]>
  </uri>
  <date>08/14/2017</date>
  <time>10:22:16 AM PDT</time>
  <station>
    <name>Richmond</name>
    <abbr>RICH</abbr>
    <etd>
      <destination>Fremont</destination>
      <abbreviation>FRMT</abbreviation>
      <limited>0</limited>
      <estimate>
        <minutes>Leaving</minutes>
        <platform>2</platform>
        <direction>South</direction>
        <length>4</length>
        <color>ORANGE</color>
        <hexcolor>#ff9933</hexcolor>
        <bikeflag>1</bikeflag>
        <delay>238</delay>
      </estimate>
      <estimate>
        <minutes>12</minutes>
        <platform>2</platform>
        <direction>South</direction>
        <length>4</length>
        <color>ORANGE</color>
        <hexcolor>#ff9933</hexcolor>
        <bikeflag>1</bikeflag>
        <delay>0</delay>
      </estimate>
      <estimate>
        <minutes>27</minutes>
        <platform>2</platform>
        <direction>South</direction>
        <length>4</length>
        <color>ORANGE</color>
        <hexcolor>#ff9933</hexcolor>
        <bikeflag>1</bikeflag>
        <delay>0</delay>
      </estimate>
    </etd>
    <etd>
      <destination>Millbrae</destination>
      <abbreviation>MLBR</abbreviation>
      <limited>0</limited>
      <estimate>
        <minutes>4</minutes>
        <platform>2</platform>
        <direction>South</direction>
        <length>4</length>
        <color>RED</color>
        <hexcolor>#ff0000</hexcolor>
        <bikeflag>1</bikeflag>
        <delay>0</delay>
      </estimate>
      <estimate>
        <minutes>19</minutes>
        <platform>2</platform>
        <direction>South</direction>
        <length>5</length>
        <color>RED</color>
        <hexcolor>#ff0000</hexcolor>
        <bikeflag>1</bikeflag>
        <delay>0</delay>
      </estimate>
      <estimate>
        <minutes>34</minutes>
        <platform>2</platform>
        <direction>South</direction>
        <length>5</length>
        <color>RED</color>
        <hexcolor>#ff0000</hexcolor>
        <bikeflag>1</bikeflag>
        <delay>0</delay>
      </estimate>
    </etd>
  </station>
  <message></message>
</root>

JSON Sample

{
   "?xml":{
      "@version":"1.0",
      "@encoding":"utf-8"
   },
   "root":{
      "@id":"1",
      "uri":{
         "#cdata-section":"http://api.bart.gov/api/etd.aspx?cmd=etd&orig=RICH&json=y"
      },
      "date":"08/14/2017",
      "time":"10:20:31 AM PDT",
      "station":[
         {
            "name":"Richmond",
            "abbr":"RICH",
            "etd":[
               {
                  "destination":"Fremont",
                  "abbreviation":"FRMT",
                  "limited":"0",
                  "estimate":[
                     {
                        "minutes":"1",
                        "platform":"2",
                        "direction":"South",
                        "length":"4",
                        "color":"ORANGE",
                        "hexcolor":"#ff9933",
                        "bikeflag":"1",
                        "delay":"238"
                     },
                     {
                        "minutes":"13",
                        "platform":"2",
                        "direction":"South",
                        "length":"4",
                        "color":"ORANGE",
                        "hexcolor":"#ff9933",
                        "bikeflag":"1",
                        "delay":"0"
                     },
                     {
                        "minutes":"28",
                        "platform":"2",
                        "direction":"South",
                        "length":"4",
                        "color":"ORANGE",
                        "hexcolor":"#ff9933",
                        "bikeflag":"1",
                        "delay":"0"
                     }
                  ]
               },
               {
                  "destination":"Millbrae",
                  "abbreviation":"MLBR",
                  "limited":"0",
                  "estimate":[
                     {
                        "minutes":"6",
                        "platform":"2",
                        "direction":"South",
                        "length":"4",
                        "color":"RED",
                        "hexcolor":"#ff0000",
                        "bikeflag":"1",
                        "delay":"0"
                     },
                     {
                        "minutes":"21",
                        "platform":"2",
                        "direction":"South",
                        "length":"5",
                        "color":"RED",
                        "hexcolor":"#ff0000",
                        "bikeflag":"1",
                        "delay":"0"
                     },
                     {
                        "minutes":"36",
                        "platform":"2",
                        "direction":"South",
                        "length":"5",
                        "color":"RED",
                        "hexcolor":"#ff0000",
                        "bikeflag":"1",
                        "delay":"0"
                     }
                  ]
               }
            ]
         }
      ],
      "message":""
   }
}

Notes

The <delay> tag was added on 8/28/2017. Delay information is provided in seconds off of original scheduled time.

Usage

XML: http://api.bart.gov/api/etd.aspx?cmd=etd&orig=RICH&key=MW9S-E7SL-26DU-VV8V
JSON: http://api.bart.gov/api/etd.aspx?cmd=etd&orig=RICH&key=MW9S-E7SL-26DU-VV8V&json=y