open.spotify.com
Add tracks to a Spotify playlist
TL;DR
About
It works on playlists that your account can edit. Spotify accepts duplicates, so a track already in the playlist is added again. It returns the number of tracks before and after, so you can check the change. To undo it, use the remove_tracks_from_playlist script. It needs a browser signed in to Spotify.
Inputs
tracks requiredTracks to add, each an id, a spotify:track: uri or an open.spotify.com/track/ link.
playlist requiredTarget playlist, as an id, a spotify:playlist: uri or an open.spotify.com/playlist/ link. The signed-in account must be able to edit it.
Output
added requiredHow many tracks the playlist gained, read back from Spotify after the addition.
requested requiredplaylist_id requiredplaylist_name requiredtrack_count_after requiredtrack_count_before requiredtrack_uris optionalThe tracks sent, as uris, in order.
playlist_url optional