Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
If you use the API https://api.spotify.com/v1/playlists/{playlist_id}/tracks it removes ALL TRACKS from the playlist that match the given URI.
But how can I delete one track? Or a certain number of tracks with such a URI?
Solved! Go to Solution.
There's another format for the body of the request that is missing from the documentation. You can specify the position of the items in the playlist:
{
"tracks": [
{
"uri": "spotify:track:4HDLmWf73mge8isanCASnU",
"positions": [1, 4]
},
{
"uri": "spotify:track:0bxcUgWlOURkU6lZt4zog0",
"positions":[2, 3]
}
]
}
Use the same endpoint mentioned in the previous comments.
Anyone can help?
There is also a problem with getting the correct URIs for songs via https://api.spotify.com/v1/me/tracks.
If you receive URIs for songs through https://api.spotify.com/v1/me/tracks, then these URIs are different from the URIs in the library.
Hey there, help's here!
Let's dive right into this. You can find more information about removing tracks from a playlist here: https://developer.spotify.com/documentation/web-api/reference/#endpoint-remove-tracks-playlist.
You can use that endpoint to remove tracks. Here's an example request:
curl -X "DELETE" "https://api.spotify.com/v1/playlists/PLAYLISTID/tracks" --data "{\"tracks\":[{\"uri\":\"TRACKID\"}]}" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer XXXXX"
That should help here. Let me know how you get on!
Have a great day,
Hubo
Thanks for the answer.
My request is
{"tracks": [{"uri": "spotify:track:1L3AZIJzMvE08VvBkeFJvg"}]}
And API deletes all tracks in playlist, which matches URI spotify:track:1L3AZIJzMvE08VvBkeFJvg
For example, i have 5 songs with URI spotify:track:1L3AZIJzMvE08VvBkeFJvg in playlist, and this request deletes all songs that matches this URI. But i want to delete 1 song, not all.
This is my video with my actions.
There's another format for the body of the request that is missing from the documentation. You can specify the position of the items in the playlist:
{
"tracks": [
{
"uri": "spotify:track:4HDLmWf73mge8isanCASnU",
"positions": [1, 4]
},
{
"uri": "spotify:track:0bxcUgWlOURkU6lZt4zog0",
"positions":[2, 3]
}
]
}
Use the same endpoint mentioned in the previous comments.
Yeah, thanks, it works.
I tested with position parameter previously, but it didn't work.
Only then I realized that the tracks are added to the end of the playlist, not the beginning 🙂
is this still supported? can't get positions to work
Hello,
For me works.
Just make sure that first it works without the positions.
Then pass in an integer, if you are using variable make sure it is also an integer.
"tracks": [
{
"uri": `spotify:track:${songId}`,
"positions": [songToRemoveIndex]
}
]
songToRemoveIndex -> parseInt(event.target.getAttribute('index'), 10)
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…