{"id":28204,"library":"spotify-random-saved-album","title":"spotify-random-saved-album","description":"A CLI tool that retrieves a URL to a random album from a user's Spotify saved albums. Version 0.0.8 requires Python >=3.7, uses the Spotify Web API, and is released on PyPI. Development is sporadic.","status":"active","version":"0.0.8","language":"python","source_language":"en","source_url":"https://github.com/ciglenecki/spotify-random-saved-album","tags":["spotify","cli","random","album","api"],"install":[{"cmd":"pip install spotify-random-saved-album","lang":"bash","label":"pip"}],"dependencies":[{"reason":"Used for Spotify API authentication and calls","package":"spotipy","optional":false},{"reason":"Used for HTTP requests","package":"requests","optional":false}],"imports":[{"note":"Function returns a URL string","symbol":"get_random_album_url","correct":"from spotify_random_saved_album import get_random_album_url"}],"quickstart":{"code":"from spotify_random_saved_album import get_random_album_url\nimport os\n\n# Requires SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET, SPOTIPY_REDIRECT_URI env vars\nurl = get_random_album_url()\nprint(url)","lang":"python","description":"Import the function and call it after setting Spotify API credentials as environment variables."},"warnings":[{"fix":"Set these environment variables before calling any function.","message":"The library expects SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET, and SPOTIPY_REDIRECT_URI environment variables to be set; otherwise it raises a configuration error.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure SPOTIPY_REDIRECT_URI is registered in the Spotify Developer Dashboard for your app.","message":"The redirect URI must match exactly one of the URIs registered in the Spotify Developer Dashboard (including localhost for local development).","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":"Verify that SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET, SPOTIPY_REDIRECT_URI are set and that the redirect URI is exactly as registered in the Spotify Developer Dashboard.","cause":"Usually missing or invalid environment variables, or the redirect URI mismatch.","error":"spotipy.exceptions.SpotifyException: http status: 400, code: -1 - Bad request: ..."},{"fix":"Install with 'pip install spotify-random-saved-album' and import using underscores: 'from spotify_random_saved_album import get_random_album_url'.","cause":"Package not installed or wrong import path (hyphen vs underscore).","error":"ModuleNotFoundError: No module named 'spotify_random_saved_album'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}