Sunday, October 3, 2010

How I got data for Brisbane's CityCycle system.

The CityCycle system is based on a REST API which uses XML to display data.

The data can easily be parsed in languages such as PHP using the simplexml function.

CityCycle only uses 2 URLs to get information,

The first one is:
Which provides you with an XML list of all stations, the station number, longitude and latitude and if the station is open or not.

The other URL is:

Where "X" is the station number. (eg. stationdetails/52 which will display data for the Brunswick St Mall / Wickham St station)

Here is some sample PHP code that I've used in my KML creation scripts:

// Sample script by Adrian Lodders (http://BikeShare.Tel, http://CycleHire.Tel, http://CityCycle.Tel)
$xml = simplexml_load_file('') or die("Error: Unable to connect to the City Cycle Station Feed.");
$i = 0;
foreach ($xml->markers->marker as $item){
$name = $xml->markers->marker[$i]->attributes()->address;
echo "$name<br/>";

The script above will call the XML list of all stations, then display all names of each station until its gone through the whole list.

With this, its possible to use the station and its number in conjunction with an AJAX script to get the individual station data (rather then calling it all at once).

Anyway, I hope this helps.
Adrian Lodders

(ps. I didn’t test to see if the script above works cause its 12:21AM and daylight savings is about to kick in!)


  1. Great thoughts you got there, believe I may possibly try just some of it throughout my daily life.

    Used Bikes

  2. Is there a way to get Melbourne's station data in xml format like the other BIXI city?

  3. This is like one of the tips..Chafing and rash caused by bike shorts is a common problem for cyclists. Read how other cyclists avoid rashes and chafing or share tips and strategies of your own.Bikes Brisbane

  4. There's a "brisbane" in there now - e.g. (available bikes, free capacity, total capacity, ticket) has all the station data live. I don't know how that works. I can't imagine that they grab all 149 URLs every time you visit their site. Just replace with "melbourne" for Melbourne. Right now in Melbourne, there are 476 bikes available and a total of 903 bikes and free spots; in Brisbane last night there were 1361 bikes available and a total of 2934 bikes and free spots.

  5. Melbourne data is at