{"id":28219,"library":"spotifyaio","title":"Spotifyaio","description":"Asynchronous Python client for the Spotify Web API, built on aiohttp. Current version 2.0.2, requires Python >=3.13. Actively maintained with frequent releases.","status":"active","version":"2.0.2","language":"python","source_language":"en","source_url":"https://github.com/joostlek/python-spotify","tags":["spotify","async","api-client","aiohttp"],"install":[{"cmd":"pip install spotifyaio","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"HTTP client used for all API requests","package":"aiohttp","optional":false},{"reason":"URL handling","package":"yarl","optional":false}],"imports":[{"note":"","wrong":null,"symbol":"SpotifyClient","correct":"from spotifyaio import SpotifyClient"}],"quickstart":{"code":"import asyncio\nfrom spotifyaio import SpotifyClient\n\nasync def main():\n    client_id = os.environ.get('SPOTIFY_CLIENT_ID', '')\n    client_secret = os.environ.get('SPOTIFY_CLIENT_SECRET', '')\n    async with SpotifyClient(client_id=client_id, client_secret=client_secret) as client:\n        track = await client.tracks.get('4cOdK2wGLETKBW3PvgPWqT')\n        print(track.name)\n\nasyncio.run(main())","lang":"python","description":"Quickstart: authenticate and fetch a track by ID."},"warnings":[{"fix":"Upgrade Python to 3.13 or later, or pin spotifyaio to <2.0.0 if Python 3.12 is required.","message":"Version 2.0.0 drops Python 3.12 support; only Python >=3.13 is supported.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Upgrade Python accordingly.","message":"Version 1.0.0 drops Python 3.11 support; only Python >=3.12 was supported at that time, but v2.0.0 now requires 3.13.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Always use `async with SpotifyClient(...) as client:` or explicitly call `await client.close()`.","message":"The client must be used as an async context manager. Forgetting 'async with' will lead to unclosed session warnings.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `track.name` safely by checking `if track:` or use `.get()` if available.","message":"API calls may return None for optional fields. Always check for None before accessing nested attributes.","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 `async with SpotifyClient(...) as client:` pattern.","cause":"Incorrect instantiation of SpotifyClient without async context manager, or reusing a session improperly.","error":"TypeError: ClientSession.__aenter__() got multiple values for argument 'self'"},{"fix":"Verify credentials from Spotify Developer Dashboard and set environment variables correctly.","cause":"Invalid or expired client credentials (client_id/client_secret).","error":"spotifyaio.exceptions.SpotifyError: 401 - Unauthorized"},{"fix":"Implement your own rate limiting or add delays between requests.","cause":"Rate limit exceeded. The client does not automatically throttle requests.","error":"spotifyaio.exceptions.SpotifyError: 429 - Too Many Requests"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}