maxisme
maxisme

Reputation: 4245

find api code of soundcloud track

Is there a quick way to get the api url of a track or a playlist on soundcloud?

for example the api link for this playlist:

https://soundcloud.com/thump/sets/thump-x-avolta-5

is:

https%3A//api.soundcloud.com/playlists/40626677

and the api link for this track:

https://soundcloud.com/larryfisherman/the-star-room-og-version

is:

https%3A//api.soundcloud.com/tracks/154949628

What I am trying to do:

This is the code I have for a vimeo link.

if($tvideo === "Vimeo"){
        $Vimeo = "html('<iframe src=\"//player.vimeo.com/video/" . $video . "?color=bc2122\" width=\"700\" height=\"525\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>');";
}

In a form I have $tvideo (the type of video).

And $video a code from the url for example in:

https://vimeo.com/83528019

the number:

83528019

I want to do the same with soundcloud but the embedding html is very strange† so instead of finding the number (as for the vimeo case) I need to find the api url.

†:

html('<iframe width=\"720\" height=\"500\" scrolling=\"no\" frameborder=\"no\" src=\"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/150885898&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true\"></iframe>');

Upvotes: 0

Views: 358

Answers (1)

Related Questions