Skip to content

Documentation

Modules

genius-lyrics

Classes

Client
Album
Artist
ArtistsClient
SongsClient
Song

Objects

Constants : object

genius-lyrics

Example

const Genius = require("genius-lyrics");

genius-lyrics.Client : Client

Kind: static property of genius-lyrics
Example

const Client = new Genius.Client(key);

genius-lyrics.SongsClient : SongsClient

Kind: static property of genius-lyrics
Example

const Client = new Genius.SongsClient(key);

genius-lyrics.ArtistsClient : ArtistsClient

Kind: static property of genius-lyrics
Example

const Client = new Genius.ArtistsClient(key);

genius-lyrics.Song : Song

Kind: static property of genius-lyrics


genius-lyrics.Artist : Artist

Kind: static property of genius-lyrics


genius-lyrics.Album : Album

Kind: static property of genius-lyrics


genius-lyrics.Constants : Constants

Kind: static property of genius-lyrics


genius-lyrics.Version : string

Kind: static property of genius-lyrics


Client

Kind: global class


new Client([key])

Param Type Description
[key] string Genius Token

client.songs : SongsClient

Songs Fetcher

Kind: instance property of Client


client.artists : ArtistsClient

Artist Fetcher

Kind: instance property of Client


client.setKey([key])

Change the Key of the Genius Client

Kind: instance method of Client

Param Type
[key] string

Album

Kind: global class


new Album(res, artist)

Param Type Description
res Object Raw JSON Response from Genius.com
artist Artist Genius Artist

album.name : string

Name of the Album

Kind: instance property of Album


album.title : string

Title of the Album

Kind: instance property of Album


album.id : number

ID of the Album

Kind: instance property of Album


album.image : string

Image URL of the Album

Kind: instance property of Album


album.url : string

URL of the Album

Kind: instance property of Album


album.endpoint : string

API Endpoint URL of the Album

Kind: instance property of Album


album.artist : Artist

Artist of the Album

Kind: instance property of Album


album.partial : boolean

Whether the Album only has Partial Information

Kind: instance property of Album


album.raw : Object

Raw JSON Response

Kind: instance property of Album


Artist

Kind: global class


new Artist(res, key, partial)

Param Type Default Description
res Object Raw JSON Response from Genius.com
key string Genius Token
partial boolean false Whether it is a Partial JSON

artist.name : string

Name of the Artist

Kind: instance property of Artist


artist.id : number

ID of the Artist

Kind: instance property of Artist


artist.url : string

URL of the Artist's Page

Kind: instance property of Artist


artist.thumbnail : string

Thumbnail URL of the Artist

Kind: instance property of Artist


artist.image : string

Image URL of the Artist

Kind: instance property of Artist


artist.iq : number

IQ of the Artist

Kind: instance property of Artist


artist.verified : Object

Verified Tags of the Artist

Kind: instance property of Artist
Properties

Name Type
normal boolean
meme boolean

artist.partial : boolean

Whether this Artist object only has Partial Information

Kind: instance property of Artist


artist.socialmedia : Object

Social Media of the Artist

Kind: instance property of Artist
Properties

Name Type
[facebook] string
[twitter] string

artist.raw : Object

Raw JSON Response

Kind: instance property of Artist


artist.songs([options]) ⇒ Promise.<Array.<Song>>

Fetches the songs of the Artist (Requires Key)

Kind: instance method of Artist

Param Type Default Description
[options] Object Options
[options.per_page] number 20 Results per page
[options.sort] "title" | "popularity" "title" Sort
[options.page] number 1 Page Number to fetch

Example

const Songs = await Artist.songs();

artist.fetch() ⇒ Promise.<Artist>

Fetches All Information about the Artist and updates all the existing Properties (Requires Key)

Kind: instance method of Artist
Example

const NewArtist = await Artist.fetch();

ArtistsClient

Kind: global class


new ArtistsClient([key])

Param Type Description
[key] string Genius Token

Example

const ArtistsClient = await Genius.Artist.Client(key);

artistsClient.get(q) ⇒ Promise.<Artist>

Fetches the Artist using the provided ID (Requires Key)

Kind: instance method of ArtistsClient

Param Type Description
q number ID of the Artist

Example

const Artist = await ArtistsClient.get(456537);

SongsClient

Kind: global class


new SongsClient([key])

Param Type Description
[key] string Genius Token

Example

const SongsClient = new Genius.Songs.Client(key);

songsClient.search(q) ⇒ Promise.<Array.<Song>>

Searches for songs for the provided query (Key is optional)

Kind: instance method of SongsClient

Param Type Description
q string Search terms

Example

const SearchResults = await SongsClient.search("faded");

songsClient.get(q) ⇒ Promise.<Song>

Fetches the Song using the provided ID (Requires Key)

Kind: instance method of SongsClient

Param Type Description
q number ID of the Song

Example

const Song = await SongsClient.get(3276244);

Song

Kind: global class


new Song(res, key, partial)

Param Type Default Description
res Object Raw JSON Response from Genius.com
key string Genius Token
partial boolean false Whether it is a Partial JSON

song.title : string

Title of the Track

Kind: instance property of Song


song.fullTitle : string

Full Title of the Track

Kind: instance property of Song


song.featuredTitle : string

Featured Title of the Track

Kind: instance property of Song


song.id : number

ID of the Track

Kind: instance property of Song


song.thumbnail : string

Thumbnail URL of the Track

Kind: instance property of Song


song.image : string

Image URL of the Track

Kind: instance property of Song


song.url : string

URL of the Track

Kind: instance property of Song


song.endpoint : string

API Endpoint URL of the Track

Kind: instance property of Song


song.artist : Artist

Artist of the Track

Kind: instance property of Song


song.partial : boolean

Whether the Track only has Partial Information

Kind: instance property of Song


song.album : Album

Album of the Track

Kind: instance property of Song


song.releasedAt : Date

Release Time of the Track

Kind: instance property of Song


song.raw : Object

Raw JSON Response

Kind: instance property of Song


song.lyrics([removeChorus]) ⇒ Promise.<string>

Fetches Lyrics of the Track

Kind: instance method of Song

Param Type Default Description
[removeChorus] boolean false Whether to remove Chorus Lines

Example

const Lyrics = await Song.lyrics(true);

song.fetch() ⇒ Promise.<Song>

Fetches All Information about the Track and updates all the existing Properties (Requires Key)

Kind: instance method of Song
Example

const NewSong = await Song.fetch();

Constants : object

Kind: global namespace


Constants.BASE_URL : string

Kind: static property of Constants


Constants.UN_BASE_URL : string

Kind: static property of Constants


Constants.ARTIST_SORTS : string

Kind: static property of Constants


Constants.REQUIRES_KEY : string

Kind: static property of Constants


Constants.INV_RES_OBJ : string

Kind: static property of Constants


Constants.INV_TOKEN : string

Kind: static property of Constants


Constants.NO_RESULT : string

Kind: static property of Constants


Constants.ERR_W_MSG(err, msg) ⇒ string

Kind: static method of Constants

Param Type
err any
msg any