-
Notifications
You must be signed in to change notification settings - Fork 959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error 404 when calling playlist_items for Spotify's official "Top 50" playlist IDs #1175
Comments
All Spotify-owned playlists are inaccessible using their API now https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api |
You're absolutely right, I didn't pay full attention to Spotify post. It's very clear: (...)
(...) Even so, a rather absurd decision by Spotify. |
Thats so sad... I was copying a Spotify Artist Radio from one of the Artists from here into one of my playlists every day for the last year. Seems I have to find another way |
I'm going to add this to the FAQ, this is going to throw off a lot of people. |
I've been using the Top 50 playlists from European countries to understand the evolution of musical industry. Everything with an academic purpose, as I work at a university and we are deeply focused on cultural aspects. These playlists were a reflection of the evolution of the music market, but also of the cultural changes in the population.. From my point of view, it makes absolutely no sense to block access to these playlists via API... I wonder if the cost of the requests justifies the shutdown. Anyway, I think it's a pretty petty decision. I get that they don’t want to give access to audio_features, which is hidden info in the user interface and could be used to feed AI models... but how do these official playlists cause any harm? |
@AdriaPadilla Reply to this post on Spotify's forum if you haven't done so already: https://community.spotify.com/t5/Spotify-for-Developers/Changes-to-Web-API/td-p/6540414 I'm not sure if this will change anything, but your comment would fit right in. |
Done! I’ve read some responses to the post on Spotify’s official page, and the change is catastrophic for many developers. I’ve also seen numerous students with their final projects ruined, as well as academics (myself included) who used the API to access specific data. This decision is unacceptable. |
I think in the age of information, every analysis done by someone (Spotify) is of interest to someone else (us) and therefore the creator doesn't want the user to have a benefit. If I were a competitor of Spotify, I'd also analyze the Top50 tracks or some other smart playlist, where Spotify spent time and engineering hours to create the algorithms. It's really sad they felt the need to make these changes, on the other hand I can understand they don't want to offer their intellectual property (f&$king playlists) for free. |
Does anyone have a workaround for getting public playlist tracks? |
Honestly I can't believe this, but my project spotipy-anon is not yet affected by this change. It might get patched in the future though.
import spotipy
from spotipy_anon import SpotifyAnon
sp = spotipy.Spotify(auth_manager=SpotifyAnon())
print(sp.playlist("37i9dQZF1DXcBWIGoYBM5M")) |
Just did! Can confirm that it works :D |
My current workaround is to use two different Spotipy auths like this sp = spotipy.Spotify(auth_manager=SpotifyOAuth(id, secret, "http://example.com", scope=scope))
sp_anon = spotipy.Spotify(auth_manager=SpotifyAnon()) I use |
This is just a speculation and I'm not sure if this applies to all Spotify owned playlists, but if you decode the playlist id to ascii, then it stars off with the word "format". In the Base62 format that Spotify uses (0-9, a-z, A-Z) it starts like this: "37i9dQZF1EI". Maybe you could filter them like that. |
I had a simple script that copied the contents of 2 Spotify owned Throwback Thursday playlists, as they constantly change and there were some weeks where I wanted a permeant copy. This change to the Spotify API broke it. Thank you, @dieser-niko, spotipy-anon got it working again. |
OMG! It works perfectly. You’re a genius! I love it! Thank you so much! I’ve tested it extensively using the Let’s not go too deep into this, so we don’t give Spotify ideas on how to close these doors. From here, there are a few possibilities we should consider:
Maybe we should suggest officially incorporating SpotifyAnon into Spotipy and adding specific methods for making anonymous requests to Spotify-owned objects. In any case, once again, thank you so much! |
The thing is, spotipy-anon uses an unofficial and undocumented endpoint, so it doesn't really fit in. I actually requested this before I became a member and was denied for the same reason, which I do agree with: #878 (comment) |
Not sure if that is right (a counter-example: Today's Top Hits) |
Yeah, but when decoding the ID, it still starts with "format". You can use https://www.dcode.fr/base62-encoding to decode the ID if you want to try it out. Make sure to select 0-9a-zA-Z |
Oh I understand now! |
Hello!
I'm encountering an issue when using the
playlist_items()
function from Spotipy to retrieve tracks from Spotify's official "Top 50" playlists. I tested the code with multiple playlist IDs, all corresponding to Spotify's public official playlists, and encountered the same problem consistently.For example, the API returns 404 for all this playlist ids:
The code
API returns:
However, it works perfectly when using a public playlist ID created by users. For example, the code works flawlessly with this Queen playlist:
2sWWEDq1DuOnAJJWVHMRfC
.This indicates that the issue is not with my code but with the API itself.
I have searched for information in Spotify's API documentation and announcements but found no mention of any restrictions related to this. Has anyone else encountered the same issue? Perhaps it might be necessary to escalate this to Spotify to understand what is happening. Any insights or information would be greatly appreciated.
Spotipy Version: 2.24.0
Python Version: 3.12.3
Operating System: Ubuntu 24.04.1 LTS x86_64
The text was updated successfully, but these errors were encountered: