Api not fetching data

Hello! I have learnt the concepts of async await and fetch() method in js and I'm trying to practice it through random quote generator but I'm facing some issues

Issue:
The api is not fetching the data. I have checked the console tab the event listener is working but it gives me errors on fetching the data

I have gotten the api url from a github repo provided in the yt description of a video

const quote = document.querySelector(".quote");
const quoteBtn = document.querySelector(".get-quoteBtn");

async function getQuote() {
    console.log("get new quote")
    let response = await fetch("https://api.quotable.io/random");
    let data = await response.json();
    console.log(data);
}

quoteBtn.addEventListener("click",getQuote);
Was this page helpful?