Skip to content
This repository

SoundCloud API jQuery plugin

branch: master
README
jQuery plugin: SoundCloud oAuth2 API wrapper

A simple usage example:
include the plugin in your HTML code
<script type="text/javascript" charset="utf-8" src="scripts/jquery.sc.api.js"></script>
an then, initialize it
var api = $.sc.api('qqhlwkbJgox1DEssX9O1Dg');

or handle the successful authorization yourself
var api = $.sc.api('qqhlwkbJgox1DEssX9O1Dg', {
  onAuthSuccess: function(user, container) {
    alert('you are SoundCloud user ' + user.username);
  }
});

also instead of passing the callbacks you can use the custom events
var api = $.sc.api('qqhlwkbJgox1DEssX9O1Dg');
$(document).bind($.sc.api.events.AuthSuccess, function(event) {
  var user = event.user;
  // do something with the user object or call the api
  api.get('/me/tracks', function(tracks) {
    console.log(tracks);
  })
});

Please refer to the wiki on GitHub project page for full documentation
Something went wrong with that request. Please try again.