In [1]:
!pip3 install requests


Requirement already satisfied (use --upgrade to upgrade): requests in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages

graded = 8/8


In [2]:
import requests
response = requests.get('https://api.spotify.com/v1/search?q=Lil&type=artist&market=US&limit=50')
Lil = response.json()
print(Lil.keys())


dict_keys(['artists'])

In [3]:
print(type(Lil['artists']))


<class 'dict'>

In [4]:
print(Lil['artists'].keys())


dict_keys(['total', 'previous', 'items', 'next', 'limit', 'href', 'offset'])

In [5]:
Lil_info = Lil['artists']['items']

In [6]:
print(type(Lil_info))


<class 'list'>

In [7]:
print(Lil_info[1])


{'type': 'artist', 'id': '6icQOAFXDZKsumw3YXyusw', 'images': [{'url': 'https://i.scdn.co/image/add25baa69fc7bfd9cfd5d87716941028c2d6736', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/3f8205117bdd028a648ad3fc925f9fb46dfa26fa', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/ccc54e2911dbc5463acb401ee61489e27d991408', 'height': 64, 'width': 64}], 'popularity': 73, 'external_urls': {'spotify': 'https://open.spotify.com/artist/6icQOAFXDZKsumw3YXyusw'}, 'followers': {'total': 43484, 'href': None}, 'genres': [], 'href': 'https://api.spotify.com/v1/artists/6icQOAFXDZKsumw3YXyusw', 'uri': 'spotify:artist:6icQOAFXDZKsumw3YXyusw', 'name': 'Lil Yachty'}

1# Do a search and print a list of 50 that are playable in the USA (or the country of your choice), along with their popularity score. What genres are most represented in the search results? Edit your previous printout to also display a list of their genres in the format "GENRE_1, GENRE_2, GENRE_3". If there are no genres, print "No genres listed".


In [8]:
for every_lil in Lil_info:
    print(every_lil['name'], every_lil['popularity'],"Genre:",(", ".join(every_lil['genres'])))
    if every_lil['genres'] == []:
        print("No genres listed")


Lil Wayne 86 Genre: dirty south rap, pop rap, southern hip hop, trap music
Lil Yachty 73 Genre: 
No genres listed
Lil Uzi Vert 74 Genre: 
No genres listed
Lil Dicky 69 Genre: 
No genres listed
Boosie Badazz 67 Genre: 
No genres listed
Lil Jon 72 Genre: crunk, dirty south rap, southern hip hop
King Lil G 61 Genre: 
No genres listed
Lil Durk 60 Genre: 
No genres listed
Lil Jon & The East Side Boyz 60 Genre: 
No genres listed
Lil Bibby 54 Genre: 
No genres listed
G Herbo 53 Genre: 
No genres listed
Lil Rob 50 Genre: chicano rap, latin hip hop
Lil Reese 50 Genre: 
No genres listed
Bow Wow 57 Genre: hip pop, pop rap
Lil Keke 48 Genre: 
No genres listed
Lil Scrappy 50 Genre: crunk, dirty south rap, southern hip hop, trap music
Lil Wyte 50 Genre: juggalo
Lil Blood 46 Genre: 
No genres listed
Lil Snupe 45 Genre: 
No genres listed
Lil Mama 45 Genre: hip pop
Lil Boom 46 Genre: 
No genres listed
Lil B 44 Genre: 
No genres listed
Lil' Kim 62 Genre: hip pop
Lil Cuete 40 Genre: chicano rap
Lil Phat 40 Genre: 
No genres listed
Lil Debbie 43 Genre: 
No genres listed
Lil Twist 40 Genre: jerk
Lil Trill 37 Genre: deep trap
Lil Goofy 36 Genre: 
No genres listed
Lil Lonnie 37 Genre: 
No genres listed
Lil AJ 37 Genre: 
No genres listed
Lil Haiti 37 Genre: 
No genres listed
Lil Cray 36 Genre: 
No genres listed
Lil Twon 36 Genre: 
No genres listed
Mr. Lil One 36 Genre: chicano rap
Lil Silva 43 Genre: 
No genres listed
Lil Flash 38 Genre: 
No genres listed
Lil Yase 34 Genre: 
No genres listed
Lil Mouse 35 Genre: 
No genres listed
Lil Suzy 34 Genre: freestyle
Lil Eddie 41 Genre: 
No genres listed
Lil Rue 34 Genre: 
No genres listed
Lil Kesh 39 Genre: 
No genres listed
Lil Wayne, DJ Drama 35 Genre: 
No genres listed
Lil C 33 Genre: 
No genres listed
Lil Rick 39 Genre: soca
Lil E 34 Genre: 
No genres listed
Lil June 32 Genre: 
No genres listed
Lil Fate 34 Genre: 
No genres listed
Lil' Flip 50 Genre: crunk, dirty south rap

2) What genres are most represented in the search results?


In [13]:
genres = []
for item in Lil_info:
    genres = item['genres'] + genres
print(genres)

unique_genres = set(genres)
for every_genre in unique_genres:

    print(every_genre , genres.count(every_genre))
    

#genre_name = set(every_genre)
#genre_number = set(genres.count(every_genre))
    #print(genre_name)


['crunk', 'dirty south rap', 'soca', 'freestyle', 'chicano rap', 'deep trap', 'jerk', 'chicano rap', 'hip pop', 'hip pop', 'juggalo', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'hip pop', 'pop rap', 'chicano rap', 'latin hip hop', 'crunk', 'dirty south rap', 'southern hip hop', 'dirty south rap', 'pop rap', 'southern hip hop', 'trap music']
pop rap 2
latin hip hop 1
crunk 3
dirty south rap 4
soca 1
deep trap 1
freestyle 1
chicano rap 3
juggalo 1
hip pop 3
southern hip hop 3
trap music 2
jerk 1

In [12]:
#this is the other option I did it with soma's help
from collections import Counter

# genres is a long list of genres with a lot repeats
genre_counter = Counter(genres)
genre_counter

counts = Counter(all_genres)
counts.most_common(1)


Out[12]:
[('dirty south rap', 4)]

In [ ]:
genre_counter.most_common(3)

In [ ]:
#class review. Other option:

In [11]:
#aggregation problem

all_genres = []

for artist in Lil_info:
    #conditional
    print('All genres we have', all_genres)
    print("Current artist has", artist['genres'])
    all_genres = all_genres + artist['genres']
    
print('!!!!All the genres we have are:')
print(all_genres)

all_genres.count("hip pop")


