Error: Too many requests

I seem to be getting hit with…
Error: Too many requests, please try again later.
I’ve looked at my activity and i should be well under the 3500 calls per minute on the Pro plan
I estimate I’m doing well under 500.
I’m using three servers…
https://bevndhaaxzdb.usemoralis.com:2053/server
https://ukg911ra3l4a.usemoralis.com:2053/server
https://nfo3toxbrq3f.usemoralis.com:2053/server
They were just updated this afternoon
Thanks, Bret

hi

https://docs.moralis.io/misc/rate-limit#why-am-i-rate-limited

https://docs.moralis.io/moralis-server/web3-sdk/rate-limit

you have to add that code in your cloud functions code to increase the limit, this is a new feature added recently that can be configured in your cloud functions code

Hi there - thanks for the quick reply
I’m not using cloud functions and i’ve read the new documentation - and still don’t think i should be rate limited.
Can you tell how many calls the system reports that I’m doing?

how are you making those requests? you don’t have to use a cloud function, you can configure in cloud functions code the rate limit: https://docs.moralis.io/moralis-server/web3-sdk/rate-limit

I’m the only client for my app (it’s a research tool) so don’t want any limits. I presume that the setAPIRateLimit function is only required if you want to REDUCE the default limits?

The main call that’s getting hit on is one to Moralis.Web3API.token.getTokenMetadata

Am I really over the 3500/m limit - I really don’t see how I’m doing that.

you have to use setAPIRateLimit to increase the limit, the default limit is only of 30 requests per minute for unauthenticated users.

OK - if i’m using a server with URL and APPID - am i classed as authenticated or unauthenticated?

Also, to get the maximum rate do it just use…

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

I think that you are considered unauthenticated

That code should be fine with that limit of 3500

I’ll give that a try - and thanks so much for your excellent help (as usual)

Does setAPIRateLimit need to be set in a cloud function?
Can it be set from a Javascript session (as everything else can)

You cannot modify this from your frontend. Even if it’s possible every user will be able to change it and kill your server. It’s not secure, all settings like this should be on the server side to protect it from abuse

Ahhh - good point :+1:

I don’t have any users so I don’t really think about it from that angle. Makes a lot of sense.

My app seems to be flying along now so all’s good :slight_smile:

1 Like

Glad to hear this. Happy BUIDLings :man_mechanic: