当试图将Soundcloud HTML5小部件嵌入Xenforo论坛时,我注意到它需要在页面的URL中无法使用的Track ID。有没有办法获取track id而不必刮掉源代码或强迫用户从整个嵌入代码中获取它?
答案 0 :(得分:1)
您可以使用/resolve
端点:http://developers.soundcloud.com/docs/api/reference#resolve
$ 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
亲眼看看:http://api.soundcloud.com/resolve.json?url=http://soundcloud.com/matas/hobnotropic