Question

API doesn't work for some tracks

  • 21 January 2018
  • 3 replies
  • 745 views

Hey there,
Half a day has past and I'm still blocked on this, so I give up, need some help here guys.

Why the API returns a 401 forbiden for this track: https://soundcloud.com/djcarnageofficial/learn-how-to-watch-feat-mac-miller-madeintyo

While working like a charm for this one: https://soundcloud.com/dagpro5/dagpro5-radio-episode-008 ?

I don't see any notable difference between them? Just the fact that the not working one is newer
How to avoid this?

I'm using mainly PHP to code my website & to crawl API info, like this:

code:

# Creating a flux context to add the "user-agent" tag in the headers to keep SoundCloud alert system calm
$opts = array('http'=>array('header'=>"User-agent: Chrome\r\n"));
$context = stream_context_create($opts);

# Getting API info
$url = "https://soundcloud.com/dagpro5/dagpro5-radio-episode-008";
echo(file_get_contents('https://api.soundcloud.com/resolve?url=' . $url . '&client_id=a39cf***********************a9c3', false, $context));


Thanks.

3 replies

Edit: even digging the ID of the track from the "Embed" option of the track and putting it on the url like so: https://api.soundcloud.com/tracks/382382819?client_id=a39**********

doesn't solve the issue, I still get the forbiden error, raaaa è.é
Anybody?
Userlevel 7
Badge +3
Hi there,

Dj Carnage's content is available to SoundCloud Go+ users exclusively. Thus, his content cannot be queried from the API.

Cheers
Mathis

Reply