Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SoundCloud API returning 0 tracks despite user having tracks

Tags:

soundcloud

I'm trying to get the tracks of specific users but for some users, even though they have tracks, the SoundCloud API return an empty list.

For example, the following 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 it returns an empty list

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

Is it possible for users to make their songs not available via API? Is there a field on the user that can distinguish this?

like image 470
Yin Yang Avatar asked Nov 02 '15 19:11

Yin Yang


1 Answers

This is very interesting. Using a normal CLIENT_ID I generated myself, I get the same results you do. Additionally, if I try to hit the API for information about a specific track, I get a 403 Forbidden error:

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

There could be a few reasons why this is occurring:

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

I'm leaning on choice 3 here. I've done some testing with some other CLIENT_IDs in this question trying the CLIENT_ID used by the youtube-dl application. Using their _IPHONE_CLIENT_ID, I was able to see information for all 17 tracks. If my understanding of that key is correct, it is a master API key used by SoundCloud for their iOS application, which would explain why that key works and others do not.

This user must have some setting enabled to block standard API access to their tracks.

like image 64
JAL Avatar answered Jan 03 '23 16:01

JAL