Schedule Information API

Command: arrive

Inputs

Parameter Description
cmd=arrive Requests a trip based on arriving 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 arrival 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. This will determine the appropriate schedule for that date, and give back information about the lines for that schedule. Date can also be specified as "today" or "now". The default is the current date. The date range period is 10 days in the past and 8 weeks in future. (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 1 and 4. (Optional)
Sum of a & b Sum of a and b has to be less or equal to 6. These parameters defaults to 3 each if sum of a and b is more than 6
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=arrive&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>9:49 AM</time>
    <before>2</before>
    <after>2</after>
    <request>
      <trip origin="ASHB" destination="CIVC" fare="4.45" origTimeMin="9:12 AM" origTimeDate="01/02/2018 " destTimeMin="9: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="9:12 AM" origTimeDate="01/02/2018" destTimeMin="9:37 AM" destTimeDate="01/02/2018" line="ROUTE 7" bikeflag="1" trainHeadStation="Millbrae" load="2" trainId="4590857" trainIdx="20"/>
      </trip>
      <trip origin="ASHB" destination="CIVC" fare="4.45" origTimeMin="9:20 AM" origTimeDate="01/02/2018 " destTimeMin="9: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="9:20 AM" origTimeDate="01/02/2018" destTimeMin="9:23 AM" destTimeDate="01/02/2018" line="ROUTE 4" bikeflag="1" trainHeadStation="Warm Springs/South Fremont" load="2" trainId="2390905" trainIdx="20"/>
        <leg order="2" transfercode="" origin="MCAR" destination="CIVC" origTimeMin="9:23 AM" origTimeDate="01/02/2018" destTimeMin="9:44 AM" destTimeDate="01/02/2018" line="ROUTE 1" bikeflag="1" trainHeadStation="San Francisco International Airport" load="2" trainId="3730847" trainIdx="34"/>
      </trip>
      <trip origin="ASHB" destination="CIVC" fare="4.45" origTimeMin="9:27 AM" origTimeDate="01/02/2018 " destTimeMin="9:52 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:27 AM" origTimeDate="01/02/2018" destTimeMin="9:52 AM" destTimeDate="01/02/2018" line="ROUTE 7" bikeflag="1" trainHeadStation="Millbrae" load="1" trainId="4610912" trainIdx="21"/>
      </trip>
      <trip origin="ASHB" destination="CIVC" fare="4.45" origTimeMin="9:35 AM" origTimeDate="01/02/2018 " destTimeMin="9:59 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="9:35 AM" origTimeDate="01/02/2018" destTimeMin="9:38 AM" destTimeDate="01/02/2018" line="ROUTE 4" bikeflag="1" trainHeadStation="Warm Springs/South Fremont" load="1" trainId="2210920" trainIdx="21"/>
        <leg order="2" transfercode="" origin="MCAR" destination="CIVC" origTimeMin="9:38 AM" origTimeDate="01/02/2018" destTimeMin="9:59 AM" destTimeDate="01/02/2018" line="ROUTE 1" bikeflag="1" trainHeadStation="San Francisco International Airport" load="2" trainId="3750902" trainIdx="35"/>
      </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=arrive&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":"9:51 AM",
         "before":"2",
         "after":"2",
         "request":{  
            "trip":[  
               {  
                  "@origin":"ASHB",
                  "@destination":"CIVC",
                  "@fare":"4.45",
                  "@origTimeMin":"9:12 AM",
                  "@origTimeDate":"01/02/2018 ",
                  "@destTimeMin":"9: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":"9:12 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"9:37 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 7",
                        "@bikeflag":"1",
                        "@trainHeadStation":"Millbrae",
                        "@load":"2",
                        "@trainId":"4590857",
                        "@trainIdx":"20"
                     }
                  ]
               },
               {  
                  "@origin":"ASHB",
                  "@destination":"CIVC",
                  "@fare":"4.45",
                  "@origTimeMin":"9:20 AM",
                  "@origTimeDate":"01/02/2018 ",
                  "@destTimeMin":"9: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":"9:20 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"9:23 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 4",
                        "@bikeflag":"1",
                        "@trainHeadStation":"Warm Springs/South Fremont",
                        "@load":"2",
                        "@trainId":"2390905",
                        "@trainIdx":"20"
                     },
                     {  
                        "@order":"2",
                        "@transfercode":"",
                        "@origin":"MCAR",
                        "@destination":"CIVC",
                        "@origTimeMin":"9:23 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"9:44 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 1",
                        "@bikeflag":"1",
                        "@trainHeadStation":"San Francisco International Airport",
                        "@load":"2",
                        "@trainId":"3730847",
                        "@trainIdx":"34"
                     }
                  ]
               },
               {  
                  "@origin":"ASHB",
                  "@destination":"CIVC",
                  "@fare":"4.45",
                  "@origTimeMin":"9:27 AM",
                  "@origTimeDate":"01/02/2018 ",
                  "@destTimeMin":"9:52 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:27 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"9:52 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 7",
                        "@bikeflag":"1",
                        "@trainHeadStation":"Millbrae",
                        "@load":"1",
                        "@trainId":"4610912",
                        "@trainIdx":"21"
                     }
                  ]
               },
               {  
                  "@origin":"ASHB",
                  "@destination":"CIVC",
                  "@fare":"4.45",
                  "@origTimeMin":"9:35 AM",
                  "@origTimeDate":"01/02/2018 ",
                  "@destTimeMin":"9:59 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":"9:35 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"9:38 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 4",
                        "@bikeflag":"1",
                        "@trainHeadStation":"Warm Springs/South Fremont",
                        "@load":"1",
                        "@trainId":"2210920",
                        "@trainIdx":"21"
                     },
                     {  
                        "@order":"2",
                        "@transfercode":"",
                        "@origin":"MCAR",
                        "@destination":"CIVC",
                        "@origTimeMin":"9:38 AM",
                        "@origTimeDate":"01/02/2018",
                        "@destTimeMin":"9:59 AM",
                        "@destTimeDate":"01/02/2018",
                        "@line":"ROUTE 1",
                        "@bikeflag":"1",
                        "@trainHeadStation":"San Francisco International Airport",
                        "@load":"2",
                        "@trainId":"3750902",
                        "@trainIdx":"35"
                     }
                  ]
               }
            ]
         }
      },
      "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=arrive&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=arrive&orig=ASHB&dest=CIVC&date=now&key=MW9S-E7SL-26DU-VV8V&b=2&a=2&l=1&json=y