a nodejs module to use to scrape lyrics from Genius + wrap the API
npm install genius-scraper
npm install genius-scraper
`
:book: Usage
Currently supplies three functions to interact with the Genius API/scrape lyrics.
$3
Requires a Genius API access token. Pass the token and the artist name. If fullObject is true, it returns the full API object response from Genius, otherwise returns a small object in the format:
`js
{
name: "Britney Spears",
id: 1052
}
`
This function utilizes the Genius API endpoint at https://api.genius.com/search; the endpoint returns an object with the first 10 hits related to your search query (i.e., artistName). If any of the returned hits contain a primary artist name that matches the artistName parameter, this artist name and ID will be returned. If none of the primary artist names match the search query, then every artist name and ID will be returned as an array of objects. If no hits are found, null is returned.
### getSongs(accessToken, artistID, fullObject = false)
Requires a Genius API token. Pass the token and an artist ID (can be obtained using getArtist). If fullObject is true, it returns an array of the full API object response from Genius for each song, otherwise returns an array of small objects representing each song by the artist in the format:
`js
{
title: "...Baby One More Time",
id: 78169
url: "https://genius.com/Britney-spears-baby-one-more-time-lyrics"
}
``