DEV Community

Cover image for Shazam-to-JSON
Hennzen
Hennzen

Posted on • Updated on

Shazam-to-JSON

My approach to exporting Shazams to JSON via
https://www.shazam.com/myshazam

No intro? Just jump to the code

Intro

I love my Shazams. They only contains songs I absolutely didn't know when tagging. It's growing since 2011 and it's a ride through all genres. I don't want to lose it.

That said, when Shazam for Android suddenly lost a couple of songs back in 2016 and showed them as 'unknown track' for whatever reasons, I realized I wanted a backup. With a little bit of mistrust I also wondered if a migration to a new phone would work, although Titanium backup had never let me down so far.

I have no idea when Shazam introduced the feature to access your tags via web. I also don't know when they introduced the Export to Spotify feature. The Spotify thing sounded like just what I wanted, because Apple Music is not for me. Unfortunately, the resulting Spotify playlist left me with just about 60% of my original tags, probably because song matching seems to be done via artist and song title, which isn't particularly precise sometimes.

So what the heck, a text export (read: JSON) that I could drop into a git repo (because why not) would be just enough for me. Luckily, with a little bit of Javascript that's not too much of a hassle, as long as Shazam/Apple keeps up the web access to our tags.

Code

Copy the code below and drop it into your browser's console. Don't forget to scroll all the way down the website before executing. Otherwise not all songs will be loaded.

The result is then available in your clipboard. Voilà.

Top comments (0)