Schedule Information API

Command: routesched

Inputs

Parameter Description
cmd=routesched Requests detailed schedule information for a specific route. (Required)
route=<route_num> Specifies a route information to return (i.e. 1, 2, ... 12). (Required)
key=<key> API registration key. (Required)
date=<mm/dd/yyyy>
or <wd|sa|su>
Specifies which date to use. 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". New options for generic schedules have been added: "wd", "sa", and "su" for weekday, Saturday and Sunday. (Optional)
time=<hh:mm tt> Specifies what time to use. If none is specified, then the curren time is used. Times are only relevant if they are between midnight and BART midnight. In that case, the actual schedule shown will be for the prior day, which matches the output of other schedule commands, and a warning will appear in the <Message> block. (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)
sched=<sched_num> Specifies a specific schedule to use. Defaults to current schedule. This will override any date specified, so might provide incorrect results. (Optional)
json=y Returns API output in JSON format. Default output is XML if parameter not specified. (Optional)

Notes

Results

XML Sample

<?xml version="1.0" encoding="utf-8"?>
<root>
  <uri>
    <![CDATA[http://api.bart.gov/api/sched.aspx?cmd=routesched&route=6&time=01:47+am]]>
  </uri>
  <date>1/18/2017</date>
  <sched_num>39</sched_num>
  <route>
    <train trainId="101050613" trainIdx="1" index="1">
      <stop station="DALY" load="1" level="normal" origTime="6:13 AM" bikeflag="1"/>
      <stop station="BALB" load="1" level="normal" origTime="6:17 AM" bikeflag="1"/>
      <stop station="GLEN" load="1" level="normal" origTime="6:19 AM" bikeflag="1"/>
      <stop station="24TH" load="1" level="normal" origTime="6:22 AM" bikeflag="1"/>
      <stop station="16TH" load="1" level="normal" origTime="6:24 AM" bikeflag="1"/>
      <stop station="CIVC" load="1" level="normal" origTime="6:26 AM" bikeflag="1"/>
      <stop station="POWL" load="1" level="normal" origTime="6:27 AM" bikeflag="1"/>
      <stop station="MONT" load="1" level="normal" origTime="6:29 AM" bikeflag="1"/>
      <stop station="EMBR" load="1" level="normal" origTime="6:30 AM" bikeflag="1"/>
      <stop station="WOAK" load="1" level="normal" origTime="6:37 AM" bikeflag="1"/>
      <stop station="LAKE" load="1" level="normal" origTime="6:43 AM" bikeflag="1"/>
      <stop station="FTVL" load="1" level="normal" origTime="6:46 AM" bikeflag="1"/>
      <stop station="COLS" load="1" level="normal" origTime="6:50 AM" bikeflag="1"/>
      <stop station="SANL" load="1" level="normal" origTime="6:54 AM" bikeflag="1"/>
      <stop station="BAYF" load="1" level="normal" origTime="6:57 AM" bikeflag="1"/>
      <stop station="HAYW" load="1" level="normal" origTime="7:01 AM" bikeflag="1"/>
      <stop station="SHAY" load="1" level="normal" origTime="7:05 AM" bikeflag="1"/>
      <stop station="UCTY" load="1" level="normal" origTime="7:10 AM" bikeflag="1"/>
      <stop station="FRMT" load="1" level="normal" origTime="7:16 AM" bikeflag="1"/>
    </train>
    ...
    <train trainId="113091858" trainIdx="52" index="52">
      <stop station="DALY" load="1" level="normal" origTime="6:58 PM" bikeflag="1"/>
      <stop station="BALB" load="1" level="normal" origTime="7:02 PM" bikeflag="1"/>
      <stop station="GLEN" load="1" level="normal" origTime="7:04 PM" bikeflag="1"/>
      <stop station="24TH" load="1" level="normal" origTime="7:07 PM" bikeflag="1"/>
      <stop station="16TH" load="1" level="normal" origTime="7:09 PM" bikeflag="1"/>
      <stop station="CIVC" load="1" level="normal" origTime="7:11 PM" bikeflag="1"/>
      <stop station="POWL" load="1" level="normal" origTime="7:12 PM" bikeflag="1"/>
      <stop station="MONT" load="1" level="normal" origTime="7:14 PM" bikeflag="1"/>
      <stop station="EMBR" load="1" level="normal" origTime="7:15 PM" bikeflag="1"/>
      <stop station="WOAK" load="1" level="normal" origTime="7:22 PM" bikeflag="1"/>
      <stop station="LAKE" load="1" level="normal" origTime="7:28 PM" bikeflag="1"/>
      <stop station="FTVL" load="1" level="normal" origTime="7:31 PM" bikeflag="1"/>
      <stop station="COLS" load="1" level="normal" origTime="7:35 PM" bikeflag="1"/>
      <stop station="SANL" load="1" level="normal" origTime="7:39 PM" bikeflag="1"/>
      <stop station="BAYF" load="1" level="normal" origTime="7:42 PM" bikeflag="1"/>
      <stop station="HAYW" load="1" level="normal" origTime="7:46 PM" bikeflag="1"/>
      <stop station="SHAY" load="1" level="normal" origTime="7:50 PM" bikeflag="1"/>
      <stop station="UCTY" load="1" level="normal" origTime="7:55 PM" bikeflag="1"/>
      <stop station="FRMT" load="1" level="normal" origTime="8:01 PM" bikeflag="1"/>
    </train>
  </route>
  <message>
    <warning>The time specified is within the previous schedule day. For details see http://api.bart.gov/docs/overview/barttime.aspx</warning>
    <special_schedule>
      <![CDATA[Elevator to Fremont platform out for new flooring 1/17-20.  <a href="http://www.bart.gov/news/articles/2017/news20170109">Read more...</a><br><br>Elevator out for flooring repair at MacArthur 1/17 to 1/20.  <a href="http://www.bart.gov/news/articles/2017/news20170103-2">Read more...</a><br><br>Pleasant Hill parking garage elevators will be out of service one at a time through 2017. <a href="http://www.bart.gov/news/articles/2016/news20161130">Read more...</a>]]>
    </special_schedule>
  </message>
</root>

JSON Sample

{
   "?xml":{
      "@version":"1.0",
      "@encoding":"utf-8"
   },
   "root":{
      "uri":{
         "#cdata-section":"http://api.bart.gov/api/sched.aspx?cmd=routesched&route=6&time=12:47+am&json=y"
      },
      "date":"6/27/2017",
      "sched_num":"43",
      "route":{
         "train":[
            {
               "@trainId":"1090441",
               "@trainIdx":"1",
               "@index":"1",
               "stop":[
                  {
                     "@station":"DALY",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"BALB",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"GLEN",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"24TH",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"16TH",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"CIVC",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"POWL",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"MONT",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"EMBR",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"WOAK",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"LAKE",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"FTVL",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"COLS",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"SANL",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"BAYF",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"HAYW",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"SHAY",
                     "@load":"",
                     "@level":"",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"UCTY",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"4:41 AM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"FRMT",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"4:46 AM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"WARM",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"4:53 AM",
                     "@bikeflag":"1"
                  }
               ]
            },
            {
               "@trainId":"1111856",
               "@trainIdx":"62",
               "@index":"62",
               "stop":[
                  {
                     "@station":"DALY",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"6:56 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"BALB",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:00 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"GLEN",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:02 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"24TH",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:05 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"16TH",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:07 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"CIVC",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:09 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"POWL",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:11 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"MONT",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:12 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"EMBR",
                     "@load":"2",
                     "@level":"normal",
                     "@origTime":"7:14 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"WOAK",
                     "@load":"2",
                     "@level":"normal",
                     "@origTime":"7:21 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"LAKE",
                     "@load":"2",
                     "@level":"normal",
                     "@origTime":"7:26 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"FTVL",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:30 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"COLS",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:33 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"SANL",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:37 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"BAYF",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:41 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"HAYW",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:45 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"SHAY",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:48 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"UCTY",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:53 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"FRMT",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"7:58 PM",
                     "@bikeflag":"1"
                  },
                  {
                     "@station":"WARM",
                     "@load":"1",
                     "@level":"normal",
                     "@origTime":"8:05 PM",
                     "@bikeflag":"1"
                  }
               ]
            }
         ]
      },
      "message":{
         "warning":"The time specified is within the previous schedule day. For details see http://api.bart.gov/docs/overview/barttime.aspx",
         "special_schedule":{
            "#cdata-section":"Some Pleasant Hill parking garage elevators will be out of service through 2017. <a href=\"http://www.bart.gov/news/articles/2016/news20161130\">Read more...</a>"
         }
      }
   }
}

Notes

Usage

XML: http://api.bart.gov/api/sched.aspx?cmd=routesched&route=6&key=MW9S-E7SL-26DU-VV8V&time=12:47+am
http://api.bart.gov/api/sched.aspx?cmd=routesched&route=6&key=MW9S-E7SL-26DU-VV8V&time=12:47+am&json=y