Soundcloud API get tracks by userid
This fiddle demonstrates the retrieval of tracks of a specific user by the user's soundcloud id (user_id)
HTML
<script src="//connect.soundcloud.com/sdk.js"></script>
<body>
<ol id="track-list"></ol>
</body>
JavaScript
SC.initialize({
client_id: "6QvdRwJ2FQEAWlMafWqRjnI9hsdVKNeE",
redirect_uri: "http://example.com/callback.html",
});
/**
Once that's done you are all set and ready to call the SoundCloud API.
**/
/**
Call to the SoundCloud API.
Retrieves list of tracks, and displays a list with links to the tracks showing 'tracktitle' and 'track duration'
**/
var userId = 39090345; // user_id of Prutsonic
SC.get("/tracks", {
user_id: userId,
limit: 1000000
}, function (tracks) {
var tmp = '';
for (var i = 0; i < tracks.length; i++) {
tmp = '<a href="' + tracks[i].permalink_url + '">' + tracks[i].title + ' - ' + tracks[i].duration + '</a>';
$("<li/>").html(tmp).appendTo("#track-list");
}
});