Skip to content
ZYROUGE edited this page Apr 11, 2020 · 7 revisions

Creating an Actual Client

  • Method 1
const genius = require("genius-lyrics");
const Genius = new genius.Client('your-genius-token');
  • Method 2
const genius = require("genius-lyrics");
const Genius = new genius('your-genius-token');

Visit Genius Developers Page for a Token


Properties

Methods


Properties

key

Usage: .key

Genius Lyrics Client's API Key

Returns: string

Example:

console.log(Genius.key)

version

Usage: .version

Genius Lyrics Package Version

Returns: string

Example:

console.log(Genius.version)

Methods

fetcher

Usage: .fetcher(endpoint)

Fetches the Endpoint

Note: This is only for Advanced-Usage

Parameter Type Description
endpoint string Fetches using node-fetch. Refer this

Returns: Promise {<pending>}

Example:

Genius.fetcher('https://api.genius.com/search?q=faded')
.then(res => console.log(res))
.catch(e => console.error(e));