Schedule Information API

Command: stnsched

Inputs

Parameter Description
cmd=stnsched Requests detailed scheduled information for a specific station. (Required)
key=<key> API registration key. (Required)
orig=<stn> The station for which a schedule is requested. (Required)
date=<mm/dd/yyyy> Specifies a specific date to use. This will determine the appropriate schedule for that date, and give back information about the station for that schedule. Date can also be specified as "today" or "now". (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=stnsched&orig=12th&l=1]]>
  </uri>
  <date>6/27/2017</date>
  <sched_num>43</sched_num>
  <station>
    <name>12th St. Oakland City Center</name>
    <abbr>12TH</abbr>
    <item line="ROUTE 7" trainHeadStation="MLBR" origTime="4:36 AM" destTime="5:20 AM" trainIdx="1" bikeflag="1" trainId="4430412" load="1"/>
    <item line="ROUTE 2" trainHeadStation="PITT" origTime="4:37 AM" destTime="5:17 AM" trainIdx="1" bikeflag="1" trainId="3730409" load="1"/>
    <item line="ROUTE 3" trainHeadStation="RICH" origTime="4:37 AM" destTime="5:01 AM" trainIdx="1" bikeflag="1" trainId="2290400" load="1"/>
    <item line="ROUTE 1" trainHeadStation="SFIA" origTime="4:43 AM" destTime="5:27 AM" trainIdx="1" bikeflag="1" trainId="3610402" load="1"/>
    <item line="ROUTE 4" trainHeadStation="FRMT" origTime="4:45 AM" destTime="5:20 AM" trainIdx="1" bikeflag="1" trainId="2210420" load="1"/>
    <item line="ROUTE 7" trainHeadStation="MLBR" origTime="4:51 AM" destTime="5:35 AM" trainIdx="2" bikeflag="1" trainId="4450427" load="1"/>
    <item line="ROUTE 2" trainHeadStation="PITT" origTime="4:52 AM" destTime="5:32 AM" trainIdx="2" bikeflag="1" trainId="3750351" load="1"/>
    <item line="ROUTE 3" trainHeadStation="RICH" origTime="4:52 AM" destTime="5:16 AM" trainIdx="2" bikeflag="1" trainId="2310415" load="1"/>
    <item line="ROUTE 1" trainHeadStation="SFIA" origTime="4:58 AM" destTime="5:42 AM" trainIdx="2" bikeflag="1" trainId="3630417" load="1"/>
    <item line="ROUTE 4" trainHeadStation="FRMT" origTime="5:00 AM" destTime="5:35 AM" trainIdx="2" bikeflag="1" trainId="2230435" load="1"/>
...
    <item line="ROUTE 3" trainHeadStation="RICH" origTime="12:16 AM" destTime="12:41 AM" trainIdx="75" bikeflag="1" trainId="2232333" load="1"/>
    <item line="ROUTE 1" trainHeadStation="MLBR" origTime="12:20 AM" destTime="1:11 AM" trainIdx="95" bikeflag="1" trainId="3612337" load="1"/>
    <item line="ROUTE 4" trainHeadStation="WARM" origTime="12:22 AM" destTime="1:04 AM" trainIdx="75" bikeflag="1" trainId="2372355" load="1"/>
    <item line="ROUTE 3" trainHeadStation="RICH" origTime="12:36 AM" destTime="1:04 AM" trainIdx="76" bikeflag="1" trainId="2252353" load="1"/>
    <item line="ROUTE 2" trainHeadStation="PITT" origTime="12:37 AM" destTime="1:20 AM" trainIdx="96" bikeflag="1" trainId="3772349" load="1"/>
    <item line="ROUTE 1" trainHeadStation="SFIA" origTime="12:51 AM" destTime="1:34 AM" trainIdx="96" bikeflag="1" trainId="3632359" load="1"/>
    <item line="ROUTE 4" trainHeadStation="WARM" origTime="12:53 AM" destTime="1:34 AM" trainIdx="76" bikeflag="1" trainId="2390017" load="1"/>
  </station>
  <message>
    <legend>bikeflag = 1, bikes allowed. bikeflag = 0, no bikes allowed.</legend>
  </message>
</root>

JSON Sample

{
   "?xml":{
      "@version":"1.0",
      "@encoding":"utf-8"
   },
   "root":{
      "uri":{
         "#cdata-section":"http://api.bart.gov/api/sched.aspx?cmd=stnsched&orig=12th&l=1&json=y"
      },
      "date":"6/27/2017",
      "sched_num":"43",
      "station":{
         "name":"12th St. Oakland City Center",
         "abbr":"12TH",
         "item":[
            {
               "@line":"ROUTE 7",
               "@trainHeadStation":"MLBR",
               "@origTime":"4:36 AM",
               "@destTime":"5:20 AM",
               "@trainIdx":"1",
               "@bikeflag":"1",
               "@trainId":"4430412",
               "@load":"1"
            },
            {
               "@line":"ROUTE 2",
               "@trainHeadStation":"PITT",
               "@origTime":"4:37 AM",
               "@destTime":"5:17 AM",
               "@trainIdx":"1",
               "@bikeflag":"1",
               "@trainId":"3730409",
               "@load":"1"
            },
            {
               "@line":"ROUTE 3",
               "@trainHeadStation":"RICH",
               "@origTime":"4:37 AM",
               "@destTime":"5:01 AM",
               "@trainIdx":"1",
               "@bikeflag":"1",
               "@trainId":"2290400",
               "@load":"1"
            },
            {
               "@line":"ROUTE 1",
               "@trainHeadStation":"SFIA",
               "@origTime":"4:43 AM",
               "@destTime":"5:27 AM",
               "@trainIdx":"1",
               "@bikeflag":"1",
               "@trainId":"3610402",
               "@load":"1"
            },
            {
               "@line":"ROUTE 4",
               "@trainHeadStation":"FRMT",
               "@origTime":"4:45 AM",
               "@destTime":"5:20 AM",
               "@trainIdx":"1",
               "@bikeflag":"1",
               "@trainId":"2210420",
               "@load":"1"
            },
            {
               "@line":"ROUTE 7",
               "@trainHeadStation":"MLBR",
               "@origTime":"4:51 AM",
               "@destTime":"5:35 AM",
               "@trainIdx":"2",
               "@bikeflag":"1",
               "@trainId":"4450427",
               "@load":"1"
            },
            {
               "@line":"ROUTE 2",
               "@trainHeadStation":"PITT",
               "@origTime":"4:52 AM",
               "@destTime":"5:32 AM",
               "@trainIdx":"2",
               "@bikeflag":"1",
               "@trainId":"3750351",
               "@load":"1"
            },
            {
               "@line":"ROUTE 3",
               "@trainHeadStation":"RICH",
               "@origTime":"4:52 AM",
               "@destTime":"5:16 AM",
               "@trainIdx":"2",
               "@bikeflag":"1",
               "@trainId":"2310415",
               "@load":"1"
            },
            {
               "@line":"ROUTE 1",
               "@trainHeadStation":"SFIA",
               "@origTime":"4:58 AM",
               "@destTime":"5:42 AM",
               "@trainIdx":"2",
               "@bikeflag":"1",
               "@trainId":"3630417",
               "@load":"1"
            },
            {
               "@line":"ROUTE 4",
               "@trainHeadStation":"FRMT",
               "@origTime":"5:00 AM",
               "@destTime":"5:35 AM",
               "@trainIdx":"2",
               "@bikeflag":"1",
               "@trainId":"2230435",
               "@load":"1"
            },
...
            {
               "@line":"ROUTE 3",
               "@trainHeadStation":"RICH",
               "@origTime":"12:16 AM",
               "@destTime":"12:41 AM",
               "@trainIdx":"75",
               "@bikeflag":"1",
               "@trainId":"2232333",
               "@load":"1"
            },
            {
               "@line":"ROUTE 1",
               "@trainHeadStation":"MLBR",
               "@origTime":"12:20 AM",
               "@destTime":"1:11 AM",
               "@trainIdx":"95",
               "@bikeflag":"1",
               "@trainId":"3612337",
               "@load":"1"
            },
            {
               "@line":"ROUTE 4",
               "@trainHeadStation":"WARM",
               "@origTime":"12:22 AM",
               "@destTime":"1:04 AM",
               "@trainIdx":"75",
               "@bikeflag":"1",
               "@trainId":"2372355",
               "@load":"1"
            },
            {
               "@line":"ROUTE 3",
               "@trainHeadStation":"RICH",
               "@origTime":"12:36 AM",
               "@destTime":"1:04 AM",
               "@trainIdx":"76",
               "@bikeflag":"1",
               "@trainId":"2252353",
               "@load":"1"
            },
            {
               "@line":"ROUTE 2",
               "@trainHeadStation":"PITT",
               "@origTime":"12:37 AM",
               "@destTime":"1:20 AM",
               "@trainIdx":"96",
               "@bikeflag":"1",
               "@trainId":"3772349",
               "@load":"1"
            },
            {
               "@line":"ROUTE 1",
               "@trainHeadStation":"SFIA",
               "@origTime":"12:51 AM",
               "@destTime":"1:34 AM",
               "@trainIdx":"96",
               "@bikeflag":"1",
               "@trainId":"3632359",
               "@load":"1"
            },
            {
               "@line":"ROUTE 4",
               "@trainHeadStation":"WARM",
               "@origTime":"12:53 AM",
               "@destTime":"1:34 AM",
               "@trainIdx":"76",
               "@bikeflag":"1",
               "@trainId":"2390017",
               "@load":"1"
            }
         ]
      },
      "message":{
         "legend":"bikeflag = 1, bikes allowed. bikeflag = 0, no bikes allowed."
      }
   }
}

Notes

Any error messages will be included in an <error> item under the <message> element.

Usage

XML: http://api.bart.gov/api/sched.aspx?cmd=stnsched&orig=12th&key=MW9S-E7SL-26DU-VV8V&l=1
JSON: http://api.bart.gov/api/sched.aspx?cmd=stnsched&orig=12th&key=MW9S-E7SL-26DU-VV8V&l=1&json=y