I am currently doing research into extracting specific items from a song in Spotify. I wanted to grab the specific release date and genres from an artist. I am pulling information from a pandas datagrams that looks like this:.
I've tried to do most of this by hand, but being a dataframe of about 1100 songs it became tedious. So I have looking into APIs to help with this, specifically spotipy.
I have an idea that I would start with:
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials #To access authorised Spotify data
client_id = 'client_id'
client_secret = 'client_secret'
client_credentials_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager) #spotify object to access API
name = "AJR" #chosen artist
result = sp.search(name) #search query
result['tracks']['items'][0]['artists']
But I am at a loss from where to go from that. I have tried looking at the documentation and while there is information on how to get genre and date from the Spotify For Developers page, I can't seem to find it in spotipy. Any Suggestions on where to go from here or how to implement an algorithm to get the desired details would be great. Thanks.