Registry / ai-ml / spotify-recommender-api

spotify-recommender-api

JSON →
library5.4.5pypypiunverified

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.

pip install spotify-recommender-api==5.4.5
INSTALL
IMPORT
SIG · SPOTIFY-RECOMMENDE
S
spotify-recommender-api
ai-mlpythonv5.4.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SpotifyAPI
from spotify_recommender_api import SpotifyAPI
from spotify_recommender_api import SpotifyAPI

Authenticate with Spotify and get song recommendations for a given playlist.

from spotify_recommender_api import SpotifyAPI api = SpotifyAPI( client_id='YOUR_CLIENT_ID', client_secret='YOUR_CLIENT_SECRET', redirect_uri='http://localhost:8888/callback' ) # Authenticate and get token api.authenticate() # Get recommendations based on a playlist ID playlist_id = 'your_playlist_id' recommendations = api.recommend_songs(playlist_id, count=10) for song in recommendations: print(song['name'], song['artists'])
Debug
Known issues
deprecatedLibrary is deprecated and no longer maintained. Spotify API changes in May 2025 broke core endpoints; recommendations may fail or return empty results.
fix
Consider migrating to official Spotify Web API via spotipy library directly.
affects: >=5.0.0
breakingAuthentication flow changed in v5.2.0: token refreshing is now automatic. Old code that manually refreshes tokens may cause duplicate calls or errors.
fix
Upgrade to >=5.2.0 and remove manual token refresh logic.
affects: <5.2.0
gotchaThe 'recommend_songs' method requires a playlist ID from a public or collaborative playlist; private playlists will cause a 403 error silently.
fix
Ensure the playlist is public or use your own authorized user's playlist with proper scopes.
affects: all
Upgrade
Version history
5.4.5latest on PyPI · released Aug 18, 2024
Audit
Dependencies
spotipyrequiredCore dependency for Spotify Web API interactions
pandasrequiredUsed for data manipulation and playlist analysis
scikit-learnrequiredProvides K-Nearest-Neighbors algorithm
vadersentimentoptionalOptional: Sentiment analysis for lyrics (VADER) used in recommendation algorithm
tqdmrequiredProgress bar support
Agent activity
18 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
spotify-recommender-api — pip install spotify-recommender-api · libregistry