[GH-ISSUE #795] 404 error when getting track/album/playlist/artist data #494

Open
opened 2026-02-27 23:22:56 +03:00 by kerem · 3 comments
Owner

Originally created by @xnetcat on GitHub (Apr 7, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/795

Describe the bug
Hi, a lot of users started reporting to me that they are getting 404 errors.
The url to the song is valid, We've tried clearing the cache but it didn't help.
Sometimes it works sometimes it doesn't seems pretty random.
This started happening few days ago.

Your code
SpotifyClient from here: https://github.com/spotDL/spotify-downloader/blob/master/spotdl/search/spotify_client.py
and then

# Initialize spotify client
SpotifyClient.init(
	client_id="working_id",
    client_secret="working_secret",
    user_auth=False,
)

spotify_client = SpotifyClient()

data = spotify_client.track(spotify_url)

Expected behavior
We always get the data.

Output

HTTP Error for GET to https://api.spotify.com/v1/tracks/5aeMTTkvye4ERaMni9k399 with Params: {'market': None} returned 404 due to None
http status: 404, code:-1 - https://api.spotify.com/v1/tracks/5aeMTTkvye4ERaMni9k399:
 None, reason: None

Environment:

  • OS: Windows, Linux
  • Python version: from 3.7 to 3.10
  • spotipy version: 2.19
  • your IDE (if using any)

Additional context
https://github.com/plamere/spotipy/issues/794 might be the same issue

Originally created by @xnetcat on GitHub (Apr 7, 2022). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/795 **Describe the bug** Hi, a lot of users started reporting to me that they are getting 404 errors. The url to the song is valid, We've tried clearing the cache but it didn't help. Sometimes it works sometimes it doesn't seems pretty random. This started happening few days ago. **Your code** SpotifyClient from here: https://github.com/spotDL/spotify-downloader/blob/master/spotdl/search/spotify_client.py and then ```python # Initialize spotify client SpotifyClient.init( client_id="working_id", client_secret="working_secret", user_auth=False, ) spotify_client = SpotifyClient() data = spotify_client.track(spotify_url) ``` **Expected behavior** We always get the data. **Output** ``` HTTP Error for GET to https://api.spotify.com/v1/tracks/5aeMTTkvye4ERaMni9k399 with Params: {'market': None} returned 404 due to None http status: 404, code:-1 - https://api.spotify.com/v1/tracks/5aeMTTkvye4ERaMni9k399: None, reason: None ``` **Environment:** - OS: Windows, Linux - Python version: from 3.7 to 3.10 - spotipy version: 2.19 - your IDE (if using any) **Additional context** https://github.com/plamere/spotipy/issues/794 might be the same issue
Author
Owner

@jkulak commented on GitHub (Apr 15, 2022):

I am getting the same errors in (what appears) random moments, and it started just recently. Using same code, same fast network. I am checking with Spotify API console just after the error occurs with same token and get data for the requested artist, album, track.

My observation is that 1/20 of the requests returns HTTP Error and next run of the code returns proper data.

Spotify's API status is not reporting any issues: https://status.spotify.dev/

<!-- gh-comment-id:1100287828 --> @jkulak commented on GitHub (Apr 15, 2022): I am getting the same errors in (what appears) random moments, and it started just recently. Using same code, same fast network. I am checking with Spotify API console just after the error occurs with same token and get data for the requested artist, album, track. My observation is that 1/20 of the requests returns `HTTP Error` and next run of the code returns proper data. Spotify's API status is not reporting any issues: https://status.spotify.dev/
Author
Owner

@stephanebruckert commented on GitHub (Apr 15, 2022):

It looks like this is an issue on the Spotify side rather than the spotipy Python library.

These seem related (please upvote them):

If anyone is up to create a new issue in Spotify for Developers gathering all the data, then we can all upvote it. Title could be something like "Getting 404 instead of 429/5xx"

In the meantime, I suggest you deal with retrying 404s in your code where you know it shouldn't fail. I know, it's just very bad that it returns 404 instead of 5xx or 429.

<!-- gh-comment-id:1100321148 --> @stephanebruckert commented on GitHub (Apr 15, 2022): It looks like this is an issue on the Spotify side rather than the spotipy Python library. These seem related (please upvote them): - https://community.spotify.com/t5/Spotify-for-Developers/Getting-playlist-items-randomly-fails-with-404-Not-Found/m-p/5356441 - https://community.spotify.com/t5/Spotify-for-Developers/Intermittent-404s-Getting-Playlist-Tracks-via-API/m-p/5356770?search-action-id=299899195113&search-result-uid=5356770 - https://community.spotify.com/t5/Spotify-for-Developers/Add-Items-to-Playlist-404-Errors/m-p/5332623 If anyone is up to create a new issue in [Spotify for Developers](https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer) gathering all the data, then we can all upvote it. Title could be something like "Getting 404 instead of 429/5xx" In the meantime, I suggest you deal with retrying 404s in your code where you know it shouldn't fail. I know, it's just very bad that it returns 404 instead of 5xx or 429.
Author
Owner

@GODL0111 commented on GitHub (Aug 22, 2025):

hey guys i am building an apk, i need some data on musical dna. But there is 403 error code, which does not let me get the data due to Spotify updated playlist issues . Can anyone help me with it.

<!-- gh-comment-id:3215336540 --> @GODL0111 commented on GitHub (Aug 22, 2025): hey guys i am building an apk, i need some data on musical dna. But there is 403 error code, which does not let me get the data due to Spotify updated playlist issues . Can anyone help me with it.
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#494
No description provided.