[GH-ISSUE #280] 404 not found exception on GetSimilarArtists #207

Closed
opened 2026-02-27 19:26:35 +03:00 by kerem · 2 comments
Owner

Originally created by @Offbeatmammal on GitHub (Dec 2, 2024).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/280

just wondering if something has changed in the SpotifyAPI? this code was working on Friday, but today I'm getting an exception:

require_once 'vendor/autoload.php';
$session = new SpotifyWebAPI\Session('?????','?????');
$session->requestCredentialsToken();
$accessToken = $session->getAccessToken();
$api = new SpotifyWebAPI\SpotifyWebAPI();
$api->setAccessToken($accessToken);
....
$artist = "6eUKZXaKkcviH0Ku9w2n3V";    // Should be Ed Sheeran
$artists = $api->getArtistRelatedArtists($artist);

this now throws:

Uncaught SpotifyWebAPI\SpotifyWebAPIException: Not Found in C:\...\vendor\jwilsson\spotify-web-api-php\src\Request.php:46
Stack trace: #0 C:\...\vendor\jwilsson\spotify-web-api-php\src\Request.php(250): SpotifyWebAPI\Request->handleResponseError('{"error": {"sta...', 404)
#1 C:\...\vendor\jwilsson\spotify-web-api-php\src\Request.php(138): SpotifyWebAPI\Request->send('GET', 'https://api.spo...', '', 'HTTP/2 404 \ncon...') 
#2 C:\...\vendor\jwilsson\spotify-web-api-php\src\SpotifyWebAPI.php(122): SpotifyWebAPI\Request->api('GET', '/v1/artists/0Tn...', Array, Array) 
#3 C:\...\vendor\jwilsson\spotify-web-api-php\src\SpotifyWebAPI.php(768): SpotifyWebAPI\SpotifyWebAPI->sendRequest('GET', '/v1/artists/0Tn...') 
#4 C:\...\spotify_artist.php(409): SpotifyWebAPI\SpotifyWebAPI->getArtistRelatedArtists('0TnOYISbd1XYRBk...') 
#5 {main} thrown in C:\...\vendor\jwilsson\spotify-web-api-php\src\Request.php on line 46

other calls, eg $results = $api->search(str_replace(" ","+","Ed Sheeran"), 'artist'); are still working fine

Originally created by @Offbeatmammal on GitHub (Dec 2, 2024). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/280 just wondering if something has changed in the SpotifyAPI? this code was working on Friday, but today I'm getting an exception: require_once 'vendor/autoload.php'; $session = new SpotifyWebAPI\Session('?????','?????'); $session->requestCredentialsToken(); $accessToken = $session->getAccessToken(); $api = new SpotifyWebAPI\SpotifyWebAPI(); $api->setAccessToken($accessToken); .... $artist = "6eUKZXaKkcviH0Ku9w2n3V"; // Should be Ed Sheeran $artists = $api->getArtistRelatedArtists($artist); this now throws: Uncaught SpotifyWebAPI\SpotifyWebAPIException: Not Found in C:\...\vendor\jwilsson\spotify-web-api-php\src\Request.php:46 Stack trace: #0 C:\...\vendor\jwilsson\spotify-web-api-php\src\Request.php(250): SpotifyWebAPI\Request->handleResponseError('{"error": {"sta...', 404) #1 C:\...\vendor\jwilsson\spotify-web-api-php\src\Request.php(138): SpotifyWebAPI\Request->send('GET', 'https://api.spo...', '', 'HTTP/2 404 \ncon...') #2 C:\...\vendor\jwilsson\spotify-web-api-php\src\SpotifyWebAPI.php(122): SpotifyWebAPI\Request->api('GET', '/v1/artists/0Tn...', Array, Array) #3 C:\...\vendor\jwilsson\spotify-web-api-php\src\SpotifyWebAPI.php(768): SpotifyWebAPI\SpotifyWebAPI->sendRequest('GET', '/v1/artists/0Tn...') #4 C:\...\spotify_artist.php(409): SpotifyWebAPI\SpotifyWebAPI->getArtistRelatedArtists('0TnOYISbd1XYRBk...') #5 {main} thrown in C:\...\vendor\jwilsson\spotify-web-api-php\src\Request.php on line 46 other calls, eg `$results = $api->search(str_replace(" ","+","Ed Sheeran"), 'artist');` are still working fine
kerem closed this issue 2026-02-27 19:26:36 +03:00
Author
Owner

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

Hello!
I'm afraid this sounds like you've been affected by the recent changes made by Spotify to certain APIs, including "get related artists" 😕

<!-- gh-comment-id:2510536050 --> @jwilsson commented on GitHub (Dec 2, 2024): Hello! I'm afraid this sounds like you've been affected by the [recent changes](https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api) made by Spotify to certain APIs, including "get related artists" 😕
Author
Owner

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

ugh, that sucks. this is a pre-existing app, but I guess Spotify don't really care. thanks for pointing that out, guess we'll just deprecate Spotify support in favour of Last.FM relatedArtists

<!-- gh-comment-id:2510626396 --> @Offbeatmammal commented on GitHub (Dec 2, 2024): ugh, that sucks. this is a pre-existing app, but I guess Spotify don't really care. thanks for pointing that out, guess we'll just deprecate Spotify support in favour of Last.FM relatedArtists
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/spotify-web-api-php#207
No description provided.