Lyrics Fetcher Genius
How to Use
Installation
npm install --save lyricsfetchergenius@latest
Methods and Examples in Javascript
Get the genius APIKey/Token here
Using Typescript
import lyricsfetchergenius from "lyricsfetchergenius";
Using Javascript
Using GetLyrics:
const lyricsfetchergenius = require("lyricsfetchergenius");
var options = {
APIKey: "your-genius-api-key",
Title: "Late Night Trips",
Artist: "Alex1",
OptimizeQuery: true,
AuthHeader: true,
};
const APIKey = process.env.APIKEY || "your-genius-api-key";
const songTitle = player.queue.current.title;
const songArtist = player.queue.current.author;
var options = {
APIKey: APIKey,
Title: songTitle,
Artist: songArtist,
OptimizeQuery: true,
AuthHeader: true,
};
async () => {
try {
let lyrics = await lyricsfetchergenius.GetLyrics(options);
lyrics = lyrics.replace(/(\[.+\])/g, "");
console.log(lyrics);
} catch (error) {
throw error;
}
};
Using GetAlbumArt:
const lyricsfetchergenius = require("lyricsfetchergenius");
var options = {
APIKey: "your-genius-api-key",
Title: "Late Night Trips",
Artist: "Alex1",
OptimizeQuery: true,
AuthHeader: true,
};
const APIKey = process.env.APIKEY || "your-genius-api-key";
const songTitle = player.queue.current.title;
const songArtist = player.queue.current.author;
var options = {
APIKey: APIKey,
Title: songTitle,
Artist: songArtist,
OptimizeQuery: true,
AuthHeader: true,
};
async () => {
try {
const albumArt = await lyricsfetchergenius.GetAlbumArt(options);
console.log(albumArt);
} catch (error) {
throw error;
}
};
Using GetSong:
const lyricsfetchergenius = require("lyricsfetchergenius");
var options = {
APIKey: "your-genius-api-key",
Title: "Late Night Trips",
Artist: "Alex1",
OptimizeQuery: true,
AuthHeader: true,
};
const APIKey = process.env.APIKEY || "your-genius-api-key";
const songTitle = player.queue.current.title;
const songArtist = player.queue.current.author;
var options = {
APIKey: APIKey,
Title: songTitle,
Artist: songArtist,
OptimizeQuery: true,
AuthHeader: true,
};
async () => {
try {
const albumArt = await lyricsfetchergenius.GetSong(options);
console.log(albumArt);
} catch (error) {
throw error;
}
};
Using GetSongByID:
const lyricsfetchergenius = require("lyricsfetchergenius");
const songID = "368385";
const APIKey = process.env.APIKEY || "your-genius-api-key";
async () => {
try {
const song = await lyricsfetchergenius.GetSongByID(ID, APIKey);
console.log(song);
} catch (error) {
throw error;
}
};
Using SearchSong:
const lyricsfetchergenius = require("lyricsfetchergenius");
var options = {
APIKey: "your-genius-api-key",
Title: "Late Night Trips",
Artist: "Alex1",
OptimizeQuery: true,
AuthHeader: true,
};
const APIKey = process.env.APIKEY || "your-genius-api-key";
const songTitle = player.queue.current.title;
const songArtist = player.queue.current.author;
var options = {
APIKey: APIKey,
Title: songTitle,
Artist: songArtist,
OptimizeQuery: true,
AuthHeader: true,
};
async () => {
try {
let song = await lyricsfetchergenius.SearchSong(options);
console.log(song);
} catch (error) {
throw error;
}
};