BART API Output Formats
The BART API was originally developed to provide XML output for all commands. Recently BART has added an option to provide results in JSON format. The JSON format output is still in
The default format for BART API output is still XML. It is standard XML output with UTF-8 encoding. In order to facilitate conversion to JSON, any XML elements that have attributes DO NOT also have values. Most XML to JSON conversions can't interpret data if there is both an attribute and a value (e.g. <item id="1">orange</item>, the attribute "id" and the value of "orange" cause issues for most automated JSON conversion tools if used together.)
JSON Format (beta) New
In order to provide the JSON output, BART converts the standard XML output into JSON. Wherever there are items that may have one or more values, we force the JSON output to use arrays so that the JSON formatting is consistent no matter how many items there are. This should making parsing the JSON easier and consistent.
The JSON output format can be specifed for any call by adding "&json=y" to any API call. (e.g. http://api.bart.gov/api/etd.aspx?cmd=etd&orig=RICH&key=MW9S-E7SL-26DU-VV8V&json=y).
This format is still in beta. If you find any issues with using it, please contact BART through the BART Developers Forum.