Reputation: 4245
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
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&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true\"></iframe>');
Upvotes: 0
Views: 358
Reputation: 470
Would http://developers.soundcloud.com/docs/api/reference#resolve help?
$ curl -v 'http://api.soundcloud.com/resolve.json?url=http://soundcloud.com/matas/hobnotropic&client_id=YOUR_CLIENT_ID'
< HTTP/1.1 302 Moved Temporarily < Location: http://api.soundcloud.com/tracks/49931.json
Upvotes: 2