Extracting Your Data from the AudioBoo API

by @edent | # # # | 3 comments | Read ~477 times.

Earlier this week, I wrote about the Future of AudioBoo. I’m sure the service is going to be just fine – but thought it would be an interesting exercise to liberate my data from there just in case.

As I begin the move to decentralised services where possible, I think it’s important that I take responsibility for my own data.

The API docs for AudioBoo are very clear, so here’s a quick guide on how to download all you Boos and (most of) their data.

Get All Your Boos

The AudioBoo API – unlike some – doesn’t require any authentication. It also doesn’t restrict you to only downloading your own data. So, if you want to swim in Stephen Fry’s vocal delights, go right ahead!

The API call is very simple:


You can grab up to 150 items at a time. To move the the next page of items, change the “page[number]=” to 2 – and so on.

Examining The Data

Each page of data starts with something similar to:


This tells us how many Boos there are (in my case, 64) and – if we’re no longer on page 1 – which number Boo to start with.

The Boo’s Data

Boos are presented in reverse chronological order – the most recent first.

Here is what an individual Boo’s JSON looks like – it’s fairly simple and self explanatory.

"title":"QR Codes at OpenTech",
    "description":"City of London, Camden Town, United Kingdom",
        "display_tag":"open data",

The two fields which we’re probably most interested in are “high_mp3” which gives you the URL to a high quality MP3 recording, and “image” which contains the picture you associated with the Boo. As you can see – the data is fairly comprehensive. Perhaps the only thing it is missing are the comments. You get told the number of comments left, but not their content.

Parsing The Data

Once you’ve called the API and got a response, it’s trivial to extract your data for use.

$json = json_decode($string,true);
$audio = $json["body"]["audio_clips"];

foreach ($audio as $key)
    $mp3 = $key["urls"]["high_mp3"];
    $image = $key["urls"]["image"];
    // Do Something...

Personally, I wrote the URLs to a file, then used wget to download all the mp3s and images. You could also write the data to CSV or something similar and then import it into WordPress (or your blogging platform of choice).


Perhaps the only minor downside is that the files are MP3s. I thought that AudioBoo stored them as FLAC. That said, MP3s are more than adequate for voice recordings. They also have fully comprehensive ID3 tags.
The lack of comments is a little sad – but my Boos never quite garnered enough interest to attract much attention.

There are no download limiations that I ran into. I quite happily scoffed down 5GB of data as fast as they could send it to me.

So, there you have it! A simple way to download all your AudioBoo data. Here’s a quick PHP file which should download your first 150 Boos – good luck!

$AudioBooAPIresponse = file_get_contents("http://api.audioboo.fm/audio_clips?username=YOUR-USERNAME&page[items]=150&page[number]=1");
$json = json_decode($AudioBooAPIresponse,true);
$AudioClips = $json["body"]["audio_clips"];

foreach ($AudioClips as $key)
    $id           = $key["id"];
    $title        = $key["title"];
    $description  = $key["description"];
    $recorded_at  = $key["recorded_at"];
    $location     = $key["location"]["description"];
    $longitude    = $key["location"]["longitude"];
    $latitude     = $key["location"]["latitude"];
    $accuracy     = $key["location"]["accuracy"];
    $original     = $key["urls"]["detail"];
    $mp3          = $key["urls"]["high_mp3"];
    $image        = $key["urls"]["image"];
    $duration     = $key["duration"];
    $mp3_filesize = $key["mp3_filesize"];

    //  Save The Files
    $mp3_file = file_get_contents($mp3);
    file_put_contents($id . ".mp3", $mp3_file);

    $image_file = file_get_contents($image);
    file_put_contents($id . ".jpg", $image_file);

3 thoughts on “Extracting Your Data from the AudioBoo API

  1. Mark Rock says:

    The flac files are 240m down in a facility in Nevada. And whilst I’m glad we’ve made it that simple to retrieve all your boos, don’t worry. The originals are safe with us.

    1. Very impressed with the API. Hope the files are triple encrypted and protected by wolves.

  2. Thanks for sharing this, really useful – I’ve just downloaded all of mine and learned about parsing json in php! Ta very much 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *