Rate Limit Issues

You might want to limit the number of requests that a user can make to the web3Api. To do this, you can modify. You can do this to call Moralis.settings.setAPIRateLimit in your cloud-code:

Moralis.settings.setAPIRateLimit({
anonymous:10, authenticated:20, windowMs:60000
})

hello @cryptokid, do I have to deploy this line of code as a cloud function from my IDE?

yes, this code has to be added in your cloud code specific to a server

gotcha…thanks @cryptokid

1 Like

hello @cryptokid and @zoe619 can you tell more about how to deploy that with a code snipper i ran into this problem when i tried calling too many times and couldn’t figure out how to use this code
Moralis.settings.setAPIRateLimit({
anonymous:10, authenticated:20, windowMs:60000
})

im using my local machine and vs code

It may be easier to use legacy.moralis.io and paste it directly in cloud code

where can i find that cloud code on my local machine

You won’t have your cloud code on your local machine unless you have previously synced it to your server with the CLI.

You can copy that setAPIRateLimit code into your server’s cloud code either with the CLI tool or at https://legacy.moralis.io like cryptokid mentioned.