DEV Community

Discussion on: What's playing in your headphones these days?

Collapse
 
madza profile image
Madza

Built Devtunes FM just for this, recently been on Lo-Fi and Future Garage stations 😉✨

Collapse
 
pavonz profile image
Andrea Pavoni

so cool! I've just discovered it from your comment. Any chance to see its source code? I've a similar idea, but I'm struggling finding details about embedding/streaming soundcloud tracks.

Maybe I just need to dig deeper into SC API docs

Collapse
 
madza profile image
Madza

Unfortunately, the code is not public currently 😉
Anyways, a while ago I made an article describing it in more details. 😉

Thread Thread
 
pavonz profile image
Andrea Pavoni

Ok, just one technical question: given you have N playlists with tracks, are you just using a custom player to stream songs from SC? Did you need to register an app on SC platform or did you have to use their API keys to do that?

I'm reading the docs, I understand what the app-registration or the API keys are used/needed for, what I'm unable to find/understand is what's needed to play a bunch of tracks through a custom player on a web page. I don't need search features, adding/removing tracks, etc... I just want to play a set of tracks (the list of track IDs/URLs stored somewhere).

Thanks in advance for your help.

Thread Thread
 
madza profile image
Madza • Edited

All you need to work with their API is your client_id. You have to go to SoundCloud, sign in, open a track/playlist, hit F12, and go to the Networking tab, then start the song and use the search box to look out for requests containing a client_id. There you can also find other parameters like track_id, playlist_id, etc.
Then go to developers.soundcloud.com/docs/api... to see all the available API routes and use that client_id for authorization at the end of each query you want to fetch.

For example, to return a track, you would use https://api-v2.soundcloud.com/tracks/{track_id}?client_id={client_id}.
Or, to return a playlist: https://api-v2.soundcloud.com/playlists/{playlist_id}?client_id={client_id}.

Thread Thread
 
pavonz profile image
Andrea Pavoni • Edited

Thank you! I’ve been stuck on the API for some day, until I’ve re-read your comment mentioning the API v2.

Still working progress, and I took a slightly different path, but it’s online and I’m enjoying it ;-)

radio.pavonz.com

thank you again for your help and hints!

Thread Thread
 
madza profile image
Madza

My pleasure to help 👍😉

Collapse
 
cireneirbo profile image
Eric O'Brien

This is a really cool project!

Collapse
 
madza profile image
Madza

Thanks a lot! 👍😉