Mika Scraper / SearchLyrics
Function: SearchLyrics()
SearchLyrics(
query
):Promise
<LyricsResult
>
Fetches lyrics and metadata for a specified song query from songtexte.com.
Parameters
query
string
:
The song name or artist/title combination used for the search.
Returns
Promise
<LyricsResult
>:
A promise that resolves to an object containing the song title, artist, URL, and cleaned lyrics.
Throws
Error
:
In the event of a failed network request or if no results are found.
Example
import { SearchLyrics } from "mika-scraper";
async function fetchLyrics() {
try {
const result = await SearchLyrics("Imagine Dragons Believer");
console.log(result);
} catch (error) {
console.error("Error fetching lyrics:", error);
}
}
fetchLyrics();
Last updated on