429: Too many requests (Using React-Moralis hooks!)

I am using the React-Moralis ‘getNftBalances’ hook to get the user’s NFTs for an NFT Gallery I am making. However only some NFTs images (which were also uploaded using Moralis) get displayed on the Gallery and when I check the console I get: Failed to load resource: the server responded with a status of 429 (Too Many Requests)

How can I resolve this? Thanks!

What server gave that error message with too many requests? You should be able to identify the request in network tab in the browser.

I can’t see it! Here is a screenshot of what my console looks like. The red ones are the problematic requests obviously

yes, those one with red seems like they have that 429 error, click on one of them to see more info, like the complete url

Here’s what I got from clicking on different things I could see to gather information. As you can see I don’t understand much about the network tab in devtools so if you need anything more specific please explain to me. Thanks!

try to click more on those tabs until you get to a complete url, you are close

Got it! Thanks. They are coming from: https://gateway.pinata.cloud/ipfs/{CID}

1 Like

(but I still don’t know what to do with this)

maybe the website it is making too many requests in a second to that url and it gets rate limited.

Any ways to solve this? Or prevent it? The react-moralis hook I assume makes requests for getting my NFTs but that seems pretty unavoidable

I don’t know what happens in the code. I don’t know why it tired to access those urls. You could try to add a delay if it tires to access a lot of urls in parallel and to make those requests sequential