There are 2 different types of rate-limits you need to know about.
Rate-limits when using
Moralis.Web3API.
in the SDKError 141 - Rate limit between your server and your clients
The first type of rate limit is protecting your Moralis Server from spam requests from your clients.
Your server has built-in rate limits you can adjust that dictate how many requests different types of users can do before they are rate limited. You have full control over these rate limits and can adjust them with a few lines of code in your Cloud Code.
If your clients go above the allowed rate-limit you set they will see the following error:
Error 141: Too many requests to Web3API from this particular client, the clients needs to wait before sending more requests. This can be adjusted using Moralis.settings.setAPIRateLimit. Read More:
https://docs.moralis.io/moralis-dapp/web3-sdk/rate-limit.
When this error can happen:
Imagine a particular user using your website trying to make a large number of requests during the same minute. Your server will protect itself and reject the user. Only the particular user will be affected.
The way to fix this error is to adjust your settings as described above.
Error 141 - Rate limit between your Moralis server and Web3 API
When your users are calling the Web3 API from the SDK they may not be rate-limited by your server (situation described above) but they may get rate-limited because of your plan.
Error 141: This Moralis Server is rate-limited because of the plan restrictions. See the details about the current rate and throttle limits: [RATE LIMIT INFO].
When this error can happen:
You have many users not doing too many requests individually, but collectively they are doing more requests than your plan allows. For example - your plan allows 1000 request per minute. You have 100 users doing 15 requests per minute.
The way to fix this error is to upgrade your Moralis plan.
Rate-limits when calling Web3 API using HTTP
Error 429 - Rate limit between your non-Moralis server and Web3 API
When you are calling Web3 API from your own non-Moralis backend you may get limited by the Web3 API.
In that case you will get
Error 429: Rate limit exceeded
.When you call the API you can expect the response header in order to understand your rate limits.

Response header example.
The most important values to look at are
x-rate-limit-limit
and x-rate-limit-used
.The first one tells you how many requests you are allowed to do per second and the second one how many requests you already did in current second.
Some heavy requests count as several requests.
In order to not get rate-limited pay attention to
x-rate-limit-used
to be lower than x-rate-limit-limit
.The way to fix this error is to upgrade your Moralis plan.
(If you are using NFT endpoints with offset - please read this as they have temporarily different special weights).
Comments
0 comments
Please sign in to leave a comment.