Tools for working with the Genius (FKA Rap Genius) API.
Get the latest stable version from CRAN…
…or install the development version from Github.
- Create a Genius API client
- Generate a client access token from your API Clients page
- Set your credentials in the System Environment variable
GENIUS_API_TOKENby calling the
genius_token()function and entering your Genius Client Access Token when prompted.
Start with the basics!
How many times did ’Ye say “good morning”, on the track “Good Morning”?
library(geniusr) library(dplyr) library(tidytext) # get lyrics get_lyrics_search(artist_name = "Kanye West", song_title = "Good Morning") %>% # get lyric bigrams unnest_tokens(bigram, line, token = "ngrams", n = 2) %>% # look for good morning filter(bigram == "good morning") %>% # count bigram frequency nrow() #>  18
- Get citation information for geniusr in R with
citation(package = 'geniusr')
- Please note that the geniusr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
- the genius package specialises in lyrics retrieval from Genius.