Skip to content

Fix deprecated Spotify Web API endpoints - #48

Open
maxliving wants to merge 1 commit into
varunneal:mainfrom
maxliving:fix/spotify-api-deprecated-endpoints
Open

Fix deprecated Spotify Web API endpoints#48
maxliving wants to merge 1 commit into
varunneal:mainfrom
maxliving:fix/spotify-api-deprecated-endpoints

Conversation

@maxliving

Copy link
Copy Markdown

Summary

Spotify deprecated several playlist-related endpoints in late 2024, replacing /tracks with /items across the playlist API. This PR updates all affected calls.

  • create_playlist: POST /users/{user_id}/playlistsPOST /me/playlists
  • add_tracks_to_playlist: POST /playlists/{id}/tracksPOST /playlists/{id}/items
  • remove_tracks_from_playlist: DELETE /playlists/{id}/tracksDELETE /playlists/{id}/items
  • get_playlist_tracks: replaced sp.playlist()['tracks'] with a direct call to GET /playlists/{id}/items
  • parse_playlist / parse_tracks: handle the renamed response key (trackitem) in playlist item objects, and gracefully handle the missing tracks object in create responses

Test plan

  • Create a playlist via the MCP tool
  • Add tracks to the playlist
  • Get playlist tracks and verify contents
  • Remove tracks from the playlist
  • Confirm no 403s on any of the above

Tested end-to-end against the live Spotify API.

🤖 Generated with Claude Code

Spotify deprecated several playlist endpoints in late 2024. This updates
the affected calls to use the current API surface.

Changes:
- create_playlist: POST /users/{id}/playlists → POST /me/playlists
- add_tracks_to_playlist: POST /playlists/{id}/tracks → POST /playlists/{id}/items
- remove_tracks_from_playlist: DELETE /playlists/{id}/tracks → DELETE /playlists/{id}/items
- get_playlist_tracks: switched from sp.playlist()['tracks'] to GET /playlists/{id}/items directly
- parse_playlist/parse_tracks: handle renamed response key ('track' → 'item') and
  missing 'tracks' object in create response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant