2,341 official scripts
Tested scripts for the sites people automate most, ready for your agent to run.
Get tracks of a Spotify playlist
Read one page of 25 tracks of a Spotify playlist, or of your Liked Songs, as the signed-in user: the playlist uri and name, its total track count, and for each track its position, uri, name, artists, album, duration, play count and when and by whom it was added. Pass offset to read the next pages; next_offset is null after the last page. An empty playlist returns no tracks.
Add tracks to a Spotify playlist
Add one or more tracks to the end of a playlist the signed-in Spotify account can edit, in the order given. Spotify accepts duplicates, so a track already in the playlist is added again. Returns the playlist's track count before and after, so the addition can be checked. Use remove_tracks_from_playlist to undo it.
Create a Spotify playlist
Create a playlist on the signed-in Spotify account, with a name, an optional description, and private (the default) or public. Returns the new playlist's id, uri and link, with the name, description and visibility read back from Spotify after saving. Spotify allows several playlists with one name, so calling it twice creates two. Use delete_playlist to undo it.
Delete a Spotify playlist
Delete a playlist the signed-in Spotify account owns, as the player's Delete action does: it leaves the account's library and its followers can no longer find it. Returns the deleted playlist's id and name. The inverse of create_playlist.
Remove tracks from a Spotify playlist
Remove tracks from a playlist the signed-in Spotify account can edit. Every occurrence of each given track is removed. A track that is not in the playlist is reported in not_found and left alone; if none of them is in it, nothing is changed. Returns the playlist's track count before and after. The inverse of add_tracks_to_playlist.
