SoundCloud API returns 0 tracks, although the user has tracks

I am trying to get the tracks of certain users, but for some users, even if they have tracks, the SoundCloud API returns an empty list.

For example, the next user has 17 tracks, as you can see from his track_count

 http://api.soundcloud.com/users/1250904?client_id=XXXXXX 

If I try to get his tracks, he will return an empty list

 http://api.soundcloud.com/users/1250904/tracks?client_id=XXXXXX 

Is it possible that their songs were not accessible through the API? Is there a user field that can distinguish this?

+6
source share
1 answer

It is very interesting. Using the usual CLIENT_ID, I generated myself, I get the same results as you. Also, if I try to get into the API to get information about a specific track, I get a 403 Forbidden error:

 HTTP GET https://api.soundcloud.com/tracks/149151252.json?client_id=XXXXXX 

There may be several reasons why this happens:

  • The user has reached his download limit for all of his tracks.
  • The user has disabled oEmbed, causing API requests to 403 (see this post ).
  • The user somehow managed to block normal access to the API for their tracks.

I rely on choice 3 here. I did some testing with some other CLIENT_ID in this question , trying to use the CLIENT_ID used by youtube-dl application. Using their _IPHONE_CLIENT_ID , I was able to see information for all 17 tracks. If my understanding of this key is correct, this is the API master key used by SoundCloud for the iOS application, which explains why this key works and others do not.

This user must have some option enabled to block access to the standard APIs for their tracks.

+3
source

Source: https://habr.com/ru/post/1235044/


All Articles