Soundcloud Mapper: A Esri and Soundcloud API Mashup

1572
4
05-07-2015 07:43 AM
JamesMilner1
Occasional Contributor
3 4 1,572

Alongside the Twilio, I've recently been exploring a few other interesting APIs to make use of in projects. One of which is the Soundcloud API. For those of you who are unfamiliar Soundcloud is a platform for people to share music they've made with other users.

The application allows users to search for a genre of music (i.e. Dance) and then sifts through tracks pulled through the API with this attributed genre and attempts to geocode their location. It does this by looking at the city and country information provided by Soundcloud and passing that into the ArcGIS geocoding service. Once geocoded they are placed onto the map. The Soundcloud tracks API provides information relating to the tracks (artist name etc.) enlisted with that genre and also a nicely embeddable iframe encapsulating a Souncloud music player for that track. The app takes this and puts the music player within the popup when the user selects one of the pins on the map.

The page makes use of the Esri Leaflet API as I wanted to explore making use of this library, especially as this was a slightly more lightweight application. The app also makes use of the spiderify leaflet plugin which helps deal with the issue of overlapping pins at the same location. The plugin allows you to click on a cluster of pins and it spins them out from their original center so you can click them individually. This is useful in this scenario as we only get city level granularity at for track locations.

What did you use?

What does it look like?

Just reminded me, did you map the songs again?

Soundcloud's API does not provide latitude and longitude for their tracks. However the do provide a textual location for the track. Via the ArcGIS geocoding service it was possible to geocode the addresses. Some checking is done to avoid empty strings, "Global", or "Worldwide"

Can I have a play? Where is the code?

The live demo is available here. You can also find the code on GitHub at this url,

4 Comments
TimWitt2
MVP Regular Contributor

James this is great. Who knew you can discover music spatially via ArcGIS!

ToddBlanchette
Occasional Contributor II

This is an awesome idea! Great work on the mashup, I loved exploring it.  A great example of how well designed APIs can integrate to form something greater than each intended!

JamesMilner1
Occasional Contributor

Hi Todd! Thanks for your kind words. Indeed, I really like SoundClouds API, it's very simple to use! Maybe in the future they will store latitude longitude data and make sound mapping even easier.

LarsSchmitz
Regular Contributor II

I really like this idea, James! We have done something comparable. The app "Concert Telling Tweets" allows to find concerts and artists. It uses Twitter, setlist.fm and the GeoEvent Extension. For more details see here:Concert Telling Tweets – Konzerte in sozialen Medien  (German only).

About the Author
Esri UK developer evangelist. Fan of maps, coffee, 3D, hot sauce, coding, web, Android, drawing, PC gaming.