Tools for working with the Genius (FKA Rap Genius) API.
- Genius Developers Site: https://genius.com/developers
- Genius API Docs: https://docs.genius.com/
Get the latest stable version from CRAN…
install.packages("geniusr")
…or install the development version from Github (recommended).
remotes::install_github("ewenme/geniusr")
- 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_TOKEN
by calling thegenius_token()
function and entering your Genius Client Access Token when prompted.
Start with the basics!
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()
#> [1] 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.