Token Gate Question - Give Access to User if they have tokenID within a range

The rate limit in moralis is horribly really restrictive, I’m not sure if it’s even viable to use moralis anymore with this in mind, can you please help me understand?

My use case is this, I need to implement token gating, in a way that gates tokens through a range, for example:

a collection has 10,000 tokens.
Only tokens 1000-2000 are allowed to access the content.

I thought of using getNFTsForContract API and paginate as needed, but then I checked the rate limits page and making a call to check the rate limit cost:

so if I have the PRO plan which has 60 CU/s, and the rateLimitCost is 5, I can do 60/5=12 calls per second?

is there a way around it? seems like a very strict limit, also is my math here right? I’m honestly not sure if the ā€œCU/sā€ is the rate limit anyway, just guessed it means ā€œcompute units per secondā€ and that ā€œcost/priceā€ refers to ā€œcompute unitsā€ā€¦

Check this for token gate demo - you need only one request to get user NFTs and then check which NFTs they have https://docs.moralis.io/docs/nextjs-nft-gated-website

most users dont have thousands of NFTs so normally 1 request is enough to get all their NFTs

Not what I was looking for, and not what I wanted, why did you edit my title?

I’m saying I need to know exactly which tokens the user has out of the range, not if they have any token in a collection, but if they have one out of a group of very specific tokens, within a larger collection.

that also didn’t answer my question about the rate limiting, and maybe most users have only a few NFTs but looking at our collectors it’s much more, usually a few hundreds each.

Even if it is 1 request, I need to implement this logic in the backend, where I’m not sure at what way I’ll be hit by rate limiting, this is a question about the rate limits, not about gating specifically.

In the example i linked - it gets all tokens owned by a user in a specific collection

You have to check which token ids they have exactly

Its very easy backend code - just loop though the result and check if the token id is between 1000-2000

loop though nftList and you are done


yes - we changed the title as its about NFT Gate use-case which and not that much about rate limit - we want to have this article as reference for similar token gate questions in the future

but to answer your rate limit question - you understand correctly in your first post