2

Looking at the Spotify API and spotipy, I am able to pull album information as long as I have the album ID or a list of album IDs, but how can I pull all album objects on Spotify in an efficient manner? I think this would require knowing all album IDs, but unsure if there is a method to get that.

Purpose: I want to see the number of tracks for all albums on Spotify

Potential idea

1) Inspired by Mapping musicbrainz URIs into Spotify URIs, I could map Music Brainz artist IDs to Spotify IDs which would cover a good amount of the artists on Spotify. Then pull album data from there. Issue is that Echo Nest Rosetta Stone is no longer supported

Is there a much easier way to do this that I'm not thinking about or is this impossible to do because Spotify doesn't allow it?

Bryant Wu
  • 21
  • 1

1 Answers1

0

In principle, it should be possible to query with type=album and q=a*, q=b*, q=c*, etc. The Wildcards guildlines says

The asterisk (*) character can, with some limitations, be used as a wildcard (maximum: 2 per query) [...] It cannot be used: [...] as the first character of the keyword string Field filters: By default, results are returned when a match is found in any field of the target object type.

hence why I'm using a* and the rest. That said,

  1. There are almost certain a lot of albums, and it'll be difficult to store so many
  2. It's probably a violation of their ToS to store their catalog
  3. Although it's reasonable, it's not a given that album IDs are immutable/will exist in any future capacity, so associating them externally might break in the future

Side note: it's deeper than Echo Nest not being supported -- Spotify bought Echo Nest several years ago. Algorithms they produced form the backbone of their audio analysis.

Saites
  • 792
  • 7
  • 11