3

I'm using the SoundCloud API resolve method (which works most of the time)... but sometimes it returns a 403.

Here's my reduced test cast on JSFiddle --> https://jsfiddle.net/stursby/fcvce4f7/

And the source of the fiddle (please run in JSFiddle and check the console logs)

// setup
const API_BASE = 'https://api.soundcloud.com'
const CLIENT_ID = 'xxxxxxxxxxxxxxxxxxxxxxxxx'

// https://developers.soundcloud.com/docs/api/reference#resolve
const resolve = (url) => {
  console.log(`resolving ${url} ...`)
  axios.get(`${API_BASE}/resolve`, {
      params: {
        url: url,
        client_id: CLIENT_ID
      }
    })
    .then((response) => {
      console.log(response.data)
    })
    .catch((error) => {
      console.log('Error:', error)
    })
}

// works
resolve('https://soundcloud.com/goodvibrationsradioshow/goodvibrations2')

// doesn't...
resolve('https://soundcloud.com/bingoplayers/hysteria-radio-056')
ChrisF
  • 134,786
  • 31
  • 255
  • 325
stursby
  • 871
  • 2
  • 12
  • 23
  • So there's something I've noticed about Soundcloud tracks being accessed through their API. Some work, and some don't. I recently got a SONOS system that allows you to link your soundcloud account to. I noticed that some songs in my "Likes" are not available using the SONOS app. You may be running into this issue. I just checked the app and went to the Bingo Players' artist page, not a single song available to stream through SONOS. – Zack Huber May 11 '16 at 21:53
  • I made another demo, where I uploaded 2 tracks to my own account, and then set one enabled for embedding, sharing, downloading, etc and the other completely disabled... yet the API worked for both. Here's the demo --> https://jsfiddle.net/stursby/fcvce4f7/6/ – stursby May 12 '16 at 16:18
  • I have noticed this behavior on and off over the past 9 months. Kinda driving me crazy. – Andrew Aug 10 '16 at 06:11
  • This question was answered here: https://stackoverflow.com/questions/36360202/soundcloud-api-urls-timing-out-and-then-returning-error-403-on-about-50-of-trac# TL;RD SoundCloud API return 403 if they think that the track should not be available via API. – MikeGer Nov 17 '17 at 08:23

0 Answers0