Skip to content

Get Genre of Song #179

Answered by allerter
ManuelBanza asked this question in Q&A
Feb 8, 2021 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

Hi. Genius doesn't provide genres (or tags as Genius likes to call them) through their official API. However, you can get them through the public/user API. Here's how you can do it:

from lyricsgenius import PublicAPI
song_id = 1  # the song you want tags for
public_api = PublicAPI()
song = public_api.song(song_id)['song']
print(song['tags'])

Note: You must be using v3.0 for this to work.
Warning: Personally, I haven't had any problems so far using the user/web API, but here's what one of the staff at Genius said about it:

Using the web API for non-browser based requests is not supported, and people found to be misusing it to gain information not provided by our public API [developers API…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@ManuelBanza
Comment options

@allerter
Comment options

Answer selected by johnwmillr
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #176 on February 10, 2021 02:21.