how to get a stream from a simple soundcloud URL?

Fred Guth picture Fred Guth · Apr 19, 2012 · Viewed 12.5k times · Source

I am using Javascript to create yet another custom player for SoundCloud and SoundManager2.

I am able to play a stream from a URI like api.soundcloud.com/tracks/1928712958, but I would like to use a Soundcloud url (like http://soundcloud.com/damianmarley/skrillex-damian-marley-make-it) as the input.

How can I do it?

Answer

Ahmed Salem picture Ahmed Salem · Jan 19, 2014

First of all you need to create your own app on sound cloud

After creating app you git

Now you can call soundcloud APIs, but you need to know the userId or PlaylistId or TrackId

To know ID of user we can use /resolve function

Assume user link is

https://soundcloud.com/a-salem-2

TO know user ID we use resolve function as below

http://api.soundcloud.com/resolve.json?url=https://soundcloud.com/a-salem-2&client_id=YOUR_CLIENT_ID

That will give you userId, In my case it was [75258312]

To get user tracks

https://api.soundcloud.com/users/75258312/tracks.json?client_id=YOUR_CLIENT_ID

Hope that help :)