Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Soundcloud URL for a track using only its ID

Tags:

soundcloud

I've inherited a database of Soundcloud IDs and would like to build a page linking to each track on Soundcloud. Is it possible to link to a track on the Soundcloud website using only its ID e.g.

http://www.soundcloud.com/tracks/{trackId}

The website seems to use the format:

http://www.soundcloud.com/{user}/{trackname}

but I don't have either of those.

like image 824
Paul Carvill Avatar asked Apr 07 '15 15:04

Paul Carvill


People also ask

How do I get a SoundCloud track link?

You can get the secret link for your track by clicking the 'Share' button below its waveform. Secret links have tokens (some extra numbers that make your link unique, unsearchable and unguessable) at the end of your track's URL, so anyone with the secret link will be able to listen to your track.

Can you embed private SoundCloud tracks?

In the Share menu click the Message tab, select who you want to send the message to, and hit send. To generate a private embed code that can be exclusive to any webpage, click Share on any private track or playlist. The track will be private on SoundCloud and only visible via the private embed.

What is profile URL on SoundCloud?

Your Profile URL needs to be unique, similar to your social media handle on platforms like Instagram or Twitter. It's what shows up in your profile link after soundcloud.com/. Choosing a memorable and easy-to-share Profile URL can help establish and grow your brand.


1 Answers

You can scrape it from the "widget" URL

https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/{trackId}

contains a link element

<link rel="canonical" href="{canonicalURI}">
like image 149
Alan Trewartha Avatar answered Nov 23 '22 23:11

Alan Trewartha