How to Look Up Spotify IDs (Song / Track IDs) in Bulk?
Asked Answered
S

2

5

I have a list of songs - is there a way (using the Spotify / Echo Nest API) to look up the Spotify ID for each track in bulk?

If it helps, I am planning on running these IDs through the "Get Audio Features" part of their API.

Thanks in advance!

Seppala answered 29/7, 2016 at 17:16 Comment(0)
C
7

You can use the Spotify Web API to retrieve song IDS. First, you'll need to register to use the API. Then, you will need to perform searches, like in the example linked here.

The Spotify API search will be most useful for you if you can provide specifics on albums and artists. The search API allows you to insert multiple query strings. Here is an example (Despacito by Justin Bieber:

https://api.spotify.com/v1/search?q=track:"' + despacito + '"%20artist:"' + bieber + '"&type=track

You can paste that into your browser and scan the response if you'd like. Ultimately you are interested in the song id, which you can find in the uri:

spotify:track:6rPO02ozF3bM7NnOV4h6s2

Whichever programming language you choose should allow you to loop through these calls to get the song IDs you want. Good luck!

Cattleman answered 4/5, 2017 at 21:11 Comment(0)
O
0

It has been a few years, and I am curious how far you got with this project. I was doing the same thing around 2016 as well. I am just picking up the project again, and noticing you still cannot do large bulk ID queries by Artist,Title.

For now I am just handling HttpStatusCode 429 and sleeping the thread as I loop through a library. It's kind of slow but, I mean it gets the job done. After I get them I do the AudioFeatures query for 100 tracks at a time so it goes pretty quickly that way.

So far, this is the slowest part and I really wish there was a better way to do it, or even a way to make your own 'Audio Features' based on your library It just takes a lot of computing cycles. However ... one possible outcome might be to only do it for tracks that you cannot find on Spotify ;s

Outdated answered 16/7, 2020 at 0:58 Comment(6)
I did continue with the project but idk how much I can offer as you're doing a lot of what I did. A few tips though: if you have the web app, you can select tracks (ctrl, shift, select all, etc) and then drag them to a text editor, this will give you all of the track IDs. If you are just trying to build up as big of a database as possible then you might want to try scraping from the playlists endpoint -- I had a general query and just looped through each playlist and added all track info to a db. Otherwise, just keep on building requests with 100 tracks at a time and you should [CONT]Seppala
[...CONT] be able to accomplish most tasks. Spotify is pretty generous with their API, just find a nice request cadence and it should run pretty smoothly. I made over a billion requests over a few weeks and didn't have any issues with rate-limiting or blocking. But what do you mean by "making your own Audio Features based on your library"?Seppala
desktop app ***Seppala
Well, I managed to get a functioning request system as good as it's going to get. I have a bunch of music from DJ'ing that I had to convert from the Discs to MP3 because of hardware failures, and I think the titles of the files are kind of messed up. I did a few hundred songs with mp3 tag, and it seemed to work better. Was having issues with partial matches and Spotify ID collection. But as long as I get an ID I can pull the track descriptors easily, store it. Works fine :) I did my whole personal library in ~65 minutes once with 89% success rate on descriptors over 30k tracks.Outdated
Can you share the one you are talking about @JeremyWalker . ThanksTold
@AdarshBalu Sorry for an extremely old thread reply but... Which are you asking for? MP3 Tag? That's what I use to mass edit mp3 tags: mp3tag.de/enOutdated

© 2022 - 2024 — McMap. All rights reserved.