Spotipy: Search query for a specific genre from a specific year?

Created on 20 Jan 2020  ·  4Comments  ·  Source: plamere/spotipy

Pretty much what the title said. Kudos for the module!

Most helpful comment

hey I managed to get it done. What I did was give a whitespace between the two params.
The query is something like sp.search("genre:avant-garde year:1966", type=artist)

All 4 comments

It might work but you need to build your own query and pass it to sp.search(query).

Look for "year" on this page https://developer.spotify.com/documentation/web-api/reference/search/search

@stephanebruckert I tried it but what basically happens is that I can either only search using the genre or the year but not those two together. Adding a '+' between them does not work.

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.

this example looks promising, what does it give with genre and year?

Let me know if it works, but if it doesn't, you should post an issue in https://github.com/spotify/web-api/ instead, because this is related to what you receive from the API directly.

Edit: also note that tracks don't have a genre, only artists and albums sometimes do, so type=track might not give any result

hey I managed to get it done. What I did was give a whitespace between the two params.
The query is something like sp.search("genre:avant-garde year:1966", type=artist)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kurchunk picture Kurchunk  ·  3Comments

gawaineo picture gawaineo  ·  3Comments

Jeoffreybauvin picture Jeoffreybauvin  ·  4Comments

sheheryarbutt picture sheheryarbutt  ·  5Comments

ElementO2512 picture ElementO2512  ·  4Comments