Route Information API

Command: routeinfo

Inputs

Parameter Description
cmd=routeinfo Requests detailed information for a specific route. (Required)
key=<key> API registration key. (Required)
route=<route_num> Specifies the specific route information to return. In addition to route number (i.e. 1, 2, ... 12) 'all' can be specified to get the configuration information for all routes. (Required)
sched=<sched_num> Specifies a specific schedule to use. Defaults to current schedule. (Optional)
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 routes 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/route.aspx?cmd=routeinfo&route=6]]>
  </uri>
  <sched_num>43</sched_num>
  <routes>
    <route>
      <name>Daly City - Warm Springs/South Fremont</name>
      <abbr>DALY-WARM</abbr>
      <routeID>ROUTE 6</routeID>
      <number>6</number>
      <origin>DALY</origin>
      <destination>WARM</destination>
      <direction></direction>
      <hexcolor>#339933</hexcolor>
      <color>#339933</color>
      <holidays>0</holidays>
      <num_stns>20</num_stns>
      <config>
        <station>DALY</station>
        <station>BALB</station>
        <station>GLEN</station>
        <station>24TH</station>
        <station>16TH</station>
        <station>CIVC</station>
        <station>POWL</station>
        <station>MONT</station>
        <station>EMBR</station>
        <station>WOAK</station>
        <station>LAKE</station>
        <station>FTVL</station>
        <station>COLS</station>
        <station>SANL</station>
        <station>BAYF</station>
        <station>HAYW</station>
        <station>SHAY</station>
        <station>UCTY</station>
        <station>FRMT</station>
        <station>WARM</station>
      </config>
    </route>
  </routes>
  <message />
</root>

JSON Sample

{
   "?xml":{
      "@version":"1.0",
      "@encoding":"utf-8"
   },
   "root":{
      "uri":{
         "#cdata-section":"http://api.bart.gov/api/route.aspx?cmd=routeinfo&route=6&json=y"
      },
      "sched_num":"43",
      "routes":{
         "route":{
            "name":"Daly City - Warm Springs/South Fremont",
            "abbr":"DALY-WARM",
            "routeID":"ROUTE 6",
            "number":"6",
            "origin":"DALY",
            "destination":"WARM",
            "direction":"",
            "hexcolor":"#339933",
            "color":"#339933",
            "holidays":"0",
            "num_stns":"20",
            "config":{
               "station":[
                  "DALY",
                  "BALB",
                  "GLEN",
                  "24TH",
                  "16TH",
                  "CIVC",
                  "POWL",
                  "MONT",
                  "EMBR",
                  "WOAK",
                  "LAKE",
                  "FTVL",
                  "COLS",
                  "SANL",
                  "BAYF",
                  "HAYW",
                  "SHAY",
                  "UCTY",
                  "FRMT",
                  "WARM"
               ]
            }
         }
      },
      "message":null
   }
}

Notes

WARNING: the current "color" value is incorrect, it should be a text value (e.g. "ORANGE"). Please use the "hexcolor" value until the color value has been changed.

The configuration section lists the stations along the route in order from origin to destination.

Usage

XML: http://api.bart.gov/api/route.aspx?cmd=routeinfo&route=6&key=MW9S-E7SL-26DU-VV8V
JSON: http://api.bart.gov/api/route.aspx?cmd=routeinfo&route=6&key=MW9S-E7SL-26DU-VV8V&json=y