Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get Spotify images for the artists that are similar to weezer
import pyen
import spotipy
import sys
'''
get a set of images for artists that are similar to
the given seed artist
'''
en = pyen.Pyen()
sp = spotipy.Spotify()
spids = []
response = en.get('artist/similar', name='weezer', bucket='id:spotify', limit=True)
for artist in response['artists']:
spids.append(artist['foreign_ids'][0]['foreign_id'])
for artist in sp.artists(spids)['artists']:
print artist['images'][0]['url'], artist['name']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.