All genres we have []
Current artist has ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music']
Current artist has ['crunk', 'dirty south rap', 'southern hip hop']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop']
Current artist has ['chicano rap', 'latin hip hop']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop']
Current artist has ['hip pop', 'pop rap']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap']
Current artist has ['crunk', 'dirty south rap', 'southern hip hop', 'trap music']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music']
Current artist has ['juggalo']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo']
Current artist has ['hip pop']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop']
Current artist has ['hip pop']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop']
Current artist has ['chicano rap']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap']
Current artist has ['jerk']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk']
Current artist has ['deep trap']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap']
Current artist has ['chicano rap']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap']
Current artist has ['freestyle']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle']
Current artist has ['soca']
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle', 'soca']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle', 'soca']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle', 'soca']
Current artist has []
All genres we have ['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle', 'soca']
Current artist has ['crunk', 'dirty south rap']
!!!!All the genres we have are:
['dirty south rap', 'pop rap', 'southern hip hop', 'trap music', 'crunk', 'dirty south rap', 'southern hip hop', 'chicano rap', 'latin hip hop', 'hip pop', 'pop rap', 'crunk', 'dirty south rap', 'southern hip hop', 'trap music', 'juggalo', 'hip pop', 'hip pop', 'chicano rap', 'jerk', 'deep trap', 'chicano rap', 'freestyle', 'soca', 'crunk', 'dirty south rap']
Out[11]:
3

In [14]:
unique_genre = set(all_genres)
for genre in unique_genres:
    genre_count = all_genres.count(genre)
    print(genre, "shows up", genre_count, "times")
#we have to convert it into a set


pop rap shows up 2 times
latin hip hop shows up 1 times
crunk shows up 3 times
dirty south rap shows up 4 times
soca shows up 1 times
deep trap shows up 1 times
freestyle shows up 1 times
chicano rap shows up 3 times
juggalo shows up 1 times
hip pop shows up 3 times
southern hip hop shows up 3 times
trap music shows up 2 times
jerk shows up 1 times

3 Use a for loop to determine who BESIDES Lil Wayne has the highest popularity rating. Is it the same artist who has the largest number of followers?


In [15]:
most_popular = 0
artist_name = Lil
for artist_popularity in Lil_info:
    if artist_popularity['popularity'] == 86:
        most_popular = most_popular
        artist_name = artist_name
    elif artist_popularity['popularity'] > most_popular:
        most_popular = artist_popularity['popularity']
        artist_name = artist_popularity['name']
        
print("Our second most popular artist is", artist_name , "with a popularity score of", most_popular)


Our second most popular artist is Lil Uzi Vert with a popularity score of 74

In [16]:
most_followers = 0
artist_name = Lil
for artist_followers in Lil_info:
    if artist_followers['followers']['total'] > 0:
        most_followers = artist_followers['followers']['total']
        artist_name = artist_followers['name']
    else:
        most_followers = most_followers
        artist_name = artist_name
    
print("Our artist with the most followers is not the most popular, it is", artist_name , "with ", most_followers, "followers")


Our artist with the most followers is not the most popular, it is Lil' Flip with  20100 followers

In [17]:
#class review. Soma used ---> artist['name'] != 'Lil Wayne':

In [18]:
second_most_popular_name = ""
second_most_popular_score = 0
for artist in Lil_info:
    #this is the conditional
    if artist['popularity'] > second_most_popular_score and artist['name'] != 'Lil Wayne':
    #these are the changes
        second_most_popular_name = artist['name']
        second_most_popular_score = artist['popularity']
print(second_most_popular_name,second_most_popular_score)


Lil Uzi Vert 74

In [19]:
#class review. he answered the question of what to do if two people have the same popularity scores

In [20]:
target_score = 72
#initial condition

second_best_artist = []
for artist in Lil_info:
    print("Looking at", artist['name'], "who has a popularity of", artist['popularity'])
    #conditional 
    if artist['popularity'] == 72:
        #change, add new artist to the list where Lil Yatchy is already in. We do that with .append(new thing)
        print("!!!!!!!the artist popularity is 72")
        second_best_artist.append(artist['name'])

print("Our second best artists are:")
for artist in second_best_artist:
    print(artist)


Looking at Lil Wayne who has a popularity of 86
Looking at Lil Yachty who has a popularity of 73
Looking at Lil Uzi Vert who has a popularity of 74
Looking at Lil Dicky who has a popularity of 69
Looking at Boosie Badazz who has a popularity of 67
Looking at Lil Jon who has a popularity of 72
!!!!!!!the artist popularity is 72
Looking at King Lil G who has a popularity of 61
Looking at Lil Durk who has a popularity of 60
Looking at Lil Jon & The East Side Boyz who has a popularity of 60
Looking at Lil Bibby who has a popularity of 54
Looking at G Herbo who has a popularity of 53
Looking at Lil Rob who has a popularity of 50
Looking at Lil Reese who has a popularity of 50
Looking at Bow Wow who has a popularity of 57
Looking at Lil Keke who has a popularity of 48
Looking at Lil Scrappy who has a popularity of 50
Looking at Lil Wyte who has a popularity of 50
Looking at Lil Blood who has a popularity of 46
Looking at Lil Snupe who has a popularity of 45
Looking at Lil Mama who has a popularity of 45
Looking at Lil Boom who has a popularity of 46
Looking at Lil B who has a popularity of 44
Looking at Lil' Kim who has a popularity of 62
Looking at Lil Cuete who has a popularity of 40
Looking at Lil Phat who has a popularity of 40
Looking at Lil Debbie who has a popularity of 43
Looking at Lil Twist who has a popularity of 40
Looking at Lil Trill who has a popularity of 37
Looking at Lil Goofy who has a popularity of 36
Looking at Lil Lonnie who has a popularity of 37
Looking at Lil AJ who has a popularity of 37
Looking at Lil Haiti who has a popularity of 37
Looking at Lil Cray who has a popularity of 36
Looking at Lil Twon who has a popularity of 36
Looking at Mr. Lil One who has a popularity of 36
Looking at Lil Silva who has a popularity of 43
Looking at Lil Flash who has a popularity of 38
Looking at Lil Yase who has a popularity of 34
Looking at Lil Mouse who has a popularity of 35
Looking at Lil Suzy who has a popularity of 34
Looking at Lil Eddie who has a popularity of 41
Looking at Lil Rue who has a popularity of 34
Looking at Lil Kesh who has a popularity of 39
Looking at Lil Wayne, DJ Drama who has a popularity of 35
Looking at Lil C who has a popularity of 33
Looking at Lil Rick who has a popularity of 39
Looking at Lil E who has a popularity of 34
Looking at Lil June who has a popularity of 32
Looking at Lil Fate who has a popularity of 34
Looking at Lil' Flip who has a popularity of 50
Our second best artists are:
Lil Jon

4) Print a list of Lil's that are more popular than Lil' Kim.


In [21]:
for artist in Lil_info:
    #print("Looking at", artist['name'])
    if artist['name'] == "Lil' Kim":
        print("Found Lil' Kim")
        print(artist['popularity'])
    else:
        pass #to keep it from breaking
        #print("NOT Lil' Kim)


Found Lil' Kim
62

In [22]:
#aggregation problem
more_popular_lil_kim = []

#the loop

