https://github.com/ewenme/geniusr
work with data & lyrics from Genius
https://github.com/ewenme/geniusr
genius genius-api lyrics r rstats
Last synced: 8 months ago
JSON representation
work with data & lyrics from Genius
- Host: GitHub
- URL: https://github.com/ewenme/geniusr
- Owner: ewenme
- License: other
- Created: 2017-11-19T22:02:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-10T16:41:51.000Z (about 2 years ago)
- Last Synced: 2025-10-22T05:52:49.786Z (8 months ago)
- Topics: genius, genius-api, lyrics, r, rstats
- Language: R
- Homepage: https://ewenme.github.io/geniusr/
- Size: 3.98 MB
- Stars: 51
- Watchers: 3
- Forks: 16
- Open Issues: 5
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo = TRUE, warning = FALSE, message = FALSE, collapse = TRUE,
comment = "#>", fig.path = "man/figures/README-"
)
```
# geniusr 
[](https://www.tidyverse.org/lifecycle/#maturing)
[](https://cran.r-project.org/package=geniusr)
[](http://cran.rstudio.com/web/packages/geniusr/index.html)
[](https://travis-ci.org/ewenme/geniusr)
[](https://ci.appveyor.com/project/ewenme/geniusr)
[](https://codecov.io/gh/ewenme/geniusr?branch=master)
## Overview
Tools for working with the *Genius* (FKA *Rap Genius*) API.
- Genius Developers Site: [https://genius.com/developers](https://genius.com/developers)
- Genius API Docs: [https://docs.genius.com/](https://docs.genius.com/)
## Install
Get the latest stable version from CRAN...
```{r, eval = FALSE}
install.packages("geniusr")
```
...or install the development version from Github (recommended).
```{r install_dev, eval=FALSE}
remotes::install_github("ewenme/geniusr")
```
## Authenticate
1. [Create a Genius API client](https://genius.com/api-clients/new)
2. Generate a client access token from your [API Clients page](https://genius.com/api-clients)
3. Set your credentials in the System Environment variable `GENIUS_API_TOKEN` by calling the `genius_token()` function and entering your Genius Client Access Token when prompted.
## Use
Start with [the basics!](https://ewenme.github.io/geniusr/articles/geniusr.html)
### How many times did 'Ye say "good morning", on the track "Good Morning"?
```{r good_morning_count}
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()
```
## Other
- 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](https://ewenme.github.io/geniusr//CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
## Related work
- the [genius](https://github.com/JosiahParry/genius) package specialises in lyrics retrieval from Genius.