Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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 :: Set up routes for vue in laravel 
Javascript :: confirm javascript 
Javascript :: set timeout 
Javascript :: clean url javascript 
Javascript :: react native keyboard event listener 
Javascript :: define function to get random value from array 
Javascript :: jqueyr element is hide 
Javascript :: usenavigate in react 
Javascript :: input type styled components 
Javascript :: action checkbox selected vue js 
Javascript :: reset parsley validation 
Javascript :: push array javascript 
Javascript :: mathjax new line 
Javascript :: how to get last string in javascript 
Javascript :: difference between let and var in javascript 
Javascript :: force delete in sequelize 
Javascript :: add regexp to antd 
Javascript :: discord.js say command embed 
Javascript :: How to fetch API data using POST and GET in PHP 
Javascript :: javascript random element from array 
Javascript :: javascript check if object 
Javascript :: how to access router from the store vue 
Javascript :: array map destructuring 
Javascript :: for loop in vue 
Javascript :: number_format in jquery 
Javascript :: reverse every word in a string javascript 
Javascript :: document.append 
Javascript :: js platformer 
Javascript :: toastr alert js 
Javascript :: express.urlencoded extended true or false 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =