[GH-ISSUE #1175] Error 404 when calling playlist_items for Spotify's official "Top 50" playlist IDs #692

Closed
opened 2026-02-28 00:00:54 +03:00 by kerem · 24 comments
Owner

Originally created by @AdriaPadilla on GitHub (Nov 30, 2024).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1175

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:

COUNTRY ID Playlist Name
Bolivia 37i9dQZEVXbJqfMFK4d691 Top 50: Bolivia
Brazil 37i9dQZEVXbMXbN3EUUhlg Top 50: Brazil
Bulgaria 37i9dQZEVXbNfM2w2mq1B8 Top 50: Bulgaria
Canada 37i9dQZEVXbKj23U1GF4IR Top 50: Canada

The code


import json
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials

client_credentials_manager = SpotifyClientCredentials(
    client_id='YOUR_CLIENT_ID',
    client_secret='YOUR_CLIENT_SECRET'
)
spotify = spotipy.Spotify(client_credentials_manager=client_credentials_manager)


def get_playlist_data():
    playlist_id = "37i9dQZEVXbMnz8KIWsvf9"
    api_response = spotify.playlist_items(playlist_id)
    with open(f"{playlist_id}.json", 'w', encoding='utf-8') as f:
        json.dump(api_response, f, ensure_ascii=False, indent=4)


print("Getting Playlist Data")
get_playlist_data()

API returns:

HTTP Error for GET to https://api.spotify.com/v1/playlists/37i9dQZEVXbJqfMFK4d691/tracks with Params: {'limit': 100, 'offset': 0, 'fields': None, 'market': None, 'additional_types': 'track,episode'} returned 404 due to Resource not found

(... Traceback)

spotipy.exceptions.SpotifyException: http status: 404, code:-1 - https://api.spotify.com/v1/playlists/37i9dQZEVXbJqfMFK4d691/tracks?limit=100&offset=0&additional_types=track%2Cepisode:
Resource not found, reason: None

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

Originally created by @AdriaPadilla on GitHub (Nov 30, 2024). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1175 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: COUNTRY | ID | Playlist Name -- | -- | -- Bolivia | 37i9dQZEVXbJqfMFK4d691 | Top 50: Bolivia Brazil | 37i9dQZEVXbMXbN3EUUhlg | Top 50: Brazil Bulgaria | 37i9dQZEVXbNfM2w2mq1B8 | Top 50: Bulgaria Canada | 37i9dQZEVXbKj23U1GF4IR | Top 50: Canada The code ```python import json import spotipy from spotipy.oauth2 import SpotifyClientCredentials client_credentials_manager = SpotifyClientCredentials( client_id='YOUR_CLIENT_ID', client_secret='YOUR_CLIENT_SECRET' ) spotify = spotipy.Spotify(client_credentials_manager=client_credentials_manager) def get_playlist_data(): playlist_id = "37i9dQZEVXbMnz8KIWsvf9" api_response = spotify.playlist_items(playlist_id) with open(f"{playlist_id}.json", 'w', encoding='utf-8') as f: json.dump(api_response, f, ensure_ascii=False, indent=4) print("Getting Playlist Data") get_playlist_data() ``` API returns: ```CMD HTTP Error for GET to https://api.spotify.com/v1/playlists/37i9dQZEVXbJqfMFK4d691/tracks with Params: {'limit': 100, 'offset': 0, 'fields': None, 'market': None, 'additional_types': 'track,episode'} returned 404 due to Resource not found (... Traceback) spotipy.exceptions.SpotifyException: http status: 404, code:-1 - https://api.spotify.com/v1/playlists/37i9dQZEVXbJqfMFK4d691/tracks?limit=100&offset=0&additional_types=track%2Cepisode: Resource not found, reason: None ``` 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
kerem 2026-02-28 00:00:54 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@mjanonis commented on GitHub (Nov 30, 2024):

https://github.com/spotipy-dev/spotipy/issues/1172

All Spotify-owned playlists are inaccessible using their API now https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api

<!-- gh-comment-id:2509470916 --> @mjanonis commented on GitHub (Nov 30, 2024): https://github.com/spotipy-dev/spotipy/issues/1172 All Spotify-owned playlists are inaccessible using their API now https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api
Author
Owner

@AdriaPadilla commented on GitHub (Dec 1, 2024):

You're absolutely right, I didn't pay full attention to Spotify post. It's very clear:

(...)
Effective today, new Web API use cases will no longer be able to access or use the following endpoints and functionality in their third-party applications.

  1. Algorithmic and Spotify-owned editorial playlists

(...)

Even so, a rather absurd decision by Spotify.

<!-- gh-comment-id:2509813919 --> @AdriaPadilla commented on GitHub (Dec 1, 2024): You're absolutely right, I didn't pay full attention to Spotify post. It's very clear: (...) Effective today, new Web API use cases will no longer be able to access or use the following endpoints and functionality in their third-party applications. 8. **Algorithmic and Spotify-owned editorial playlists** (...) Even so, a rather absurd decision by Spotify.
Author
Owner

@akraus53 commented on GitHub (Dec 1, 2024):

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

<!-- gh-comment-id:2510206088 --> @akraus53 commented on GitHub (Dec 1, 2024): Thats so sad... I was copying a Spotify Artist Radio from one of the Artists from [here](https://everynoise.com/engenremap-rock.html) into one of my playlists every day for the last year. Seems I have to find another way
Author
Owner

@dieser-niko commented on GitHub (Dec 2, 2024):

I'm going to add this to the FAQ, this is going to throw off a lot of people.

<!-- gh-comment-id:2511036979 --> @dieser-niko commented on GitHub (Dec 2, 2024): I'm going to add this to the FAQ, this is going to throw off a lot of people.
Author
Owner

@AdriaPadilla commented on GitHub (Dec 2, 2024):

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?

<!-- gh-comment-id:2511079468 --> @AdriaPadilla commented on GitHub (Dec 2, 2024): > 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?
Author
Owner

@dieser-niko commented on GitHub (Dec 2, 2024):

@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.

<!-- gh-comment-id:2511348885 --> @dieser-niko commented on GitHub (Dec 2, 2024): @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.
Author
Owner

@AdriaPadilla commented on GitHub (Dec 2, 2024):

@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.

<!-- gh-comment-id:2511985103 --> @AdriaPadilla commented on GitHub (Dec 2, 2024): > @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.
Author
Owner

@akraus53 commented on GitHub (Dec 4, 2024):

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.

<!-- gh-comment-id:2517196304 --> @akraus53 commented on GitHub (Dec 4, 2024): 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.
Author
Owner

@Syzygianinfern0 commented on GitHub (Dec 10, 2024):

Does anyone have a workaround for getting public playlist tracks?

<!-- gh-comment-id:2532471147 --> @Syzygianinfern0 commented on GitHub (Dec 10, 2024): Does anyone have a workaround for getting public playlist tracks?
Author
Owner

@dieser-niko commented on GitHub (Dec 10, 2024):

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.
Here's a quick code snippet to try it out yourself:

pip install spotipy-anon
import spotipy
from spotipy_anon import SpotifyAnon

sp = spotipy.Spotify(auth_manager=SpotifyAnon())

print(sp.playlist("37i9dQZF1DXcBWIGoYBM5M"))
<!-- gh-comment-id:2532494280 --> @dieser-niko commented on GitHub (Dec 10, 2024): Honestly I can't believe this, but my project [spotipy-anon](https://github.com/dieser-niko/spotipy-anon) is not yet affected by this change. It might get patched in the future though. Here's a quick code snippet to try it out yourself: ``` pip install spotipy-anon ``` ```python import spotipy from spotipy_anon import SpotifyAnon sp = spotipy.Spotify(auth_manager=SpotifyAnon()) print(sp.playlist("37i9dQZF1DXcBWIGoYBM5M")) ```
Author
Owner

@Syzygianinfern0 commented on GitHub (Dec 10, 2024):

Just did! Can confirm that it works :D

<!-- gh-comment-id:2532504434 --> @Syzygianinfern0 commented on GitHub (Dec 10, 2024): Just did! Can confirm that it works :D
Author
Owner

@Syzygianinfern0 commented on GitHub (Dec 10, 2024):

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 sp to read/write on my playlists and sp_anon to read public playlists!

<!-- gh-comment-id:2532573243 --> @Syzygianinfern0 commented on GitHub (Dec 10, 2024): My [current workaround](https://github.com/Syzygianinfern0/CI-is-my-DJ/blob/main/main.py#L75-L76) is to use two different Spotipy auths like this ```python sp = spotipy.Spotify(auth_manager=SpotifyOAuth(id, secret, "http://example.com", scope=scope)) sp_anon = spotipy.Spotify(auth_manager=SpotifyAnon()) ``` I use `sp` to read/write on my playlists and `sp_anon` to read public playlists!
Author
Owner

@dieser-niko commented on GitHub (Dec 10, 2024):

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.

<!-- gh-comment-id:2532926766 --> @dieser-niko commented on GitHub (Dec 10, 2024): 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.
Author
Owner

@ParalysedBeaver commented on GitHub (Dec 11, 2024):

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.

<!-- gh-comment-id:2533676699 --> @ParalysedBeaver commented on GitHub (Dec 11, 2024): 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.
Author
Owner

@AdriaPadilla commented on GitHub (Dec 11, 2024):

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. Here's a quick code snippet to try it out yourself:

pip install spotipy-anon
import spotipy
from spotipy_anon import SpotifyAnon

sp = spotipy.Spotify(auth_manager=SpotifyAnon())

print(sp.playlist("37i9dQZF1DXcBWIGoYBM5M"))

OMG! It works perfectly. You’re a genius! I love it! Thank you so much!

I’ve tested it extensively using the sp.playlist_items(playlist_id) and sp.artist(artist_id) methods, with a time.sleep(1) between requests. Not a single API request was rejected.

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:

  1. Spotify might eventually block anonymous access to playlists and require OAuth.
  2. Spotify could introduce a very strict API requests limit for anonymous token.
  3. Spotify do nothing, and this could keep working.

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!

<!-- gh-comment-id:2535386888 --> @AdriaPadilla commented on GitHub (Dec 11, 2024): > Honestly I can't believe this, but my project [spotipy-anon](https://github.com/dieser-niko/spotipy-anon) is not yet affected by this change. It might get patched in the future though. Here's a quick code snippet to try it out yourself: > > ``` > pip install spotipy-anon > ``` > > ```python > import spotipy > from spotipy_anon import SpotifyAnon > > sp = spotipy.Spotify(auth_manager=SpotifyAnon()) > > print(sp.playlist("37i9dQZF1DXcBWIGoYBM5M")) > ``` **OMG! It works perfectly. You’re a genius! I love it! Thank you so much!** I’ve tested it extensively using the `sp.playlist_items(playlist_id)` and `sp.artist(artist_id)` methods, with a `time.sleep(1)` between requests. Not a single API request was rejected. 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: 1. Spotify might eventually block anonymous access to playlists and require OAuth. 2. Spotify could introduce a very strict API requests limit for anonymous token. 3. Spotify do nothing, and this could keep working. 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!
Author
Owner

@dieser-niko commented on GitHub (Dec 11, 2024):

Maybe we should suggest officially incorporating SpotifyAnon into Spotipy and adding specific methods for making anonymous requests to Spotify-owned objects.

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: https://github.com/spotipy-dev/spotipy/issues/878#issuecomment-1299996552

<!-- gh-comment-id:2535441236 --> @dieser-niko commented on GitHub (Dec 11, 2024): > Maybe we should suggest officially incorporating SpotifyAnon into Spotipy and adding specific methods for making anonymous requests to Spotify-owned objects. 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: https://github.com/spotipy-dev/spotipy/issues/878#issuecomment-1299996552
Author
Owner

@Syzygianinfern0 commented on GitHub (Dec 11, 2024):

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.

Not sure if that is right (a counter-example: Today's Top Hits)

<!-- gh-comment-id:2537024663 --> @Syzygianinfern0 commented on GitHub (Dec 11, 2024): > 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. Not sure if that is right (a counter-example: [Today's Top Hits](https://open.spotify.com/playlist/37i9dQZF1DXcBWIGoYBM5M?si=M0j7nBTFRiiBaRRZ6i3EqA))
Author
Owner

@dieser-niko commented on GitHub (Dec 11, 2024):

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

<!-- gh-comment-id:2537221340 --> @dieser-niko commented on GitHub (Dec 11, 2024): 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
Author
Owner

@Syzygianinfern0 commented on GitHub (Dec 12, 2024):

Oh I understand now!

<!-- gh-comment-id:2537811819 --> @Syzygianinfern0 commented on GitHub (Dec 12, 2024): Oh I understand now!
Author
Owner

@deraguir commented on GitHub (Dec 26, 2024):

Spotipy-anon reads some of my personal "top tracks" playlists but not all of them

<!-- gh-comment-id:2562117197 --> @deraguir commented on GitHub (Dec 26, 2024): Spotipy-anon reads some of my personal "top tracks" playlists but not all of them
Author
Owner

@dieser-niko commented on GitHub (Dec 26, 2024):

You might want to open an issue in the spotipy-anon repository rather than discuss it here, but it sounds like there's nothing I can do about it.

<!-- gh-comment-id:2562392152 --> @dieser-niko commented on GitHub (Dec 26, 2024): You might want to open an issue in the spotipy-anon repository rather than discuss it here, but it sounds like there's nothing I can do about it.
Author
Owner

@Syzygianinfern0 commented on GitHub (Feb 11, 2025):

@dieser-niko Looks like spotipy-anon fails as of today 😭

<!-- gh-comment-id:2649821115 --> @Syzygianinfern0 commented on GitHub (Feb 11, 2025): @dieser-niko Looks like spotipy-anon fails as of today 😭
Author
Owner

@dieser-niko commented on GitHub (Feb 11, 2025):

@Syzygianinfern0 what doesn't work for you? I still can fetch Spotify's playlists.

<!-- gh-comment-id:2650155808 --> @dieser-niko commented on GitHub (Feb 11, 2025): @Syzygianinfern0 what doesn't work for you? I still can fetch Spotify's playlists.
Author
Owner

@Syzygianinfern0 commented on GitHub (Mar 23, 2025):

@dieser-niko the last time it was a false alarm, I think it was not working for a little while when I made the comment.

Although now, it has not been working for a few days. I tried the Quickstart example from your repo and its failing with the same error as from my script.

Traceback (most recent call last):
  File "/Users/ss99569/Developer/Fun/CI-is-my-DJ/meow.py", line 6, in <module>
    results = sp.search(q="weezer", limit=20)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy/client.py", line 602, in search
    return self._get(
           ^^^^^^^^^^
  File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy/client.py", line 327, in _get
    return self._internal_call("GET", url, payload, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy/client.py", line 251, in _internal_call
    headers = self._auth_headers()
              ^^^^^^^^^^^^^^^^^^^^
  File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy/client.py", line 242, in _auth_headers
    token = self.auth_manager.get_access_token(as_dict=False)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy_anon/oauth2.py", line 84, in get_access_token
    token_info = self._request_access_token()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy_anon/oauth2.py", line 107, in _request_access_token
    self._handle_oauth_error(http_error)
  File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy/oauth2.py", line 139, in _handle_oauth_error
    raise SpotifyOauthError(
spotipy.oauth2.SpotifyOauthError: error: {'code': 400, 'message': 'Unauthorized request', 'extra': {'_notes': 'Usage of this endpoint is not permitted under the Spotify Developer Terms and Developer Policy, and applicable law'}}, error_description: None
<!-- gh-comment-id:2746546685 --> @Syzygianinfern0 commented on GitHub (Mar 23, 2025): @dieser-niko the last time it was a false alarm, I think it was not working for a little while when I made the comment. Although now, it has not been working for a few days. I tried the [Quickstart example](https://github.com/dieser-niko/spotipy-anon?tab=readme-ov-file#quick-start) from your repo and its failing with the same error as from my script. ``` Traceback (most recent call last): File "/Users/ss99569/Developer/Fun/CI-is-my-DJ/meow.py", line 6, in <module> results = sp.search(q="weezer", limit=20) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy/client.py", line 602, in search return self._get( ^^^^^^^^^^ File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy/client.py", line 327, in _get return self._internal_call("GET", url, payload, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy/client.py", line 251, in _internal_call headers = self._auth_headers() ^^^^^^^^^^^^^^^^^^^^ File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy/client.py", line 242, in _auth_headers token = self.auth_manager.get_access_token(as_dict=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy_anon/oauth2.py", line 84, in get_access_token token_info = self._request_access_token() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy_anon/oauth2.py", line 107, in _request_access_token self._handle_oauth_error(http_error) File "/Users/ss99569/mambaforge/envs/fun/lib/python3.11/site-packages/spotipy/oauth2.py", line 139, in _handle_oauth_error raise SpotifyOauthError( spotipy.oauth2.SpotifyOauthError: error: {'code': 400, 'message': 'Unauthorized request', 'extra': {'_notes': 'Usage of this endpoint is not permitted under the Spotify Developer Terms and Developer Policy, and applicable law'}}, error_description: None ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#692
No description provided.