[GH-ISSUE #481] Is there a way to get the playlist ID of a newly created playlist? #284

Closed
opened 2026-02-27 23:21:47 +03:00 by kerem · 1 comment
Owner

Originally created by @eliasbenb on GitHub (Apr 26, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/481

I'm trying to create a new playlist and append a set of tracks to it.
This is what I'm using now:

sp.user_playlist_create(username, "Playlist", public=False, description="Playlist")
sp.user_playlist_add_tracks(username, playlist_id, track_ids)`

My question is how would I get the playlist ID from the the newly created playlist?

Originally created by @eliasbenb on GitHub (Apr 26, 2020). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/481 I'm trying to create a new playlist and append a set of tracks to it. This is what I'm using now: ``` sp.user_playlist_create(username, "Playlist", public=False, description="Playlist") sp.user_playlist_add_tracks(username, playlist_id, track_ids)` ``` My question is how would I get the playlist ID from the the newly created playlist?
kerem 2026-02-27 23:21:47 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@ritiek commented on GitHub (Apr 26, 2020):

sp.user_playlist_create returns the new playlist details. So you could do:

myplaylist = spotify.user_playlist_create(
    username,
    "Playlist",
    public=False,
    description="Playlist"
)
print(myplaylist["id"])
<!-- gh-comment-id:619574494 --> @ritiek commented on GitHub (Apr 26, 2020): `sp.user_playlist_create` returns the new playlist details. So you could do: ```python myplaylist = spotify.user_playlist_create( username, "Playlist", public=False, description="Playlist" ) print(myplaylist["id"]) ```
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#284
No description provided.