Josh Rose
Josh Rose

Reputation: 41

SoundCloud stream API gives 401 and 403 errors for some URLs

I've got a js function to play a track by track id:

SC.stream("/tracks/" + trackID, function(sound){
  sound.play();
});

However, I get 401 and 403 errors for only certain track ids...

Examples of IDs returning an error:

I've tried SC.stream for these IDs and more for both unauthenticated (just using client id) and authenticated users and get the same result.

I've seen it suggested that this can happen if someone disables embedding in the track options, but these are clearly not disabled if you go to the track page and go to share it (as the embed URL is presented and works)

Any suggestions greatly appreciated!

Upvotes: 4

Views: 1634

Answers (1)

SoundCloud tracks can be disabled for streaming via the API while the widget is still allowed.

If you GET http://api.soundcloud.com/tracks/18163056?client_id=YOUR_CLIENT_ID you can check the streaming attribute, which for both of the tracks you sent is false.

Upvotes: 4

Related Questions