API not fetching data on deployment

on my local host, everything works well, but after I deploy on vercel, the web app fails to fetch data from the API as required. what could be the problem, please?
function init() {
randomBtnWord();
fetch("https://animechan.xyz/api/random")
.then((response) => response.json())
.then((quote) => {
console.log(quote);
quoteText.textContent = quote.quote;
character.textContent = `~ ${quote.character} [ ${quote.anime} ]`;
});
}
function init() {
randomBtnWord();
fetch("https://animechan.xyz/api/random")
.then((response) => response.json())
.then((quote) => {
console.log(quote);
quoteText.textContent = quote.quote;
character.textContent = `~ ${quote.character} [ ${quote.anime} ]`;
});
}
7 Replies
Jochem
Jochem13mo ago
check the devtools for log entries when I open that animechan URL, it gives me a 429 Too Many Requests error, so the api might just be overloaded? it's broken on their main site too
winniffy
winniffyOP13mo ago
failed to fetch oh
Jochem
Jochem13mo ago
there should be extra info in the network tab, including the http error you're getting
winniffy
winniffyOP13mo ago
Uncaught (in promise) TypeError: Failed to fetch
at HTMLDocument.init (script.js:24:3)
Uncaught (in promise) TypeError: Failed to fetch
at HTMLDocument.init (script.js:24:3)
the network error in the network tab is status 429 - too many requests
Jochem
Jochem13mo ago
Seems it's still broken then
MarkBoots
MarkBoots13mo ago
from their discord imo you should not rely too much on this service. seems like it's just a hobby project with not much care too it.
No description
MarkBoots
MarkBoots13mo ago
also, the github repo isn't updated for 9 months now and includes references to another host for the api endpoint, so even that isn't up to date
Want results from more Discord servers?
Add your server