Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Get playlist items can not filter out tracks which are unable to be played

Get playlist items can not filter out tracks which are unable to be played

Plan: Premium

Country: NL

 

Device: all

 

My Question or Issue:

Whenever I fetch a users playlist tracks (https://developer.spotify.com/documentation/web-api/reference/get-playlists-tracks) there is no option to filter out the tracks which are unable to be played (greyed out in the Spotify interface) 

xiduzo_1-1681159452839.png

 

Whenever I try to play this track via the API the playback stops and the official player itself will give me the notification as in the screenshot.

xiduzo_0-1681159417014.png

 

I also do not get any proper error response back from the API, just a "200" response that the track will be played



Edit: The track response I get back from the API is


 {
"album":{
"album_group":"single",
"album_type":"single",
"artists":[
{
"external_urls":{
"spotify":"https://open.spotify.com/artist/5sBoNBXFMzoZjgHLbQueeG"
},
"href":"https://api.spotify.com/v1/artists/5sBoNBXFMzoZjgHLbQueeG",
"id":"5sBoNBXFMzoZjgHLbQueeG",
"name":"Antoon",
"type":"artist",
"uri":"spotify:artist:5sBoNBXFMzoZjgHLbQueeG"
}
],
"available_markets":[

],
"external_urls":{
"spotify":"https://open.spotify.com/album/6u8hxDwFqeZvHoqEJ2h61l"
},
"href":"https://api.spotify.com/v1/albums/6u8hxDwFqeZvHoqEJ2h61l",
"id":"6u8hxDwFqeZvHoqEJ2h61l",
"images":[
{
"height":640,
"url":"https://i.scdn.co/image/ab67616d0000b273e0626fefa83ec12994490595",
"width":640
},
{
"height":300,
"url":"https://i.scdn.co/image/ab67616d00001e02e0626fefa83ec12994490595",
"width":300
},
{
"height":64,
"url":"https://i.scdn.co/image/ab67616d00004851e0626fefa83ec12994490595",
"width":64
}
],
"is_playable":true,
"name":"Antoon, Vol. 1",
"release_date":"2019-04-29",
"release_date_precision":"day",
"total_tracks":5,
"type":"album",
"uri":"spotify:album:6u8hxDwFqeZvHoqEJ2h61l"
},
"artists":[
{
"external_urls":{
"spotify":"https://open.spotify.com/artist/5sBoNBXFMzoZjgHLbQueeG"
},
"href":"https://api.spotify.com/v1/artists/5sBoNBXFMzoZjgHLbQueeG",
"id":"5sBoNBXFMzoZjgHLbQueeG",
"name":"Antoon",
"type":"artist",
"uri":"spotify:artist:5sBoNBXFMzoZjgHLbQueeG"
},
{
"external_urls":{
"spotify":"https://open.spotify.com/artist/2Po8VeX1gTEG18KSGaEgAE"
},
"href":"https://api.spotify.com/v1/artists/2Po8VeX1gTEG18KSGaEgAE",
"id":"2Po8VeX1gTEG18KSGaEgAE",
"name":"WG",
"type":"artist",
"uri":"spotify:artist:2Po8VeX1gTEG18KSGaEgAE"
}
],
"available_markets":[

],
"disc_number":1,
"duration_ms":169500,
"episode":false,
"explicit":true,
"external_ids":{
"isrc":"QZ93L1933735"
},
"external_urls":{
"spotify":"https://open.spotify.com/track/7pI0NXgSSudY9YG9dlO9Yn"
},
"href":"https://api.spotify.com/v1/tracks/7pI0NXgSSudY9YG9dlO9Yn",
"id":"7pI0NXgSSudY9YG9dlO9Yn",
"is_local":false,
"name":"Hoe Het Echt Zit",
"popularity":0,
"preview_url":null,
"track":true,
"track_number":4,
"type":"track",
"uri":"spotify:track:7pI0NXgSSudY9YG9dlO9Yn"
}

 

Reply
2 Replies

Have you tried fields params?

&fields=items(added_by.id,track(preview_url).filter(preview_url.not_null()))

Thanks for your answer! Unfortunately, other tracks also do not have a preview URL but are able to be played so this will not be the correct filter I guess?

Suggested posts

Let's introduce ourselves!

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…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random