for artist in Lil_info:
    #the conditional if artist is more popular than lil kim
    if artist['popularity'] > 62:
        print(artist['name'],"is more popular than Lil' Kim with a score of", artist['popularity'])
        more_popular_lil_kim.append(artist['name'])
print(more_popular_lil_kim)


Lil Wayne is more popular than Lil' Kim with a score of 86
Lil Yachty is more popular than Lil' Kim with a score of 73
Lil Uzi Vert is more popular than Lil' Kim with a score of 74
Lil Dicky is more popular than Lil' Kim with a score of 69
Boosie Badazz is more popular than Lil' Kim with a score of 67
Lil Jon is more popular than Lil' Kim with a score of 72
['Lil Wayne', 'Lil Yachty', 'Lil Uzi Vert', 'Lil Dicky', 'Boosie Badazz', 'Lil Jon']

In [23]:
for artist_name in more_popular_lil_kim:
    print(artist_name)

more_popular_string = ", ".join(more_popular_lil_kim)
print("artists more popular than lil kim are:", more_popular_string)


Lil Wayne
Lil Yachty
Lil Uzi Vert
Lil Dicky
Boosie Badazz
Lil Jon
artists more popular than lil kim are: Lil Wayne, Lil Yachty, Lil Uzi Vert, Lil Dicky, Boosie Badazz, Lil Jon

5) Pick two of your favorite Lils to fight it out, and use their IDs to print out their top tracks.

Tip: You're going to be making two separate requests, be sure you DO NOT save them into the same variable.


In [24]:
for two_lil in Lil_info:
    print(two_lil['name'], "ID:", two_lil['id'])


Lil Wayne ID: 55Aa2cqylxrFIXC767Z865
Lil Yachty ID: 6icQOAFXDZKsumw3YXyusw
Lil Uzi Vert ID: 4O15NlyKLIASxsJ0PrXPfz
Lil Dicky ID: 1tqhsYv8yBBdwANFNzHtcr
Boosie Badazz ID: 6z7xFFHxYkE9t8bwIF0Bvg
Lil Jon ID: 7sfl4Xt5KmfyDs2T3SVSMK
King Lil G ID: 6L3x3if9RVimruryD9LoFb
Lil Durk ID: 3hcs9uc56yIGFCSy9leWe7
Lil Jon & The East Side Boyz ID: 3ciRvbBIVz9fBoPbtSYq4x
Lil Bibby ID: 4uSN8Y3kgFNVULUWsZEAVW
G Herbo ID: 5QdEbQJ3ylBnc3gsIASAT5
Lil Rob ID: 7B7TGqQe7QTVm2U6q8jzk1
Lil Reese ID: 1bPxKZtCdjB1aj1csBJpdS
Bow Wow ID: 7352aRY2mqSxBZwzUb6LmA
Lil Keke ID: 1grI9x4Uzos1Asx8JmRW6T
Lil Scrappy ID: 5einkgXXrjhfYCyac1FANB
Lil Wyte ID: 21O7WwRkik43ErKppxDKJq
Lil Blood ID: 74nSA5FdDOuuLw7Rn5JnuP
Lil Snupe ID: 42FaEHFfyxTdZQ5W28dXnj
Lil Mama ID: 5qK5bOC6wLtuLhG5KvU17c
Lil Boom ID: 1mmlWsyPJvvxMdabcGJjRn
Lil B ID: 4dqh62yIzDBmrMeBOLiP5F
Lil' Kim ID: 5tth2a3v0sWwV1C7bApBdX
Lil Cuete ID: 1I5u5Umau1AgHl0ZbPL1oR
Lil Phat ID: 3QnIBUOS4mUzs67rZ8r4c9
Lil Debbie ID: 3FNZcjyqT7F5upP99JV0oN
Lil Twist ID: 564gvOqSRcQoYAhaBpTiK2
Lil Trill ID: 5EQERGi7ffHvHsv3bnqzBn
Lil Goofy ID: 3rWaFjgOi5mjQfllMfN3VI
Lil Lonnie ID: 6zSBkdKFLKKggDtE3amfCk
Lil AJ ID: 2jXwYLNnCxNavms4mc1DYM
Lil Haiti ID: 4E9dumwOMLlTyXUp1i2WdI
Lil Cray ID: 43BqexhEx5NKF7VfeOYP9m
Lil Twon ID: 5YZZbPdI7P7te3lW3dTpzK
Mr. Lil One ID: 6tslWi0BXiDdtChermDzkU
Lil Silva ID: 2Kv0ApBohrL213X9avMrEn
Lil Flash ID: 069qBEK34YGoX7nSIT74Eg
Lil Yase ID: 4vIlHBnzWKbmWe8ZOkT1ZT
Lil Mouse ID: 1cEHxCgGlEgqBc91YOcAEQ
Lil Suzy ID: 5HPsVk1MblCoa44WLJsQwN
Lil Eddie ID: 5CY0QKsbUBpQJIE2yycsYi
Lil Rue ID: 4IFVaKBbEO8Qkurg6nmoc4
Lil Kesh ID: 38XiDu0kK3Z5jdHUDqBzNT
Lil Wayne, DJ Drama ID: 65npPa1U4cgobX9wU7Jgpb
Lil C ID: 69swdLSkKxCQBMYJ55O2mA
Lil Rick ID: 1qKzKUnuQsjB83hBZffoq0
Lil E ID: 0zn6yzsbWj3EPMgOTqfG5k
Lil June ID: 3GH3KD2078kLPpEkN1UN26
Lil Fate ID: 6JUnsP7jmvYmdhbg7lTMQj
Lil' Flip ID: 4Q5sPmM8j4SpMqL4UA1DtS

In [25]:
import requests
response = requests.get('https://api.spotify.com/v1/artists/6JUnsP7jmvYmdhbg7lTMQj/top-tracks?country=US')
lil_fate = response.json()

print(lil_fate)


