Matthew D
Matthew D

Reputation: 131

SoundCloud API's Download endpoint throwing 403

We've been using soundcloud to provide an audio track that users can play and have been providing a download link pointing at the download endpoint (e.g. https://api.soundcloud.com/tracks/0000000000/download?secret_token=s-XXXXX&client_id=XXXXXXXXXXXXXXXXXXXXX). However, for the last few days these links have been returning 403 errors. (Note: the headers include X-Cache: Error from cloudfront.)

Thinking that maybe there was an API change, I tried switching the code to pull the download link directly from the Widget API:

this.soundCloudWidget.getCurrentSound(sound => {
    console.log('got sound', sound);                                                                                          

    if (sound.downloadable && sound.download_url && sound.has_downloads_left) {
        console.log('setting download url:', sound.download_url);
        this.soundcloudDownloadSrc = sound.download_url;
    }
});

As of last night, this code returns the same URL (but with a different secret_token and client_id); however, this URL still gets a 403. This morning, the download_url property is missing.

Is SoundCloud removing download functionality or is this a temporary issue? The API Docs still reference the download_url, etc.

Note: even the normal track info URL (e.g. https://api.soundcloud.com/tracks/0000000000?secret_token=s-XXXX&client_id=XXXXXXXXXXXXXXXXXXXXX) returns a 403.

Upvotes: 2

Views: 786

Answers (1)

Sampaguita
Sampaguita

Reputation: 96

You could use this endpoint to download a track without using the secret token and client id.

https://feeds.soundcloud.com/stream/{track_id}

Upvotes: 2

Related Questions