Announcements

Help Wizard

Step 1

NEXT STEP

Search doesn't return results sometimes when using artist: field filter

Search doesn't return results sometimes when using artist: field filter

https://community.spotify.com/t5/forums/postpage/board-id/Spotify_Developer

With some artists no result is returned when explicitly using the artist field filter "artist:". I do this with most queries for the track type in the Search API, to prevent that I get cover songs from other artists. 

 

To my surprise sometimes no result is returned, while the artist and song are present in Spotify for sure. If I leave out the field filter the correct song is returned. 

 

Behaviour is the same in Search API as in the Spotify Desktop application (search field)

 

For example:
"Blitzkriegbop" artist:Ramones  > no results
"Blitzkriegbop" Ramones > the right result

"four to the flour" artist:starsailor > no results
"four to the flour" starsailor > the right result

"Themes For Great Cities" artist:Simple Minds > no results
"Themes For Great Cities" Simple Minds > the right result

Reply
3 Replies

Hey @kasperkamperma, help's here!

Let's have a look at what's happening here! The 'artist:'-operator isn't supported at this moment. If this is something you'd like to see, I recommend creating a new idea on the Ideas board. That's the best way to get your feedback to the right teams at Spotify. Search operators you can use in your query are: 'year:', 'label:' and 'genre'. 


Feel free to give me a shout, if you have any questions!

 

Have a great day and happy coding,

Hubo

HuboSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Where do you find it's not supported?

It's mentioned in the API documentation:
https://developer.spotify.com/documentation/web-api/reference/search/search/

Field filters: By default, results are returned when a match is found in any field of the target object type. Searches can be made more specific by specifying an album, artist or track field filter.

For example: The query q=album:gold%20artist:abba&type=album returns only albums with the text “gold” in the album name and the text “abba” in the artist name.

Were you able to resolve the issue? It seems that they've removed the field filter because my scripts for importing playlists that used to work a year ago have become pretty much useless due to the miss ratio. To add salt to injury, they still haven't updated the API docs to reflect whatever bogus changes were made internally.

I guess the only way now is to rely arbitrarily at the mercy of search without specifying which field goes where and then checking through the results on the client side. My heartfelt thanks go to Spotify for needlessly making things more hectic on the client-side programmers' end by removing such basic filters from the API search.

Suggested posts