getAllTokenIds not returning all token ids

Hey all :wave: I’m looking to collect all the metadata for each token in an NFT collection. The following code works wonders, but unfortunately it doesn’t seem to return the full 10,000 NFTs in the collection. Rather, it only returns 9,967, so there are 33 NFTs missing in the response. Could this be a slow indexing issue on Moralis’s end? If so, is there any way to expedite the indexing?

const options = { address: "0xb195991d16c1473bdF4b122A2eD0245113fCb2F9", chain: "matic", offset: 9500 };
const NFTs = await Moralis.Web3API.token.getAllTokenIds(options);
/**
{
    page: 19
    page_size: 500
    result: (467) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, …]
    total: 9967
}
*/

Thanks in advance <3,
shando

1 Like

it looks like these are the IDs that are missing:

missing 5362
missing 7616
missing 7617
missing 7618
missing 7619
missing 7620
missing 7621
missing 7622
missing 7623
missing 7624
missing 7625
missing 7626
missing 7627
missing 7629
missing 7630
missing 7631
missing 7632
missing 7633
missing 7634
missing 7635
missing 7636
missing 7637
missing 7638
missing 7639
missing 7640
missing 7641
missing 7642
missing 7645
missing 7646
missing 7647
missing 7648
missing 7649
missing 7651
missing 7653
missing 7655
missing 7659
1 Like

thanks for reporting, we will investigate

1 Like

Hey cryptokid, any update on the missing token ids? I also have noticed now that when I iterate through the getAllTokenIds calls to fetch all 10,000, I’m getting a 504 response code at the 1,000 mark.

1 Like

It looks like all the token ids are now present, the problem that you have may be because of rate limiting, you could add a sleep/delay of 1 second between your requests