Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Fetches song lyrics using the Genius.com API and website. Uses the node-genius client.
$ npm install --save lyricist
Get an API key at https://genius.com/api-clients.
var lyricist = require('lyricist')(api_key);
Use song()
to fetch a single song:
lyricist.song(714198, function (err, song) {
console.log(song.lyrics);
});
//output: Spirit of my silence I can [...] never see us again
You can also search by keywords, including lyrics:
lyricist.song({search: "spirit of my silence I can hear you"}, function (err, song) {
console.log("%s - %s", song.primary_artist.name, song.title);
});
//output: Sufjan Stevens - Death with Dignity
or by artist/title:
lyricist.song({search: "Kanye West Famous"}, function (err, song) {
console.log("%s - %s", song.primary_artist.name, song.title);
});
//output: Kanye West - Famous
Use album()
to look up an album by ID. The API can't search an album by title, but song()
will return a songs.album.id
:
lyricist.album(56682, function(err, album) {
console.log("%s by %s was released on %s", album.name, album.artist.name,album.release_date);
});
//output: Lanterns by Son Lux was released on 2013-08-21
The returned album
object looks like this:
{
api_path: "/albums/56682",
cover_art_url: "https://images.genius.com/697732b0160cfd90f5cde6db0b6555b0.1000x1000x1.jpg",
id: 56682,
name: "Lanterns",
url: "http://genius.com/albums/Son-lux/Lanterns",
artist: {...},
description_annotation: {...},
release_date: "2013-08-21",
songs: [...]
}
album()
provides the album.songs
array as seen above. Example usage:
lyricist.album(56682, function(err, album) {
for(var i in album.songs)
console.log(album.songs[i].title);
});
//output: Alternate World \n Lost It To Trying \n[...]
When fetching multiple songs, .lyrics
will be null
unless you explicitly request them like this:
lyricist.album(56682, {fetch_lyrics: true}, function(err, album) {});
Use artist()
to look up an artist by ID:
lyricist.artist(2, function(err, artist) {
console.log(artist.name);
});
//output: Jay Z
The returned artist
object looks like this:
{
api_path: "/artists/2",
description: {...},
facebook_name: "JayZ",
followers_count: 3117,
header_image_url: "https://images.genius.com/0d53c56a247ef39e4106718deb95f347.1000x500x1.jpg",
id: 2,
image_url: "https://images.genius.com/0d53c56a247ef39e4106718deb95f347.1000x500x1.jpg",
instagram_name: "officials_c_",
name: "Jay Z",
twitter_name: "S_C_",
url: "http://genius.com/artists/Jay-z",
current_user_metadata: {...},
description_annotation: {...},
user: null,
songs: [...],
next_page: 2
}
artist()
will provide the artist.songs
array. Example usage:
lyricist.artist(2, {get_songs: true}, function(err, artist) {
for(var i in artist.songs)
console.log(artist.songs[i].title);
});
//output: '03 Bonnie & Clyde\n100$ Bill[...]
artist()
will show 20 results per page by default, and can be as high as 50. artist.next_page
will return the next_page
number assuming there are more pages. You can specify the page number like this:
lyricist.artist(2, {page: 2, per_page: 50}, function(err, artist) { });
artist()
will not fetch lyrics. Lyricist scrapes the Genius.com website for lyrics and this would result in too many concurrent page requests.
FAQs
Fetches song lyrics using the Genius.com API and website.
The npm package lyricist receives a total of 62 weekly downloads. As such, lyricist popularity was classified as not popular.
We found that lyricist demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.