Advisory Information API

Command: count

Inputs

Parameter Description
cmd=count Requests current count of trains active in the system (Required)
key=<key> API registration key (Required)
json=y Returns API output in JSON format. Default output is XML if parameter not specified. (Optional)

Results

XML Sample

<?xml version="1.0" encoding="utf-8" ?> 
<root>
  <uri><![CDATA[ http://api.bart.gov/api/bsa.aspx?cmd=count ]]></uri> 
  <date>10/14/2009</date> 
  <time>15:52:00 PM PDT</time> 
  <traincount>51</traincount> 
  <message /> 
</root>

JSON Sample

{
   "?xml":{
      "@version":"1.0",
      "@encoding":"utf-8"
   },
   "root":{
      "@id":"1",
      "uri":{
         "#cdata-section":"http://api.bart.gov/api/bsa.aspx?cmd=count&json=y"
      },
      "date":"06/26/2017",
      "time":"11:08:00 AM PDT",
      "traincount":"53",
      "message":""
   }
}

Notes

None.

Usage

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