[SOLVED] Any endpoint where you can query for multiple token Id's in one request?

This endpoint https://docs.moralis.io/reference/getnfttokenidowners-2 only allows one token id for a contract address per request . Can we query for more token id’s for a single contract address ?

eg

await Moralis.start({
                apiKey: config.moralis_api_key,
                // ...and any other configuration
            });
            return await Moralis.EvmApi.token.getNFTbyTokenId({
                address,
                chain,
                [array of token id's]

            });

You will need to make a separate request for each address + tokenId. Otherwise you can use getNFTOwners for all owners.

getNFTOwners returns only 100 owners not all of them .

Separate request for each address + tokenId drains monthly quota quickly .

You can use pagination with cursor to list all of them

Thanks . Missed that part

1 Like

@alex @cryptokid In getNFTOwners some tokens have multiple owners
eg 0x495f947276749ce646f68ac8c248420045cb7b5e contract’s token_id 90315715778416539938901704632522478612295194517831972486146844735929808060426 has 0xb933d690235a572f398a381a0c802304f31edc1f and 0xc7ace234b0bdce7529666dae6055b3bfa7b84aa2 as owners . Is it because they are fractional NFT’s OR getNFTOwners lists them as owners even after transfer of ownership ? https://docs.moralis.io/reference/getwalletnfts-2 endpoint also shows tokenid 90315715778416539938901704632522478612295194517831972486146844735929808060426 having owners both 0xc7ace234b0bdce7529666dae6055b3bfa7b84aa2 and 0xb933d690235a572f398a381a0c802304f31edc1f

1 Like

In this particular case it is because it is a fractional NFT (ERC1155) and one address has 1 and the other address has 9.

1 Like

@cryptokid So I thought . Thanks .
@cryptokid @alex Improvement suggestion - please provide an offset parameter so we can make requests async . Right now I have to wait for a query to finish to get the cursor . Or is something like offset there already ? It’s not mentioned in the docs .

this endpoint has ranges functionality, https://docs.moralis.io/reference/getcontractnfts-2

but it doesn’t help you as it is a different endpoint

1 Like