Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

genius lyrics 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 :: inheritance in es6 
Javascript :: pushing element in array in javascript 
Javascript :: javascript urlsearchparams to object 
Javascript :: prisma seed 
Javascript :: modulus of negative numbers 
Javascript :: Encountered two children with the same key, `undefined`. flatlist 
Javascript :: react native paper text input 
Javascript :: javascript copy to clipboard 
Javascript :: add item to array in javascript 
Javascript :: how to send enter event to input field jquery 
Javascript :: cordova android close app with back button 
Javascript :: jest expect not contain 
Javascript :: refresh page by hand in react 
Javascript :: javascript collection to array 
Javascript :: create csv file javascript 
Javascript :: react native npm run start port 
Javascript :: electron hide devtools 
Javascript :: json stringify close circle 
Javascript :: multiply function javascript 
Javascript :: on() jquery 
Javascript :: js remove html element 
Javascript :: javascript today date in epoch 
Javascript :: read xlsx file in angular 5 
Javascript :: js substring first 4 numbwe 
Javascript :: javascript capitalize 
Javascript :: angularjs change route js 
Javascript :: create angular project 
Javascript :: jq each loop 
Javascript :: pretty alerts js 
Javascript :: javascript console log whole array 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =