Schedule Information API

Command: depart

Inputs

Parameter Description
cmd=depart Requests a trip based on departing at the time specified. (Required)
key=<key> API registration key. (Required)
orig=<station> Specifies the origination station. Stations should be specified using the four character abbreviations. (Required)
dest=<station> Specifies the destination station. Stations should be specified using the four character abbreviations. (Required)
time=h:mm+am/pm Specifies the departure time for the trip. Using "time=now" is also valid and will return the specified trips based on the current time. If not specified, defaults to the current time. (Optional)
date=<mm/dd/yyyy> Specifies a specific date to use for calculating the trip. If not specified, the current date will be used. Also the terms "now" or "today" may be used instead of "mm/dd/yyyy". (Optional)
b=<number> This allows specifying how many trips before the specified time should be returned. This paramter defaults to 2, and can be set between 0 and 4. (Optional)
a=<number> This allows specifying how many trips after the specified time should be returned. This paramter defaults to 2, and can be set between 0 and 4. (Optional)
l=<number> Specifies whether the legend information should be included. By default it is 0 (not shown), but can be turned on by setting it to 1. (Optional)
json=y Returns API output in JSON format. Default output is XML if parameter not specified. (Optional)

Notes

See the discussion of BART Time for information on some quirks with the BART QuickPlanner.

Results

XML Sample

<?xml version="1.0" encoding="utf-8"?>
<root>
  <uri>
    <![CDATA[http://api.bart.gov/api/sched.aspx?cmd=depart&orig=ASHB&dest=CIVC&date=now&b=2&a=2&l=1]]>
  </uri>
  <origin>ASHB</origin>
  <destination>CIVC</destination>
  <sched_num>45</sched_num>
  <schedule>
    <date>Jan 2, 2018</date>
    <time>10:09 AM</time>
    <before>2</before>
    <after>2</after>
    <request>
      <trip origin="ASHB" destination="CIVC" fare="4.45" origTimeMin="9:57 AM" origTimeDate="01/02/2018 " destTimeMin="10:22 AM" destTimeDate="01/02/2018" clipper="1.45" tripTime="25" co2="8.62">
        <fares level="normal">
          <fare amount="3.95" class="clipper" name="Clipper"/>
          <fare amount="4.45" class="cash" name="BART Blue Ticket"/>
          <fare amount="1.45" class="rtcclipper" name="Senior/Disabled Clipper"/>
          <fare amount="1.95" class="student" name="Youth Clipper"/>
        </fares>
        <leg order="1" transfercode="" origin="ASHB" destination="CIVC" origTimeMin="9:57 AM" origTimeDate="01/02/2018" destTimeMin="10:22 AM" destTimeDate="01/02/2018" line="ROUTE 7" bikeflag="1" trainHeadStation="MLBR" load="1" trainId="4430942" trainIdx="23"/>
      </trip>
      <trip origin="ASHB" destination="CIVC" fare="4.45" origTimeMin="10:05 AM" origTimeDate="01/02/2018 " destTimeMin="10:29 AM" destTimeDate="01/02/2018" clipper="1.45" tripTime="24" co2="8.62">
        <fares level="normal">
          <fare amount="3.95" class="clipper" name="Clipper"/>
          <fare amount="4.45" class="cash" name="BART Blue Ticket"/>
          <fare amount="1.45" class="rtcclipper" name="Senior/Disabled Clipper"/>
          <fare amount="1.95" class="student" name="Youth Clipper"/>
        </fares>
        <leg order="1" transfercode="S" origin="ASHB" destination="MCAR" origTimeMin="10:05 AM" origTimeDate="01/02/2018" destTimeMin="10:08 AM" destTimeDate="01/02/2018" line="ROUTE 4" bikeflag="1" trainHeadStation="FRMT" load="2" trainId="2250950" trainIdx="23"/>
        <leg order="2" transfercode="" origin="MCAR" destination="CIVC" origTimeMin="10:08 AM" origTimeDate="01/02/2018" destTimeMin="10:29 AM" destTimeDate="01/02/2018" line="ROUTE 1" bikeflag="1" trainHeadStation="SFIA" load="2" trainId="3790932" trainIdx="37"/>
      </trip>
      <trip origin="ASHB" destination="CIVC" fare="4.45" origTimeMin="10:12 AM" origTimeDate="01/02/2018 " destTimeMin="10:37 AM" destTimeDate="01/02/2018" clipper="1.45" tripTime="25" co2="8.62">
        <fares level="normal">
          <fare amount="3.95" class="clipper" name="Clipper"/>
          <fare amount="4.45" class="cash" name="BART Blue Ticket"/>
          <fare amount="1.45" class="rtcclipper" name="Senior/Disabled Clipper"/>
          <fare amount="1.95" class="student" name="Youth Clipper"/>
        </fares>
        <leg order="1" transfercode="" origin="ASHB" destination="CIVC" origTimeMin="10:12 AM" origTimeDate="01/02/2018" destTimeMin="10:37 AM" destTimeDate="01/02/2018" line="ROUTE 7" bikeflag="1" trainHeadStation="MLBR" load="1" trainId="4450957" trainIdx="24"/>
      </trip>
      <trip origin="ASHB" destination="CIVC" fare="4.45" origTimeMin="10:20 AM" origTimeDate="01/02/2018 " destTimeMin="10:44 AM" destTimeDate="01/02/2018" clipper="1.45" tripTime="24" co2="8.62">
        <fares level="normal">
          <fare amount="3.95" class="clipper" name="Clipper"/>
          <fare amount="4.45" class="cash" name="BART Blue Ticket"/>
          <fare amount="1.45" class="rtcclipper" name="Senior/Disabled Clipper"/>
          <fare amount="1.95" class="student" name="Youth Clipper"/>
        </fares>
        <leg order="1" transfercode="S" origin="ASHB" destination="MCAR" origTimeMin="10:20 AM" origTimeDate="01/02/2018" destTimeMin="10:23 AM" destTimeDate="01/02/2018" line="ROUTE 4" bikeflag="1" trainHeadStation="FRMT" load="2" trainId="2271005" trainIdx="24"/>
        <leg order="2" transfercode="" origin="MCAR" destination="CIVC" origTimeMin="10:23 AM" origTimeDate="01/02/2018" destTimeMin="10:44 AM" destTimeDate="01/02/2018" line="ROUTE 1" bikeflag="1" trainHeadStation="SFIA" load="2" trainId="3810947" trainIdx="38"/>
      </trip>
    </request>
  </schedule>
  <message>
    <co2_emissions>
      <![CDATA[<p>CO<sub>2</sub> emissions saved by this BART trip: <strong>8.6 pounds.</strong> <a href="http://www.bart.gov/guide/carbon">Read more</a></p>]]>
    </co2_emissions>
    <legend>bikeflag: 1 = bikes allowed. 0 = no bikes allowed. transfercode: blank = no transfer, N = normal transfer, T = timed transfer, connecting trains will wait up to five minutes for transferring passengers. S = scheduled transfer, connecting trains will not wait for transferring passengers if there is a delay.</legend>
  </message>
</root>

JSON Sample

{  
   "?xml":{  
      "@version":"1.0",
      "@encoding":"utf-8"
   },
   "root":{  
      "@id":"1",
      "uri":{  
         "#cdata-section":"http://api.bart.gov/api/sched.aspx?cmd=depart&orig=ASHB&dest=CIVC&date=now&b=2&a=2&l=1&json=y"
      },
      "origin":"ASHB",
      "destination":"CIVC",
      "sched_num":"45",
      "schedule":{  
         "date":"Jan 2, 2018",
         "time":"10:10 AM",
         "before":"2",
         "after":"2",
         "request":{  
            "trip":[  
               {  
                  "@origin":"ASHB",
                  "@destination":"CIVC",
                  "@fare":"4.45",
                  "@origTimeMin":"9:57 AM",
                  "@origTimeDate":"01/02/2018 ",
                  "@destTimeMin":"10:22 AM",
                  "@destTimeDate":"01/02/2018",
                  "@clipper":"1.45",
                  "@tripTime":"25",
                  "@co2":"8.62",
                  "fares":{  
                     "@level":"normal",
                     "fare":[  
                        {  
                           "@amount":"3.95",
                           "@class":"clipper",
                           "@name":"Clipper"
                        },
                        {  
                           "@amount":"4.45",
                           "@class":"cash",
                           "@name":"BART Blue Ticket"
                        },
                        {  
                           "@amount":"1.45",
                           "@class":"rtcclipper",
                           "@name":"Senior/Disabled Clipper"
                        },
                        {  
                           "@amount":"1.95",
                           "@class":"student",
                           "@name":"Youth Clipper"
                        }
                     ]
                  },
                  "leg":[  
                     {  
                        "@order":"1",
                        "@transfercode":"",
                        "@origin":"ASHB",
                        "@destination":"CIVC",
                        "@origTimeMin":"9:57 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"10:22 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 7",
                        "@bikeflag":"1",
                        "@trainHeadStation":"MLBR",
                        "@load":"1",
                        "@trainId":"4430942",
                        "@trainIdx":"23"
                     }
                  ]
               },
               {  
                  "@origin":"ASHB",
                  "@destination":"CIVC",
                  "@fare":"4.45",
                  "@origTimeMin":"10:05 AM",
                  "@origTimeDate":"01/02/2018 ",
                  "@destTimeMin":"10:29 AM",
                  "@destTimeDate":"01/02/2018",
                  "@clipper":"1.45",
                  "@tripTime":"24",
                  "@co2":"8.62",
                  "fares":{  
                     "@level":"normal",
                     "fare":[  
                        {  
                           "@amount":"3.95",
                           "@class":"clipper",
                           "@name":"Clipper"
                        },
                        {  
                           "@amount":"4.45",
                           "@class":"cash",
                           "@name":"BART Blue Ticket"
                        },
                        {  
                           "@amount":"1.45",
                           "@class":"rtcclipper",
                           "@name":"Senior/Disabled Clipper"
                        },
                        {  
                           "@amount":"1.95",
                           "@class":"student",
                           "@name":"Youth Clipper"
                        }
                     ]
                  },
                  "leg":[  
                     {  
                        "@order":"1",
                        "@transfercode":"S",
                        "@origin":"ASHB",
                        "@destination":"MCAR",
                        "@origTimeMin":"10:05 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"10:08 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 4",
                        "@bikeflag":"1",
                        "@trainHeadStation":"FRMT",
                        "@load":"2",
                        "@trainId":"2250950",
                        "@trainIdx":"23"
                     },
                     {  
                        "@order":"2",
                        "@transfercode":"",
                        "@origin":"MCAR",
                        "@destination":"CIVC",
                        "@origTimeMin":"10:08 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"10:29 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 1",
                        "@bikeflag":"1",
                        "@trainHeadStation":"SFIA",
                        "@load":"2",
                        "@trainId":"3790932",
                        "@trainIdx":"37"
                     }
                  ]
               },
               {  
                  "@origin":"ASHB",
                  "@destination":"CIVC",
                  "@fare":"4.45",
                  "@origTimeMin":"10:12 AM",
                  "@origTimeDate":"01/02/2018 ",
                  "@destTimeMin":"10:37 AM",
                  "@destTimeDate":"01/02/2018",
                  "@clipper":"1.45",
                  "@tripTime":"25",
                  "@co2":"8.62",
                  "fares":{  
                     "@level":"normal",
                     "fare":[  
                        {  
                           "@amount":"3.95",
                           "@class":"clipper",
                           "@name":"Clipper"
                        },
                        {  
                           "@amount":"4.45",
                           "@class":"cash",
                           "@name":"BART Blue Ticket"
                        },
                        {  
                           "@amount":"1.45",
                           "@class":"rtcclipper",
                           "@name":"Senior/Disabled Clipper"
                        },
                        {  
                           "@amount":"1.95",
                           "@class":"student",
                           "@name":"Youth Clipper"
                        }
                     ]
                  },
                  "leg":[  
                     {  
                        "@order":"1",
                        "@transfercode":"",
                        "@origin":"ASHB",
                        "@destination":"CIVC",
                        "@origTimeMin":"10:12 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"10:37 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 7",
                        "@bikeflag":"1",
                        "@trainHeadStation":"MLBR",
                        "@load":"1",
                        "@trainId":"4450957",
                        "@trainIdx":"24"
                     }
                  ]
               },
               {  
                  "@origin":"ASHB",
                  "@destination":"CIVC",
                  "@fare":"4.45",
                  "@origTimeMin":"10:20 AM",
                  "@origTimeDate":"01/02/2018 ",
                  "@destTimeMin":"10:44 AM",
                  "@destTimeDate":"01/02/2018",
                  "@clipper":"1.45",
                  "@tripTime":"24",
                  "@co2":"8.62",
                  "fares":{  
                     "@level":"normal",
                     "fare":[  
                        {  
                           "@amount":"3.95",
                           "@class":"clipper",
                           "@name":"Clipper"
                        },
                        {  
                           "@amount":"4.45",
                           "@class":"cash",
                           "@name":"BART Blue Ticket"
                        },
                        {  
                           "@amount":"1.45",
                           "@class":"rtcclipper",
                           "@name":"Senior/Disabled Clipper"
                        },
                        {  
                           "@amount":"1.95",
                           "@class":"student",
                           "@name":"Youth Clipper"
                        }
                     ]
                  },
                  "leg":[  
                     {  
                        "@order":"1",
                        "@transfercode":"S",
                        "@origin":"ASHB",
                        "@destination":"MCAR",
                        "@origTimeMin":"10:20 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"10:23 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 4",
                        "@bikeflag":"1",
                        "@trainHeadStation":"FRMT",
                        "@load":"2",
                        "@trainId":"2271005",
                        "@trainIdx":"24"
                     },
                     {  
                        "@order":"2",
                        "@transfercode":"",
                        "@origin":"MCAR",
                        "@destination":"CIVC",
                        "@origTimeMin":"10:23 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"10:44 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 1",
                        "@bikeflag":"1",
                        "@trainHeadStation":"SFIA",
                        "@load":"2",
                        "@trainId":"3810947",
                        "@trainIdx":"38"
                     }
                  ]
               }
            ]
         }
      },
      "message":{  
         "co2_emissions":{  
            "#cdata-section":"

CO2 emissions saved by this BART trip: 8.6 pounds. Read more

" }, "legend":"bikeflag: 1 = bikes allowed. 0 = no bikes allowed. transfercode: blank = no transfer, N = normal transfer, T = timed transfer, connecting trains will wait up to five minutes for transferring passengers. S = scheduled transfer, connecting trains will not wait for transferring passengers if there is a delay." } } }

Notes

Usage

XML: http://api.bart.gov/api/sched.aspx?cmd=depart&orig=ASHB&dest=CIVC&date=now&key=MW9S-E7SL-26DU-VV8V&b=2&a=2&l=1
JSON: http://api.bart.gov/api/sched.aspx?cmd=depart&orig=ASHB&dest=CIVC&date=now&key=MW9S-E7SL-26DU-VV8V&b=2&a=2&l=1&json=y