Skip to content

Get albums for a specific artist #189

Answered by allerter
xiaopeiwu asked this question in Q&A
Discussion options

You must be logged in to vote

Hi. To get an Artist's albums you can use the Genius.artist_albums method and then get more information from there:

albums = genius.artist_albums(45)['albums']
for album in albums:
    full_album = genius.search_album(album_id=album['id'], get_full_info=True)

As for why some attributes are present in the dict, but not in the object, it's because of consistency. Depending on the value of the get_full_info parameter there will be more or fewer data in the response, but LyricsGenius has to make sure that the values are consistent, so some of them have been removed from the object (but still available through to_dict if you want them). We'll probably change this in the future to provide all p…

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@xiaopeiwu
Comment options

@allerter
Comment options

@xiaopeiwu
Comment options

@allerter
Comment options

@xiaopeiwu
Comment options

Answer selected by xiaopeiwu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants