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[https://api.bart.gov/api/sched.aspx?cmd=stnsched&orig=12th&l=1]]>
  </uri>
  <date>6/27/2017</date>
  <station>
    <name>12th St. Oakland City Center</name>
    <abbr>12TH</abbr>
    <item line="ROUTE 7" trainHeadStation="Millbrae" origTime="05:23 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 1" trainHeadStation="San Francisco International Airport" origTime="05:30 AM" bikeflag="1" load="2"/>
	<item line="ROUTE 2" trainHeadStation="Antioch" origTime="05:33 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 7" trainHeadStation="Millbrae" origTime="05:36 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 3" trainHeadStation="Richmond" origTime="05:39 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 2" trainHeadStation="Antioch" origTime="05:40 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 1" trainHeadStation="San Francisco International Airport" origTime="05:45 AM" bikeflag="1" load="2"/>
	<item line="ROUTE 4" trainHeadStation="Warm Springs/South Fremont" origTime="05:47 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 7" trainHeadStation="Millbrae" origTime="05:51 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 3" trainHeadStation="Richmond" origTime="05:54 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 2" trainHeadStation="Antioch" origTime="05:55 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 1" trainHeadStation="San Francisco International Airport" origTime="06:00 AM" bikeflag="1" load="2"/>
	<item line="ROUTE 4" trainHeadStation="Warm Springs/South Fremont" origTime="06:02 AM" bikeflag="1" load="1"/>
...
    <item line="ROUTE 1" trainHeadStation="Millbrae" origTime="12:10 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 4" trainHeadStation="Warm Springs/South Fremont" origTime="12:13 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 2" trainHeadStation="Antioch" origTime="12:37 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 3" trainHeadStation="Richmond" origTime="12:39 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 1" trainHeadStation="San Francisco International Airport" origTime="12:51 AM" bikeflag="1" load="1"/>
	<item line="ROUTE 4" trainHeadStation="Warm Springs/South Fremont" origTime="12:53 AM" bikeflag="1" 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":"https://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":"Millbrae",
               "@origTime":"05:23 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 1",
               "@trainHeadStation":"San Francisco International Airport",
               "@origTime":"5:30 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 2",
               "@trainHeadStation":"Antioch",
               "@origTime":"5:33 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 7",
               "@trainHeadStation":"Millbrae",
               "@origTime":"5:36 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 3",
               "@trainHeadStation":"Richmond",
               "@origTime":"5:39 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 2",
               "@trainHeadStation":"Antioch",
               "@origTime":"5:40 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 1",
               "@trainHeadStation":"San Francisco International Airport",
               "@origTime":"5:45 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 4",
               "@trainHeadStation":"Warm Springs/South Fremont",
               "@origTime":"5:47 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 7",
               "@trainHeadStation":"Millbrae",
               "@origTime":"5:51 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 3",
               "@trainHeadStation":"Richmond",
               "@origTime":"5:54 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 2",
               "@trainHeadStation":"Antioch",
               "@origTime":"5:55 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
			{
               "@line":"ROUTE 1",
               "@trainHeadStation":"San Francisco International Airport",
               "@origTime":"6:00 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
			{
               "@line":"ROUTE 4",
               "@trainHeadStation":"Warm Springs/South Fremont",
               "@origTime":"6:02 AM",
               "@bikeflag":"1",
               "@load":"1"
            },			
...
            {
               "@line":"ROUTE 1",
               "@trainHeadStation":"Millbrae",
               "@origTime":"12:10 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 4",
               "@trainHeadStation":"Warm Springs/South Fremont",
               "@origTime":"12:13 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 2",
               "@trainHeadStation":"Antioch",
               "@origTime":"12:37 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 3",
               "@trainHeadStation":"Richmond",
               "@origTime":"12:39 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 1",
               "@trainHeadStation":"San Francisco International Airport",
               "@origTime":"12:51 AM",
               "@bikeflag":"1",
               "@load":"1"
            },
            {
               "@line":"ROUTE 4",
               "@trainHeadStation":"Warm Springs/South Fremont",
               "@origTime":"12:53 AM",
               "@bikeflag":"1",
               "@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: https://api.bart.gov/api/sched.aspx?cmd=stnsched&orig=12th&key=INSERT-KEY&l=1
JSON: https://api.bart.gov/api/sched.aspx?cmd=stnsched&orig=12th&key=INSERT-KEY&l=1&json=y