{'tracks': [{'id': '60FUCHW3nR5IIftByVjBmB', 'available_markets': ['CA', 'MX', 'US'], 'type': 'track', 'popularity': 20, 'disc_number': 1, 'uri': 'spotify:track:60FUCHW3nR5IIftByVjBmB', 'href': 'https://api.spotify.com/v1/tracks/60FUCHW3nR5IIftByVjBmB', 'artists': [{'id': '6JUnsP7jmvYmdhbg7lTMQj', 'href': 'https://api.spotify.com/v1/artists/6JUnsP7jmvYmdhbg7lTMQj', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6JUnsP7jmvYmdhbg7lTMQj'}, 'uri': 'spotify:artist:6JUnsP7jmvYmdhbg7lTMQj', 'type': 'artist', 'name': 'Lil Fate'}, {'id': '6mXlDbi03T8wXYwWYew0Ut', 'href': 'https://api.spotify.com/v1/artists/6mXlDbi03T8wXYwWYew0Ut', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6mXlDbi03T8wXYwWYew0Ut'}, 'uri': 'spotify:artist:6mXlDbi03T8wXYwWYew0Ut', 'type': 'artist', 'name': 'Rich Boy'}, {'id': '3ppZNqihWOzuH4A0f4KmeP', 'href': 'https://api.spotify.com/v1/artists/3ppZNqihWOzuH4A0f4KmeP', 'external_urls': {'spotify': 'https://open.spotify.com/artist/3ppZNqihWOzuH4A0f4KmeP'}, 'uri': 'spotify:artist:3ppZNqihWOzuH4A0f4KmeP', 'type': 'artist', 'name': 'Gangsta Boo'}], 'album': {'album_type': 'album', 'id': '57AbXDTvGGw2GDC6rrsH2m', 'images': [{'url': 'https://i.scdn.co/image/624e4bd7bd0a5714d0bc44b30bf5667868365a9d', 'height': 635, 'width': 640}, {'url': 'https://i.scdn.co/image/f12f98e24945d6c47932878ce6eea91a7bd61f46', 'height': 297, 'width': 300}, {'url': 'https://i.scdn.co/image/21f753dee667340d202ee2a84be455f31b1c7ec6', 'height': 63, 'width': 64}], 'available_markets': ['CA', 'MX', 'US'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/57AbXDTvGGw2GDC6rrsH2m'}, 'uri': 'spotify:album:57AbXDTvGGw2GDC6rrsH2m', 'href': 'https://api.spotify.com/v1/albums/57AbXDTvGGw2GDC6rrsH2m', 'name': 'Ludacris Presents...Disturbing Tha Peace (Explicit Version)'}, 'duration_ms': 218026, 'external_ids': {'isrc': 'USUM70506893'}, 'track_number': 7, 'external_urls': {'spotify': 'https://open.spotify.com/track/60FUCHW3nR5IIftByVjBmB'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/19381ff72ed3a509ed19c72138d2471ce7d377d2', 'name': 'Break A N**a Off'}]}

In [26]:
print(type(lil_fate))


<class 'dict'>

In [27]:
print(lil_fate.keys())


dict_keys(['tracks'])

In [28]:
print(type(lil_fate['tracks']))


<class 'list'>

In [29]:
lil_fate_top_tracks = lil_fate['tracks']

In [30]:
print(lil_fate_top_tracks)


[{'id': '60FUCHW3nR5IIftByVjBmB', 'available_markets': ['CA', 'MX', 'US'], 'type': 'track', 'popularity': 20, 'disc_number': 1, 'uri': 'spotify:track:60FUCHW3nR5IIftByVjBmB', 'href': 'https://api.spotify.com/v1/tracks/60FUCHW3nR5IIftByVjBmB', 'artists': [{'id': '6JUnsP7jmvYmdhbg7lTMQj', 'href': 'https://api.spotify.com/v1/artists/6JUnsP7jmvYmdhbg7lTMQj', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6JUnsP7jmvYmdhbg7lTMQj'}, 'uri': 'spotify:artist:6JUnsP7jmvYmdhbg7lTMQj', 'type': 'artist', 'name': 'Lil Fate'}, {'id': '6mXlDbi03T8wXYwWYew0Ut', 'href': 'https://api.spotify.com/v1/artists/6mXlDbi03T8wXYwWYew0Ut', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6mXlDbi03T8wXYwWYew0Ut'}, 'uri': 'spotify:artist:6mXlDbi03T8wXYwWYew0Ut', 'type': 'artist', 'name': 'Rich Boy'}, {'id': '3ppZNqihWOzuH4A0f4KmeP', 'href': 'https://api.spotify.com/v1/artists/3ppZNqihWOzuH4A0f4KmeP', 'external_urls': {'spotify': 'https://open.spotify.com/artist/3ppZNqihWOzuH4A0f4KmeP'}, 'uri': 'spotify:artist:3ppZNqihWOzuH4A0f4KmeP', 'type': 'artist', 'name': 'Gangsta Boo'}], 'album': {'album_type': 'album', 'id': '57AbXDTvGGw2GDC6rrsH2m', 'images': [{'url': 'https://i.scdn.co/image/624e4bd7bd0a5714d0bc44b30bf5667868365a9d', 'height': 635, 'width': 640}, {'url': 'https://i.scdn.co/image/f12f98e24945d6c47932878ce6eea91a7bd61f46', 'height': 297, 'width': 300}, {'url': 'https://i.scdn.co/image/21f753dee667340d202ee2a84be455f31b1c7ec6', 'height': 63, 'width': 64}], 'available_markets': ['CA', 'MX', 'US'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/57AbXDTvGGw2GDC6rrsH2m'}, 'uri': 'spotify:album:57AbXDTvGGw2GDC6rrsH2m', 'href': 'https://api.spotify.com/v1/albums/57AbXDTvGGw2GDC6rrsH2m', 'name': 'Ludacris Presents...Disturbing Tha Peace (Explicit Version)'}, 'duration_ms': 218026, 'external_ids': {'isrc': 'USUM70506893'}, 'track_number': 7, 'external_urls': {'spotify': 'https://open.spotify.com/track/60FUCHW3nR5IIftByVjBmB'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/19381ff72ed3a509ed19c72138d2471ce7d377d2', 'name': 'Break A N**a Off'}]

In [31]:
for top_tracks in lil_fate_top_tracks:
    print("Lil Fate top track is/are", top_tracks['name'])


Lil Fate top track is/are Break A N**a Off

In [32]:
import requests
response = requests.get('https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb/top-tracks?country=US')
king_lil = response.json()

print(type(king_lil))


<class 'dict'>

In [33]:
print(king_lil.keys())


dict_keys(['tracks'])

In [34]:
king_lil_top_tracks = king_lil['tracks']
print(king_lil_top_tracks)


[{'id': '45f8NLNAthLQqji8lRVuOV', 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'track', 'popularity': 55, 'disc_number': 1, 'uri': 'spotify:track:45f8NLNAthLQqji8lRVuOV', 'href': 'https://api.spotify.com/v1/tracks/45f8NLNAthLQqji8lRVuOV', 'artists': [{'id': '6L3x3if9RVimruryD9LoFb', 'href': 'https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6L3x3if9RVimruryD9LoFb'}, 'uri': 'spotify:artist:6L3x3if9RVimruryD9LoFb', 'type': 'artist', 'name': 'King Lil G'}, {'id': '5ntrzTi4BYgO8N0Yuqn1ng', 'href': 'https://api.spotify.com/v1/artists/5ntrzTi4BYgO8N0Yuqn1ng', 'external_urls': {'spotify': 'https://open.spotify.com/artist/5ntrzTi4BYgO8N0Yuqn1ng'}, 'uri': 'spotify:artist:5ntrzTi4BYgO8N0Yuqn1ng', 'type': 'artist', 'name': 'David Ortiz'}], 'album': {'album_type': 'album', 'id': '3XHnTdk5nmiI9BXNXimEBG', 'images': [{'url': 'https://i.scdn.co/image/1c0637a5cfab1d2e605f0ec8ff33aa99bbebab38', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/59914e47f7eea38ebada6ae81909e1bcea4cdd57', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/0c68daeaeb4e84dbd25d6e4976aaa422e93d238c', 'height': 64, 'width': 64}], 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/3XHnTdk5nmiI9BXNXimEBG'}, 'uri': 'spotify:album:3XHnTdk5nmiI9BXNXimEBG', 'href': 'https://api.spotify.com/v1/albums/3XHnTdk5nmiI9BXNXimEBG', 'name': 'Ak47boyz'}, 'duration_ms': 193786, 'external_ids': {'isrc': 'USASN1401183'}, 'track_number': 1, 'external_urls': {'spotify': 'https://open.spotify.com/track/45f8NLNAthLQqji8lRVuOV'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/734cf86b202388c1db5f1ccd8855818ad79ad30d', 'name': 'Hopeless Boy (feat. David Ortiz)'}, {'id': '3iwt15Ynm0cYicIGQ9hAr0', 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'track', 'popularity': 54, 'disc_number': 1, 'uri': 'spotify:track:3iwt15Ynm0cYicIGQ9hAr0', 'href': 'https://api.spotify.com/v1/tracks/3iwt15Ynm0cYicIGQ9hAr0', 'artists': [{'id': '6L3x3if9RVimruryD9LoFb', 'href': 'https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6L3x3if9RVimruryD9LoFb'}, 'uri': 'spotify:artist:6L3x3if9RVimruryD9LoFb', 'type': 'artist', 'name': 'King Lil G'}], 'album': {'album_type': 'album', 'id': '14gzpwKOba6QQ1HsYifM0a', 'images': [{'url': 'https://i.scdn.co/image/a642fb3016b081274cc95c2e28029d3b25889ef0', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/c19dcb1b9f8817919022e3d95a428060758c8ec8', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/fc0e6255f96dc6e0cbd118e1e71d0851a275f272', 'height': 64, 'width': 64}], 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/14gzpwKOba6QQ1HsYifM0a'}, 'uri': 'spotify:album:14gzpwKOba6QQ1HsYifM0a', 'href': 'https://api.spotify.com/v1/albums/14gzpwKOba6QQ1HsYifM0a', 'name': "90's Kid"}, 'duration_ms': 166626, 'external_ids': {'isrc': 'USASN1500302'}, 'track_number': 2, 'external_urls': {'spotify': 'https://open.spotify.com/track/3iwt15Ynm0cYicIGQ9hAr0'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/b7962ea6c5d25c1ffdbe2c784761116df6e9c8d6', 'name': 'Ignorance'}, {'id': '5oTzlrZ8WTDIHeTsz4Jw3z', 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'track', 'popularity': 54, 'disc_number': 1, 'uri': 'spotify:track:5oTzlrZ8WTDIHeTsz4Jw3z', 'href': 'https://api.spotify.com/v1/tracks/5oTzlrZ8WTDIHeTsz4Jw3z', 'artists': [{'id': '6L3x3if9RVimruryD9LoFb', 'href': 'https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6L3x3if9RVimruryD9LoFb'}, 'uri': 'spotify:artist:6L3x3if9RVimruryD9LoFb', 'type': 'artist', 'name': 'King Lil G'}], 'album': {'album_type': 'album', 'id': '3XHnTdk5nmiI9BXNXimEBG', 'images': [{'url': 'https://i.scdn.co/image/1c0637a5cfab1d2e605f0ec8ff33aa99bbebab38', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/59914e47f7eea38ebada6ae81909e1bcea4cdd57', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/0c68daeaeb4e84dbd25d6e4976aaa422e93d238c', 'height': 64, 'width': 64}], 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/3XHnTdk5nmiI9BXNXimEBG'}, 'uri': 'spotify:album:3XHnTdk5nmiI9BXNXimEBG', 'href': 'https://api.spotify.com/v1/albums/3XHnTdk5nmiI9BXNXimEBG', 'name': 'Ak47boyz'}, 'duration_ms': 227986, 'external_ids': {'isrc': 'USASN1401184'}, 'track_number': 2, 'external_urls': {'spotify': 'https://open.spotify.com/track/5oTzlrZ8WTDIHeTsz4Jw3z'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/1c0e026feb2d58555f99d8204fdee48b4d19a2b3', 'name': 'Ak47'}, {'id': '2av09FAN9J7IgxCQ6od4SF', 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'track', 'popularity': 53, 'disc_number': 1, 'uri': 'spotify:track:2av09FAN9J7IgxCQ6od4SF', 'href': 'https://api.spotify.com/v1/tracks/2av09FAN9J7IgxCQ6od4SF', 'artists': [{'id': '6L3x3if9RVimruryD9LoFb', 'href': 'https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6L3x3if9RVimruryD9LoFb'}, 'uri': 'spotify:artist:6L3x3if9RVimruryD9LoFb', 'type': 'artist', 'name': 'King Lil G'}, {'id': '4tXAYCJxzb9PlyZGVQeVXn', 'href': 'https://api.spotify.com/v1/artists/4tXAYCJxzb9PlyZGVQeVXn', 'external_urls': {'spotify': 'https://open.spotify.com/artist/4tXAYCJxzb9PlyZGVQeVXn'}, 'uri': 'spotify:artist:4tXAYCJxzb9PlyZGVQeVXn', 'type': 'artist', 'name': 'Chikk'}], 'album': {'album_type': 'album', 'id': '14gzpwKOba6QQ1HsYifM0a', 'images': [{'url': 'https://i.scdn.co/image/a642fb3016b081274cc95c2e28029d3b25889ef0', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/c19dcb1b9f8817919022e3d95a428060758c8ec8', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/fc0e6255f96dc6e0cbd118e1e71d0851a275f272', 'height': 64, 'width': 64}], 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/14gzpwKOba6QQ1HsYifM0a'}, 'uri': 'spotify:album:14gzpwKOba6QQ1HsYifM0a', 'href': 'https://api.spotify.com/v1/albums/14gzpwKOba6QQ1HsYifM0a', 'name': "90's Kid"}, 'duration_ms': 187586, 'external_ids': {'isrc': 'USASN1500303'}, 'track_number': 3, 'external_urls': {'spotify': 'https://open.spotify.com/track/2av09FAN9J7IgxCQ6od4SF'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/ad5f4b940fa7c4dab93f5d0328a6341e3d208cbf', 'name': 'Grow Up (feat. Chikk)'}, {'id': '0a5sHdXW7XokUN5Gqgr1vb', 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'track', 'popularity': 52, 'disc_number': 1, 'uri': 'spotify:track:0a5sHdXW7XokUN5Gqgr1vb', 'href': 'https://api.spotify.com/v1/tracks/0a5sHdXW7XokUN5Gqgr1vb', 'artists': [{'id': '6L3x3if9RVimruryD9LoFb', 'href': 'https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6L3x3if9RVimruryD9LoFb'}, 'uri': 'spotify:artist:6L3x3if9RVimruryD9LoFb', 'type': 'artist', 'name': 'King Lil G'}], 'album': {'album_type': 'album', 'id': '4rXtpZpRBrfCWERJEzoCRb', 'images': [{'url': 'https://i.scdn.co/image/e0e8425e45e0f33b804becc5001b46b05fe98dd8', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/d2101a2b13dbcace85fdb14e8da5266f43c1feb4', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/99b1e90cff3937cd402e860b3f1d31957238a6f4', 'height': 64, 'width': 64}], 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/4rXtpZpRBrfCWERJEzoCRb'}, 'uri': 'spotify:album:4rXtpZpRBrfCWERJEzoCRb', 'href': 'https://api.spotify.com/v1/albums/4rXtpZpRBrfCWERJEzoCRb', 'name': 'Lost In Smoke 2'}, 'duration_ms': 242372, 'external_ids': {'isrc': 'USE7D1600019'}, 'track_number': 1, 'external_urls': {'spotify': 'https://open.spotify.com/track/0a5sHdXW7XokUN5Gqgr1vb'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/5135e2a4962905841a0d9b67dbb8654ea9662eec', 'name': 'Cold Christmas'}, {'id': '5542ZgcaVlugxNYM4E7wRf', 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'track', 'popularity': 50, 'disc_number': 1, 'uri': 'spotify:track:5542ZgcaVlugxNYM4E7wRf', 'href': 'https://api.spotify.com/v1/tracks/5542ZgcaVlugxNYM4E7wRf', 'artists': [{'id': '6L3x3if9RVimruryD9LoFb', 'href': 'https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6L3x3if9RVimruryD9LoFb'}, 'uri': 'spotify:artist:6L3x3if9RVimruryD9LoFb', 'type': 'artist', 'name': 'King Lil G'}], 'album': {'album_type': 'album', 'id': '0G17liCRw1GYfissTAdWlf', 'images': [{'url': 'https://i.scdn.co/image/6e810782c6c7a05cc50a4e121affe1bedb39be43', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/508311289eb6b336f0c3bade308b7e37a7e83345', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/ef0f9fa1fe3a2d528e35301e62c342ad434a796b', 'height': 64, 'width': 64}], 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/0G17liCRw1GYfissTAdWlf'}, 'uri': 'spotify:album:0G17liCRw1GYfissTAdWlf', 'href': 'https://api.spotify.com/v1/albums/0G17liCRw1GYfissTAdWlf', 'name': 'Lost in Smoke'}, 'duration_ms': 216440, 'external_ids': {'isrc': 'USASN1302113'}, 'track_number': 8, 'external_urls': {'spotify': 'https://open.spotify.com/track/5542ZgcaVlugxNYM4E7wRf'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/185b3eb4fe99711aa541776bf231e75fcfd0efa0', 'name': 'Welcome to La'}, {'id': '2YcgCfn4v62JvPvyTqxMxH', 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'track', 'popularity': 50, 'disc_number': 1, 'uri': 'spotify:track:2YcgCfn4v62JvPvyTqxMxH', 'href': 'https://api.spotify.com/v1/tracks/2YcgCfn4v62JvPvyTqxMxH', 'artists': [{'id': '6L3x3if9RVimruryD9LoFb', 'href': 'https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6L3x3if9RVimruryD9LoFb'}, 'uri': 'spotify:artist:6L3x3if9RVimruryD9LoFb', 'type': 'artist', 'name': 'King Lil G'}], 'album': {'album_type': 'album', 'id': '4rXtpZpRBrfCWERJEzoCRb', 'images': [{'url': 'https://i.scdn.co/image/e0e8425e45e0f33b804becc5001b46b05fe98dd8', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/d2101a2b13dbcace85fdb14e8da5266f43c1feb4', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/99b1e90cff3937cd402e860b3f1d31957238a6f4', 'height': 64, 'width': 64}], 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/4rXtpZpRBrfCWERJEzoCRb'}, 'uri': 'spotify:album:4rXtpZpRBrfCWERJEzoCRb', 'href': 'https://api.spotify.com/v1/albums/4rXtpZpRBrfCWERJEzoCRb', 'name': 'Lost In Smoke 2'}, 'duration_ms': 192520, 'external_ids': {'isrc': 'USE7D1600040'}, 'track_number': 15, 'external_urls': {'spotify': 'https://open.spotify.com/track/2YcgCfn4v62JvPvyTqxMxH'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/e9ed2eb7bcf06b93b61550a204c18e42a1dbd097', 'name': 'After My Death'}, {'id': '5cWvvagtENe3lGXS2VK0po', 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'track', 'popularity': 50, 'disc_number': 1, 'uri': 'spotify:track:5cWvvagtENe3lGXS2VK0po', 'href': 'https://api.spotify.com/v1/tracks/5cWvvagtENe3lGXS2VK0po', 'artists': [{'id': '6L3x3if9RVimruryD9LoFb', 'href': 'https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6L3x3if9RVimruryD9LoFb'}, 'uri': 'spotify:artist:6L3x3if9RVimruryD9LoFb', 'type': 'artist', 'name': 'King Lil G'}, {'id': '4vE0ADCdH854d1kss98REy', 'href': 'https://api.spotify.com/v1/artists/4vE0ADCdH854d1kss98REy', 'external_urls': {'spotify': 'https://open.spotify.com/artist/4vE0ADCdH854d1kss98REy'}, 'uri': 'spotify:artist:4vE0ADCdH854d1kss98REy', 'type': 'artist', 'name': 'Drummer Boy'}], 'album': {'album_type': 'album', 'id': '3XHnTdk5nmiI9BXNXimEBG', 'images': [{'url': 'https://i.scdn.co/image/1c0637a5cfab1d2e605f0ec8ff33aa99bbebab38', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/59914e47f7eea38ebada6ae81909e1bcea4cdd57', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/0c68daeaeb4e84dbd25d6e4976aaa422e93d238c', 'height': 64, 'width': 64}], 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/3XHnTdk5nmiI9BXNXimEBG'}, 'uri': 'spotify:album:3XHnTdk5nmiI9BXNXimEBG', 'href': 'https://api.spotify.com/v1/albums/3XHnTdk5nmiI9BXNXimEBG', 'name': 'Ak47boyz'}, 'duration_ms': 210000, 'external_ids': {'isrc': 'USASN1401186'}, 'track_number': 4, 'external_urls': {'spotify': 'https://open.spotify.com/track/5cWvvagtENe3lGXS2VK0po'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/446eb19f1e1f12ad768a6818b5a86ed35ba322c9', 'name': 'Windows Down (feat. Drummer Boy)'}, {'id': '4j3LMem6RqLz79Pmb5wPLG', 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'track', 'popularity': 49, 'disc_number': 1, 'uri': 'spotify:track:4j3LMem6RqLz79Pmb5wPLG', 'href': 'https://api.spotify.com/v1/tracks/4j3LMem6RqLz79Pmb5wPLG', 'artists': [{'id': '6L3x3if9RVimruryD9LoFb', 'href': 'https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6L3x3if9RVimruryD9LoFb'}, 'uri': 'spotify:artist:6L3x3if9RVimruryD9LoFb', 'type': 'artist', 'name': 'King Lil G'}], 'album': {'album_type': 'album', 'id': '4rXtpZpRBrfCWERJEzoCRb', 'images': [{'url': 'https://i.scdn.co/image/e0e8425e45e0f33b804becc5001b46b05fe98dd8', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/d2101a2b13dbcace85fdb14e8da5266f43c1feb4', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/99b1e90cff3937cd402e860b3f1d31957238a6f4', 'height': 64, 'width': 64}], 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/4rXtpZpRBrfCWERJEzoCRb'}, 'uri': 'spotify:album:4rXtpZpRBrfCWERJEzoCRb', 'href': 'https://api.spotify.com/v1/albums/4rXtpZpRBrfCWERJEzoCRb', 'name': 'Lost In Smoke 2'}, 'duration_ms': 186425, 'external_ids': {'isrc': 'USE7D1600038'}, 'track_number': 2, 'external_urls': {'spotify': 'https://open.spotify.com/track/4j3LMem6RqLz79Pmb5wPLG'}, 'explicit': True, 'preview_url': 'https://p.scdn.co/mp3-preview/490f1a66d92e062615f3914538b9b3882d0b855f', 'name': 'Room Full Of Smoke'}, {'id': '1RXcXkfHRM0mr67t9sNsuT', 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'track', 'popularity': 49, 'disc_number': 1, 'uri': 'spotify:track:1RXcXkfHRM0mr67t9sNsuT', 'href': 'https://api.spotify.com/v1/tracks/1RXcXkfHRM0mr67t9sNsuT', 'artists': [{'id': '6L3x3if9RVimruryD9LoFb', 'href': 'https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb', 'external_urls': {'spotify': 'https://open.spotify.com/artist/6L3x3if9RVimruryD9LoFb'}, 'uri': 'spotify:artist:6L3x3if9RVimruryD9LoFb', 'type': 'artist', 'name': 'King Lil G'}], 'album': {'album_type': 'album', 'id': '0HaEvVsikL92OCCWKWn8Pj', 'images': [{'url': 'https://i.scdn.co/image/c309a6ebe37cf1fe226f829d7ecc5cf52ef76b1d', 'height': 640, 'width': 640}, {'url': 'https://i.scdn.co/image/3fcc6688db539ddbb4d36fab4219746059e663e4', 'height': 300, 'width': 300}, {'url': 'https://i.scdn.co/image/74b2759ff7e479d999cbd36fdbeca101333df5f7', 'height': 64, 'width': 64}], 'available_markets': ['AR', 'AU', 'AT', 'BE', 'BO', 'BR', 'BG', 'CA', 'CL', 'CO', 'CR', 'CY', 'CZ', 'DK', 'DO', 'DE', 'EC', 'EE', 'SV', 'FI', 'FR', 'GR', 'GT', 'HN', 'HK', 'HU', 'IS', 'IE', 'IT', 'LV', 'LT', 'LU', 'MY', 'MT', 'MX', 'NL', 'NZ', 'NI', 'NO', 'PA', 'PY', 'PE', 'PH', 'PL', 'PT', 'SG', 'SK', 'ES', 'SE', 'CH', 'TW', 'TR', 'UY', 'US', 'GB', 'AD', 'LI', 'MC', 'ID'], 'type': 'album', 'external_urls': {'spotify': 'https://open.spotify.com/album/0HaEvVsikL92OCCWKWn8Pj'}, 'uri': 'spotify:album:0HaEvVsikL92OCCWKWn8Pj', 'href': 'https://api.spotify.com/v1/albums/0HaEvVsikL92OCCWKWn8Pj', 'name': 'King Enemy'}, 'duration_ms': 248013, 'external_ids': {'isrc': 'USASN1201240'}, 'track_number': 3, 'external_urls': {'spotify': 'https://open.spotify.com/track/1RXcXkfHRM0mr67t9sNsuT'}, 'explicit': False, 'preview_url': 'https://p.scdn.co/mp3-preview/d00b0d0523b89db2f00e5a687a856fbf3d01fd6f', 'name': 'Narco Corridos'}]

In [35]:
print("King Lil top track is/are:")
for top_tracks in king_lil_top_tracks:
    print(top_tracks['name'])


King Lil top track is/are:
Hopeless Boy (feat. David Ortiz)
Ignorance
Ak47
Grow Up (feat. Chikk)
Cold Christmas
Welcome to La
After My Death
Windows Down (feat. Drummer Boy)
Room Full Of Smoke
Narco Corridos

In [36]:
for top_tracks in lil_fate_top_tracks:
    print("Lil Fate top track is/are:")
    print("-",top_tracks['name'])
print("King Lil top track is/are:")
for top_tracks in king_lil_top_tracks:
    print("-",top_tracks['name'])


Lil Fate top track is/are:
- Break A N**a Off
King Lil top track is/are:
- Hopeless Boy (feat. David Ortiz)
- Ignorance
- Ak47
- Grow Up (feat. Chikk)
- Cold Christmas
- Welcome to La
- After My Death
- Windows Down (feat. Drummer Boy)
- Room Full Of Smoke
- Narco Corridos

6) Will the world explode if a musicians swears? Get an average popularity for their explicit songs vs. their non-explicit songs. How many minutes of explicit songs do they have? Non-explicit?


In [37]:
import requests
response = requests.get('https://api.spotify.com/v1/artists/6JUnsP7jmvYmdhbg7lTMQj/top-tracks?country=US')
lil_fate = response.json()

explicit_count = 0 
non_explicit_count = 0
popularity_explicit = 0
popularity_non_explicit= 0
minutes_explicit = 0
minutes_non_explicit = 0

for track in lil_fate_top_tracks:   
    
    if track['explicit'] == True:
        explicit_count = explicit_count + 1
        popularity_explicit = popularity_explicit + track['popularity']
        minutes_explicit = minutes_explicit + track['duration_ms']
        print("There is", explicit_count, "explicit track with a popularity of", popularity_explicit)
     
    elif track['explicit'] == False:
        non_explicit_count = non_explicit_count + 1
        popularity_non_explicit = popularity_non_explicit + track['popularity']
        minutes_non_explicit = minutes_non_explicit + track['duration_ms']
        print("There is", non_explicit_count ,"non-explicit track with a popularity of", popularity_non_explicit)

print("The average popularity of Lil Fate explicits songs is", popularity_explicit/explicit_count)   
#Code below--> dividing it by zero because there are no non-explicit counts so it does not work
#print("The average popularity of Lil Fate non-explicits songs is", popularity_non_explicit/non_explicit_count)
print("Lil fate has", (minutes_explicit / 1000) /60 , "minutes of explicit music") #sounds weird. Not sure why I get this result
print("Lil fate has", (minutes_non_explicit / 1000) / 60, "minutes of non-explicit music")#sounds weird. Not sure why I get this result


There is 1 explicit track with a popularity of 20
The average popularity of Lil Fate explicits songs is 20.0
Lil fate has 3.633766666666667 minutes of explicit music
Lil fate has 0.0 minutes of non-explicit music

In [38]:
import requests
response = requests.get('https://api.spotify.com/v1/artists/6L3x3if9RVimruryD9LoFb/top-tracks?country=US')
king_lil = response.json()

explicit_count = 0 
non_explicit_count = 0
popularity_explicit = 0
popularity_non_explicit= 0
minutes_explicit = 0
minutes_non_explicit = 0

for track in king_lil_top_tracks:    
    if track['explicit'] == True:
        explicit_count = explicit_count + 1
        popularity_explicit = popularity_explicit + track['popularity']
        minutes_explicit = minutes_explicit + track['duration_ms']
        print("There is", explicit_count, "explicit track with a popularity of", popularity_explicit)
    

    elif track['explicit'] == False:
        non_explicit_count = non_explicit_count + 1
        popularity_non_explicit = popularity_non_explicit + track['popularity']
        minutes_non_explicit = minutes_non_explicit + track['duration_ms']
        print("There is", non_explicit_count ,"non-explicit track with a popularity of", popularity_non_explicit)


print("The average popularity of King lil explicits songs is", popularity_explicit/explicit_count)
print("The average popularity of King lil non-explicits songs is", popularity_non_explicit/non_explicit_count)
print("Lil King has", (minutes_explicit / 1000) / 60, "minutes of explicit music") #this number does not make sense but not sure what is wrong
print("Lil King has", (minutes_non_explicit /1000) / 60, "minutes of non-explicit music")#sounds weird. Not sure why I get this result


There is 1 explicit track with a popularity of 55
There is 2 explicit track with a popularity of 109
There is 3 explicit track with a popularity of 163
There is 4 explicit track with a popularity of 216
There is 5 explicit track with a popularity of 268
There is 6 explicit track with a popularity of 318
There is 7 explicit track with a popularity of 368
There is 8 explicit track with a popularity of 418
There is 9 explicit track with a popularity of 467
There is 1 non-explicit track with a popularity of 49
The average popularity of King lil explicits songs is 51.888888888888886
The average popularity of King lil non-explicits songs is 49.0
Lil King has 30.395683333333334 minutes of explicit music
Lil King has 4.1335500000000005 minutes of non-explicit music

7) Since we're talking about Lils, what about Biggies? How many total "Biggie" artists are there? How many total "Lil"s?


In [39]:
response = requests.get('https://api.spotify.com/v1/search?q=Lil&type=artist&market=US')
all_lil = response.json()
print(all_lil.keys())


dict_keys(['artists'])

In [40]:
print(all_lil['artists'].keys())


dict_keys(['total', 'previous', 'items', 'next', 'limit', 'href', 'offset'])

In [41]:
print(all_lil['artists']['total'])


4523

In [42]:
response = requests.get('https://api.spotify.com/v1/search?q=Biggie&type=artist&market=US')
all_biggies = response.json()
print(all_biggies['artists']['total'])


50

7.2) If you made 1 request every 5 seconds, how long would it take to download information on all the Lils vs the Biggies?


In [43]:
response = requests.get('https://api.spotify.com/v1/search?q=Lil&type=artist&market=US')
all_lil = response.json()
total_lils= all_lil['artists']['total']
#print(total_lils)
print("It would take",(total_lils/20) * 5, "to download all the Lils")


It would take 1130.75 to download all the Lils

In [44]:
response = requests.get('https://api.spotify.com/v1/search?q=Biggie&type=artist&market=US')
all_biggies = response.json()
total_biggies= all_biggies['artists']['total']
#print(total_biggies)
print("It would take",(total_biggies/20) * 5, "to download all the Lils")


It would take 12.5 to download all the Lils

8) Out of the top 50 "Lil"s and the top 50 "Biggie"s, who is more popular on average?


In [45]:
response = requests.get('https://api.spotify.com/v1/search?q=Biggie&type=artist&market=US&limit=50')
biggies = response.json()
print(biggies['artists'].keys())


dict_keys(['total', 'previous', 'items', 'next', 'limit', 'href', 'offset'])

In [46]:
print(biggies['artists']['items'][0])


{'type': 'artist', 'id': '5me0Irg2ANcsgc93uaYrpb', 'images': [{'url': 'https://i.scdn.co/image/3d44c609f22910dcd82cfd3311ed1e41bd37ca8f', 'height': 1250, 'width': 1000}, {'url': 'https://i.scdn.co/image/65d46631b7853a2c396558ff4569bb22b486bba3', 'height': 800, 'width': 640}, {'url': 'https://i.scdn.co/image/c84fa657bfda54a366cc3284ac38f8e0e7bbcc2b', 'height': 250, 'width': 200}, {'url': 'https://i.scdn.co/image/826db6d87e55e431df5cdf937a54fd224a65ff8f', 'height': 80, 'width': 64}], 'popularity': 76, 'external_urls': {'spotify': 'https://open.spotify.com/artist/5me0Irg2ANcsgc93uaYrpb'}, 'followers': {'total': 980288, 'href': None}, 'genres': ['gangster rap', 'hardcore hip hop', 'hip hop', 'rap'], 'href': 'https://api.spotify.com/v1/artists/5me0Irg2ANcsgc93uaYrpb', 'uri': 'spotify:artist:5me0Irg2ANcsgc93uaYrpb', 'name': 'The Notorious B.I.G.'}

In [47]:
import math
biggies_info = biggies['artists']['items']
biggie_total= 0
biggie_popularity= 0
for biggie in biggies_info:
    biggie_total= biggie_total + 1
    biggie_popularity = biggie_popularity + biggie['popularity']
print("The top 50 Biggies have an average score of popularity of", math.ceil(biggie_popularity / biggie_total))


The top 50 Biggies have an average score of popularity of 4

In [48]:
import requests
response = requests.get('https://api.spotify.com/v1/search?q=Lil&type=artist&market=US&limit=50')
Lil = response.json()

In [49]:
import math
Lil_info = Lil['artists']['items']
lil_total= 0
lil_popularity= 0
for lil in Lil_info:
    lil_total= lil_total + 1
    lil_popularity = lil_popularity + lil['popularity']
print("The top 50 Lils have an average score of popularity of", math.ceil(lil_popularity / lil_total))


The top 50 Lils have an average score of popularity of 47

Lils Graphic


In [50]:
#This is the link to my graphic of the various popularities.
#https://infogr.am/fd7c85b9-f59b-498d-829d-a6ead4fb6862

In [ ]:


In [ ]: