Python script for searching API
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A quick and dirty Python script for searching lyrics/artists/songs on, parsing the returned JSON, and outputting it in a CSV file.

Requirements and Setup

Written for Python 2.7 (but could be tweaked for Python 3 pretty easily). Requires a client access token from (Maybe in future will generate authentication from client_id and client_secret.) Add access token credential to "credentials.ini" in project root folder

client_access_token = 'fillinyourtokenhere'

Script passes the access token in a request header as specified in Genius documentation: Using An Access Token.


python 'search terms here'

or if using as imported function



  • Only gets 50 pages worth of results (approximately 1000 results). Appears to be a restriction on Genius' end.
  • Currently searches not just lyrics for search term, but also song titles and artist names.
  • No way to differentiate between genres or between lyrics vs. text content (e.g. speeches, interviews, magazine articles, books)?
  • This was just for fun!

##Sample output First ten results for search for albee square (web search)

page id title url path header_image_url annotation_count pyongs_count primaryartist_id primaryartist_name primaryartist_url primaryartist_imageurl
1 10388 Albee Square Mall /Biz-markie-albee-square-mall-lyrics 1 26362 Biz Markie
1 582565 Albee Square Mall /Skyzoo-and-torae-albee-square-mall-lyrics 1 211611 Skyzoo & Torae
1 136493 Definition Of A Rap Flow /Ra-the-rugged-man-definition-of-a-rap-flow-lyrics 1 13 320 R.A. The Rugged Man
1 236 Hello Brooklyn 2.0 /Jay-z-hello-brooklyn-20-lyrics 1 5 2 Jay Z
1 1705 Return of the Crooklyn Dodgers /The-crooklyn-dodgers-return-of-the-crooklyn-dodgers-lyrics 1 3 861 The Crooklyn Dodgers
1 3502 Motherless Child /Ghostface-killah-motherless-child-lyrics 1 2 20 Ghostface Killah
1 9435 Hey Fuck You /Beastie-boys-hey-fuck-you-lyrics 1 329 Beastie Boys
1 104 Angelz /Mf-doom-angelz-lyrics 1 1 70 MF DOOM
1 21391 The Mall /Gang-starr-the-mall-lyrics 1 1 220 Gang Starr