[GH-ISSUE #536] Is there any way we can find the id of a playlist without searching for it manually? #323

Closed
opened 2026-02-27 23:22:00 +03:00 by kerem · 2 comments
Owner

Originally created by @ctran7 on GitHub (Jul 8, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/536

Seeing as there are a lot of functions requiring the id of a playlist, the only way I can see how is using the user_playlists function, loop through the results and match it by the desired name, and get the id there. I think there would be a benefit with adding this functionality with the get go, unless there is some easier way I could not find.

Additionally, I am creating the playlist and immediately adding tracks to it. It would be nice to have the playlist id as a returned value to the user_playlist_create function. Unless this is already a thing, and it's not in the documentation.

Originally created by @ctran7 on GitHub (Jul 8, 2020). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/536 Seeing as there are a lot of functions requiring the id of a playlist, the only way I can see how is using the user_playlists function, loop through the results and match it by the desired name, and get the id there. I think there would be a benefit with adding this functionality with the get go, unless there is some easier way I could not find. Additionally, I am creating the playlist and immediately adding tracks to it. It would be nice to have the playlist id as a returned value to the user_playlist_create function. Unless this is already a thing, and it's not in the documentation.
kerem 2026-02-27 23:22:00 +03:00
Author
Owner

@a-camarillo commented on GitHub (Jul 8, 2020):

I haven't used the spotipy user_playlist_create function but I would think it returns the playlist object from Spotify's playlist endpoint. Create a playlist documentation shows the playlist id is returned as part of the playlist object so it should be an easy value to get.

Hope this helps

<!-- gh-comment-id:655785563 --> @a-camarillo commented on GitHub (Jul 8, 2020): I haven't used the spotipy `user_playlist_create` function but I would think it returns the playlist object from Spotify's playlist endpoint. [Create a playlist](https://developer.spotify.com/documentation/web-api/reference/playlists/create-playlist/) documentation shows the playlist id is returned as part of the playlist object so it should be an easy value to get. Hope this helps
Author
Owner

@ctran7 commented on GitHub (Jul 9, 2020):

Thanks so much!

<!-- gh-comment-id:655876909 --> @ctran7 commented on GitHub (Jul 9, 2020): Thanks so much!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#323
No description provided.