Skip to content

Instantly share code, notes, and snippets.

@HariSekhon
Last active January 30, 2026 03:54
Show Gist options
  • Select an option

  • Save HariSekhon/04ec9c6136b08fcf825b292550aee7bd to your computer and use it in GitHub Desktop.

Select an option

Save HariSekhon/04ec9c6136b08fcf825b292550aee7bd to your computer and use it in GitHub Desktop.
shazam.md from HariSekhon/Knowledge-Base repo: https://github.com/HariSekhon/Knowledge-Base

Shazam

https://www.shazam.com/

Summary

Listens to music and matches it using Shazam's databases of digital music fingerprints.

Shazam Apps

Mobile App

https://www.shazam.com/apps

iOS and Android apps.

Desktop App

I use the Desktop app on Mac a lot to shazam songs from TV shows as documented in the Audio page section:

Shazam Songs While Using Headphones on Mac

Unfortunately the desktop app is just a thin wrapper to the online service and doesn't have the store and try later unfortunately capability of the mobile app, but you can't use your phone to Shazam songs while you're watching something in headphones.

If the network connectivity is down the desktop Shazam app will just return a generic error that it couldn't determine the track instead of properly notifying you that it wasn't able to contact the upstream Shazam servers to check the database.

This is an area that should have been improved in the desktop app.

To mitigate this a little you should use apps like Stats and Pingr as documented on the Mac page to keep network monitoring in your status bar to know when it's a real failure to determine the song fingerprint vs just a network failure.

Install on macOS from the App Store:

open https://apps.apple.com/us/app/shazam-identify-songs/id897118787

or install on the command line using Mas:

mas search Shazam
 897118787  Shazam: Identify Songs          (2.11)
<more irrelevant results>
mas install 897118787

Chrome Browser Extension

Shazam in the Chrome Store

I'm not sure why you'd want to bloat your browser with this extension instead of just using the separate desktop app.

Shazam Desktop App Scripts

The Shazam desktop app uses Apple's "Core Data" object persistence framework that usually stores data in SQLite using a 2001-based UTC timestamp and auto-generated schemas.

I have written the following scripts to use this.

From DevOps-Bash-tools under the applescript/ directory:

List Tracks from the Shazam Desktop App

Gets the list of tracks (newest first) from the SQLite DB on the command line for piping to other commands:

shazam_app_dump_tracks.sh

You can pass it a limited number of tracks to return.

You can also pass it an argument to only return today / yesterday / week or a specific YYYY-MM-DD date.

In that case it returns the tracks in the order they were shazam'd first (for building a playlist of the tracks in the order they appear in the episode).

Deletes an Artist + Track name Combination

Deletes a given track from the Shazam app directly in is SQLite DB:

shazam_app_delete_track.sh "<artist>" "<track>"

If there are multiple instances of that song, it deletes all of them which is useful to automatically get rid of duplicates because sometimes we shazam more than once to be sure we have the right track.

Search Spotify Desktop App for Shazam'd Track, Then Delete It From Shazam

Searches for a track in the local Spotify desktop app, waits for a command line enter prompt before continuing (to allow you to add the song to a playlist), and then deletes the track from the Shazam SQLite DB.

Utilizes my above two list and delete shazam scripts along with my applescript/spotify_app_search.sh script to automate searching in the Spotify desktop app.

shazam_search_spotify_then_delete_track.sh

This is a workaround to the removal of Spotify integration by Apple as the competitor to their own Apple Music.

I have also written many more Spotify scripts available in the same repo under spotify/ including Spotify track search and playlist addition, but I want to see the results and control them personally and then decide which list of playlists to add each song to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment