The Bits on the Run API can deliver the data returned with API calls in various formats. You can freely choose the format that best fits your needs. Because of its nature of nodes and attributes, the XML format slightly differs from the other output formats.
The following formats are supported:
Serialized Python (using the highest data stream protocol version (HIGHEST_PROTOCOL) of the pickle module)
The output format is specified using the api_format parameter. It MUST be provided with each API call.
The structure of the XML output format differs from the others formats, since XML allows for the use of attributes in its data structure (this is also recommended). Totals, keys and IDs are, for example, placed as attributes in XML. To illustrate, here’s a possible return from the /videos/list call in XML format:
<?xml version="1.0" encoding="UTF-8"?> <response> <status>ok</status> <videos total="22"> <video key="yYul4DRz"> <author>Bits on the Run</author> <date>1225962900</date> <description>New video</description> <duration>12.0</duration> <link>http://www.bitsontherun.com</link> <status>ready</status> <tags>new, video</tags> <title>New test video</title> </video> ... </videos> </response>
Here is the same return in PHP format. As you can see, the key attribute is a parameter and the total attribute is not returned as PHP count() function can be used to get total number of videos.
[status] => ok [videos] => Array (  => Array ( [status] => ready [description] => New video. [tags] => new, video [title] => New test video [duration] => 12.0 [link] => http://www.bitsontherun.com [author] => Bits on the Run [key] => yYul4DRz [date] => 1225962900 ... ) )