{"id":28205,"library":"spotify-recommender-api","title":"spotify-recommender-api","description":"Generates song recommendations for Spotify playlists using K-Nearest-Neighbors and optionally VADER sentiment analysis. Version 5.4.5 is the final release; the library has been deactivated due to Spotify API changes in 2025. No longer maintained.","status":"deprecated","version":"5.4.5","language":"python","source_language":"en","source_url":"https://github.com/nikolas-virionis/spotify-api","tags":["spotify","recommendations","knn","music","deprecated"],"install":[{"cmd":"pip install spotify-recommender-api==5.4.5","lang":"bash","label":"Latest final version"}],"dependencies":[{"reason":"Core dependency for Spotify Web API interactions","package":"spotipy","optional":false},{"reason":"Used for data manipulation and playlist analysis","package":"pandas","optional":false},{"reason":"Provides K-Nearest-Neighbors algorithm","package":"scikit-learn","optional":false},{"reason":"Optional: Sentiment analysis for lyrics (VADER) used in recommendation algorithm","package":"vadersentiment","optional":true},{"reason":"Progress bar support","package":"tqdm","optional":false}],"imports":[{"note":"Direct import of the library does not expose the main class; you must import the class explicitly.","wrong":"import spotify_recommender_api","symbol":"SpotifyAPI","correct":"from spotify_recommender_api import SpotifyAPI"},{"note":"The function is re-exported at package level; avoid deep imports to prevent breaking on refactors.","wrong":"from spotify_recommender_api.spotify_api import recommend_songs","symbol":"recommend_songs","correct":"from spotify_recommender_api import recommend_songs"}],"quickstart":{"code":"from spotify_recommender_api import SpotifyAPI\n\napi = SpotifyAPI(\n    client_id='YOUR_CLIENT_ID',\n    client_secret='YOUR_CLIENT_SECRET',\n    redirect_uri='http://localhost:8888/callback'\n)\n\n# Authenticate and get token\napi.authenticate()\n\n# Get recommendations based on a playlist ID\nplaylist_id = 'your_playlist_id'\nrecommendations = api.recommend_songs(playlist_id, count=10)\nfor song in recommendations:\n    print(song['name'], song['artists'])","lang":"python","description":"Authenticate with Spotify and get song recommendations for a given playlist."},"warnings":[{"fix":"Consider migrating to official Spotify Web API via spotipy library directly.","message":"Library is deprecated and no longer maintained. Spotify API changes in May 2025 broke core endpoints; recommendations may fail or return empty results.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Upgrade to >=5.2.0 and remove manual token refresh logic.","message":"Authentication flow changed in v5.2.0: token refreshing is now automatic. Old code that manually refreshes tokens may cause duplicate calls or errors.","severity":"breaking","affected_versions":"<5.2.0"},{"fix":"Ensure the playlist is public or use your own authorized user's playlist with proper scopes.","message":"The 'recommend_songs' method requires a playlist ID from a public or collaborative playlist; private playlists will cause a 403 error silently.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use: from spotify_recommender_api import SpotifyAPI","cause":"Importing the package directly instead of the class.","error":"AttributeError: module 'spotify_recommender_api' has no attribute 'SpotifyAPI'"},{"fix":"Authenticate with scope='playlist-read-private' and ensure the playlist is accessible by the user.","cause":"The playlist is private or the token lacks required scopes (playlist-read-private).","error":"spotipy.exceptions.SpotifyException: http status: 403, code:-1 - Forbidden"},{"fix":"Install it: pip install vadersentiment","cause":"VADER sentiment is an optional dependency not installed by default.","error":"ModuleNotFoundError: No module named 'vadersentiment'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}