emicha
emicha

Reputation: 23

How to get "all" tracks related to an artist with Souncloud API

I have been looking for the answer for a while, and couldn't find it.

Currently, I'm getting the tracks of an artist as specified by the api:

SC.get('/users/30806929/tracks', { userId: '30806929'}, function(tracks) {
    $(tracks).each(function(index, track){
      $('#results').append($('<li></li>').html(track.title + ' - ' + track.genre));
    });
  });

That's easy and works fine.

The problem is that I'm getting only the tracks uploaded by the user, listed in the following link:

Tracks uploaded by the user

But what I want to get is "all" the music related to the user, listed in the homepage:

User souncloud homepage

Has anyone faced this problem?

Answer Thanks to bnz, simple example to get all tracks (including tracks and tracks-repost):

var url = 'https://api-v2.soundcloud.com/profile/soundcloud:users:30806929?limit=10&offset=0&linked_partitioning=1&client_id=YOUR_CLIENT_ID&app_version=810b564&format=json';
    $.ajax({url:url}).success(function(data){
      $(data.collection).each(function(index, info){
         $('#results').append($('<li></li>').html(info.track.title));
      });
    });

Upvotes: 1

Views: 1287

Answers (1)

hwsw
hwsw

Reputation: 2606

You mean Tracks + Sets + Reposts?

This is a part of the new API, hopefully they will make it public - and useable.

At least thats the call:

https://api-v2.soundcloud.com/profile/soundcloud:users:30806929?limit=10&offset=0&linked_partitioning=1&client_id=02gUJC0hH2ct1EGOcYXQIzRFU91c72Ea&app_version=810b564

(Go to your browser and take a look on the networks console and look for xhr requests.)

Upvotes: 1

Related Questions