Limit 100, how do I make this faster?

The recent change in the moralis api made my app so much slower. I need to get this run faster, like way faster, I’m trying to get all the owners of a 10k nft collection, it previously took under 45 seconds, now it takes well over 3 minutes. It only allows me to get 100 owners (limit: 100) each time as a maximum (previously, 500 max) - this currently runs 100 times for a 10k nft collection.

let options = {
    address: ContractAddress,
    chain: "eth",
    limit: 100,
    cursor: cursor,
};

await Moralis.Web3API.token.getNFTOwners(options);

How can i get around this?

do you also have an example of a nft collection that takes 3 minutes?

When I tried it this morning it wasn’t as slow, I suspect it was because the server was under higher load last night.

This took 1m, 52s: 0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d

Need this to be faster even during higher loads. Thanks for guiding me through another roadblock!

I tried now by making requests directly to the REST api:

https://deep-index.moralis.io/api/v2/nft/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/owners?chain=eth&format=decimal

and it took 78 seconds first time and 55 seconds the following time.

Nice, will probably switch to the rest api then - is there anyway to get it faster than this? The 500 limit was so much nicer and in awe of what was. If I paid for Moralis, would i get higher limits?

There isn’t a way to get a higher limit more than 100 now.
You can add a request on roadmap.moralis.io for what endpoints you want to work faster when getting all the data.

Awesome, thank you - can you share a snippet of the code you used to run the request for all 10k in the collection to the rest api?

I used something similar to this example:
https://docs.moralis.io/misc/rate-limit#example-of-how-to-use-cursor-python

1 Like

Thanks :slight_smile:

Hey! Did you manage to figure this out in the end? I’m having the same issue currently

What is your issue exactly? You won’t be able to get around the max limit of 100.