Title: | Get 'Genius' API Lyrics |
---|---|
Description: | Download the lyrics of your favorite songs in text and table formats. Also search for related songs or song information. More information: <https://docs.genius.com/> . |
Authors: | Alberto Almuiña <[email protected]> |
Maintainer: | Alberto Almuiña <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-11-03 02:48:31 UTC |
Source: | https://github.com/albertoalmuinha/rgenius |
This function gets the lyrics of the desired song.
get_discography_lyrics(artist_id, cores = detectCores(), access_token = Sys.getenv("GENIUS_API_TOKEN"))
get_discography_lyrics(artist_id, cores = detectCores(), access_token = Sys.getenv("GENIUS_API_TOKEN"))
artist_id |
Genius Artist ID |
cores |
Number of cores to use for parallel computing. Default: parallel::detectCores() |
access_token |
Genius Web API token. Defaults to Sys.getenv('GENIUS_API_TOKEN'). |
To use this function, you need to first use 'search_genius_artist' to get the artist ID. This function uses parallel processing to increase performance. Use the different cores of your device to achieve this, so there may be noticeable differences in performance depending on the device.
Returns a named list containing all the lyrics of the artist's songs.
Alberto Almuiña
## Not run: get_discography_lyrics('343657', cores = 2) ## End(Not run)
## Not run: get_discography_lyrics('343657', cores = 2) ## End(Not run)
This function gets 'genius' artist information
get_genius_artist(artist_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
get_genius_artist(artist_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
artist_id |
Genius Artist ID |
access_token |
Genius Web API token. Defaults to Sys.getenv('GENIUS_API_TOKEN'). |
To use this function, you need to first use 'search_genius_artist' to get the artist ID.
Returns a data frame with the artist's information
Alberto Almuiña
## Not run: get_genius_artist('343657') ## End(Not run)
## Not run: get_genius_artist('343657') ## End(Not run)
This function gets all the songs of the artist in genius.
get_genius_artist_songs(artist_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
get_genius_artist_songs(artist_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
artist_id |
Genius Artist ID |
access_token |
Genius Web API token. Defaults to Sys.getenv('GENIUS_API_TOKEN'). |
To use this function, you need to first use 'search_genius_artist' to get the artist ID.
Returns a data frame with the artist's songs information
Alberto Almuiña
## Not run: get_genius_artist_songs('343657') ## End(Not run)
## Not run: get_genius_artist_songs('343657') ## End(Not run)
This function gets 'genius' song information
get_genius_song(song_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
get_genius_song(song_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
song_id |
Genius Song ID |
access_token |
Genius Web API token. Defaults to Sys.getenv('GENIUS_API_TOKEN'). |
To use this function, you need to first use 'search_genius_song' to get the song ID.
Returns a data frame with the song's information
Alberto Almuiña
## Not run: get_genius_song('3440889') ## End(Not run)
## Not run: get_genius_song('3440889') ## End(Not run)
This function gets the lyrics of the desired song.
get_genius_song_lyrics(song_id, output = "tibble", url = NULL, access_token = Sys.getenv("GENIUS_API_TOKEN"))
get_genius_song_lyrics(song_id, output = "tibble", url = NULL, access_token = Sys.getenv("GENIUS_API_TOKEN"))
song_id |
Genius Song ID |
output |
'tibble' or 'text'. Default: tibble. |
url |
If for some reason the function cannot find the url to download the letter, you can use a genius url to download it. |
access_token |
Genius Web API token. Defaults to Sys.getenv('GENIUS_API_TOKEN'). |
To use this function, you need to first use 'search_genius_song' to get the song ID.
Returns a tibble or a character vector with the lyrics
Alberto Almuiña
## Not run: get_genius_song_lyrics('55882', output = 'text') ## End(Not run)
## Not run: get_genius_song_lyrics('55882', output = 'text') ## End(Not run)
This function gets 'genius' media information
get_song_media(song_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
get_song_media(song_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
song_id |
Genius Song ID |
access_token |
Genius Web API token. Defaults to Sys.getenv('GENIUS_API_TOKEN'). |
To use this function, you need to first use 'search_genius_song' to get the song ID. This function returns the provider (YouTube, Spotify ..), the type (audio, video) and a link for the content.
Returns a tibble with the media's information
Alberto Almuiña
## Not run: get_song_media('55882') ## End(Not run)
## Not run: get_song_media('55882') ## End(Not run)
This function gets song producer information
get_song_producer_artist(song_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
get_song_producer_artist(song_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
song_id |
Genius Song ID |
access_token |
Genius Web API token. Defaults to Sys.getenv('GENIUS_API_TOKEN'). |
To use this function, you need to first use 'search_genius_song' to get the song ID. This function returns the producer name and links to their genius profiles and images.
Returns a tibble with the producer's information
Alberto Almuiña
## Not run: get_song_producer_artist('55882') ## End(Not run)
## Not run: get_song_producer_artist('55882') ## End(Not run)
This function fetches songs related to the wanted one.
get_song_relationship(song_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
get_song_relationship(song_id, access_token = Sys.getenv("GENIUS_API_TOKEN"))
song_id |
Genius Song ID |
access_token |
Genius Web API token. Defaults to Sys.getenv('GENIUS_API_TOKEN'). |
To use this function, you need to first use 'search_genius_song' to get the song ID.
Returns a tibble with related song's information
Alberto Almuiña
## Not run: get_song_relationship('55882') ## End(Not run)
## Not run: get_song_relationship('55882') ## End(Not run)
This function searches 'genius' artists by name
search_genius_artist(artist_name, access_token = Sys.getenv("GENIUS_API_TOKEN"))
search_genius_artist(artist_name, access_token = Sys.getenv("GENIUS_API_TOKEN"))
artist_name |
String of artist name |
access_token |
Genius Web API token. Defaults to Sys.getenv('GENIUS_API_TOKEN'). |
All Genius API endpoints require an artist or song ID. The 'search_' functions in this package try to search for the desired artists/songs to obtain their Genius ID and to use them later.
Returns a data frame with the artist's information
Alberto Almuiña
## Not run: search_genius_artist('Arctic Monkeys') ## End(Not run)
## Not run: search_genius_artist('Arctic Monkeys') ## End(Not run)
This function searches 'genius' songs by name
search_genius_song(song_name, access_token = Sys.getenv("GENIUS_API_TOKEN"))
search_genius_song(song_name, access_token = Sys.getenv("GENIUS_API_TOKEN"))
song_name |
String of song name |
access_token |
Genius Web API token. Defaults to Sys.getenv('GENIUS_API_TOKEN'). |
All Genius API endpoints require an artist or song ID. The 'search_' functions in this package try to search for the desired artists/songs to obtain their Genius ID and to use them later.
Returns a data frame with the song's information
Alberto Almuiña
## Not run: search_genius_song('Paradise') ## End(Not run)
## Not run: search_genius_song('Paradise') ## End(Not run)