Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

genius api

// One way of using the Genius api

try {
  const response = 
    await fetch(`https://api.genius.com/search?q=Kendrick%20Lamar`, {
      method: 'GET',
      headers: {
        'User-Agent': 'CompuServe Classic/1.22',
        'Accept': 'application/json',
        'Host': 'api.genius.com',
        'Authorization': 'Bearer ' + 'replace_with_your_token'
      }
    });
  const data = await response.json();
  if (data.meta.status == 200) {
    return data;
  } else {
    return `Something went wrong: ${data}`;
  }
} catch (error) {
  console.log(error);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: Prevent Double Submit with JavaScript 
Javascript :: how to validate the textbox using jquery 
Javascript :: find the index of an object in an array 
Javascript :: is check objet empty 
Javascript :: wordpress ajax file upload 
Javascript :: nodejs aws s3 bucket delete item 
Javascript :: jquery div element find and remove 
Javascript :: hot reload problem react 17 
Javascript :: react native change app name 
Javascript :: javascript title string 
Javascript :: discord.js v13 intents 
Javascript :: angular access service in console 
Javascript :: javascript string search second occurrence 
Javascript :: useref array of refs 
Javascript :: create a html table dynamically using javascript 
Javascript :: sotre json on chrome storage 
Javascript :: checkvalidity 
Javascript :: alphabet string javascript 
Javascript :: zoho smtp mail nodejs 
Javascript :: javascript Capitalise a String 
Javascript :: node js catch any errors 
Javascript :: local storage remove multiple items 
Javascript :: js remove element from array 
Javascript :: css lint 
Javascript :: outer width jquery 
Javascript :: mongoose unique error message 
Javascript :: convert svg to base64 javascript 
Javascript :: javascript websocket 
Javascript :: iframe reload parent 
Javascript :: fadein fadeout jquery 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =