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.
I've been working on an application that requires gathering a large dataset of tracks for model training. For this, I've been using the recommendations endpoint via Spotipy. Over the last month, I have had no issues; but just recently the endpoint started returning null lists.
Here's the code...
# Get list of genre seeds
genre_seeds = sp.recommendation_genre_seeds()
# For each genre...
for genre_seed in tqdm(genre_seeds['genres']):
# Create empty list to store genre's inserts
inserts = []
print(sp.recommendations(seed_genres=[genre_seed], limit=100))
# Retrieve 100 recommendations for genre (wait & retry if timeout)
try:
doc = sp.recommendations(seed_genres=[genre_seed], limit=100)
except ReadTimeout:
time.sleep(60)
doc = sp.recommendations(seed_genres=[genre_seed], limit=100)
print(doc)
Here are some example responses...
{'tracks': [], 'seeds': [{'initialPoolSize': 0, 'afterFilteringSize': 0, 'afterRelinkingSize': 0, 'id': 'latino', 'type': 'GENRE', 'href': None}]}
{'tracks': [], 'seeds': [{'initialPoolSize': 0, 'afterFilteringSize': 0, 'afterRelinkingSize': 0, 'id': 'malay', 'type': 'GENRE', 'href': None}]}
{'tracks': [], 'seeds': [{'initialPoolSize': 0, 'afterFilteringSize': 0, 'afterRelinkingSize': 0, 'id': 'mandopop', 'type': 'GENRE', 'href': None}]}
{'tracks': [], 'seeds': [{'initialPoolSize': 0, 'afterFilteringSize': 0, 'afterRelinkingSize': 0, 'id': 'metal', 'type': 'GENRE', 'href': None}]}
{'tracks': [], 'seeds': [{'initialPoolSize': 0, 'afterFilteringSize': 0, 'afterRelinkingSize': 0, 'id': 'metal-misc', 'type': 'GENRE', 'href': None}]}
{'tracks': [], 'seeds': [{'initialPoolSize': 0, 'afterFilteringSize': 0, 'afterRelinkingSize': 0, 'id': 'metalcore', 'type': 'GENRE', 'href': None}]}
{'tracks': [], 'seeds': [{'initialPoolSize': 0, 'afterFilteringSize': 0, 'afterRelinkingSize': 0, 'id': 'minimal-techno', 'type': 'GENRE', 'href': None}]}
{'tracks': [], 'seeds': [{'initialPoolSize': 0, 'afterFilteringSize': 0, 'afterRelinkingSize': 0, 'id': 'movies', 'type': 'GENRE', 'href': None}]}
{'tracks': [], 'seeds': [{'initialPoolSize': 0, 'afterFilteringSize': 0, 'afterRelinkingSize': 0, 'id': 'mpb', 'type': 'GENRE', 'href': None}]}
To my knowledge, all other endpoints are still working as expected- not sure what's going on here... anyone have any ideas?
Same here as well. Getting recommendations by genre has been working well for me for well over six months, then suddenly stopped working last week. Is there any update from Spotify yet?
Same here!
I'm having a similar issue as well, I wrote an app that returns a random song based on the selected genre. One workaround I found was that I had to add an artist argument, which kind of defeats the point because I wouldn't know the artist being recommended beforehand, but this does return a non-empty list of tracks
`https://api.spotify.com/v1/recommendations?limit=1&market=ES&seed_artists=4NHQUGzhtTLFvgF5SZesLK&seed_genres=${genre}`
I just noticed the artist and track seeds are REQUIRED now in their recommendation spec. That wasn't the case before. Did they make a breaking change and neglect to notify the community?
That's weird, because they're definitely not BOTH required. You can still send just an artist or a track and get recommendations back.
If you are looking for playlists with genres, you can go to the website Every Noise At Once.
Seems like they had a similar issue in 2020 - https://community.spotify.com/t5/Spotify-for-Developers/Web-API-recommendations-not-returned-for-gen...
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…