[SOLVED] Unable to get NFTs for a contract I created

Hey Moralis Team,
Yesterday I created a contract following your course:


I wasnā€™t able to retrieve the info for the two NFTs I created with the contract, thought it might need time to propagate but they still donā€™t show up when I try to get them using the Web3API. Hereā€™s the code:
const options = { chain: 'rinkeby', address: '0x1a1033526811fc1584b591e76c410bb191b22e08' };
const NFTs = await Moralis.Web3API.token.getAllTokenIds(options);
console.log(`Length: ${NFTs.result.length}`)

I should be getting a console output of ā€œLength: 2ā€, but it still returns 0.
Here is a link to an NFT from the contract: https://testnets.opensea.io/assets/0x1a1033526811fc1584b591e76c410bb191b22e08/0
As you can see at ā€œopenseaā€, there are 2 NFTs for the given contract.

I also tried getting the owners of the NFTs from the contract using the Web3 API, but still no result.


Any help is appreciated, thank you in advance :smiley:

1 Like

it looks like Moralis still has some problems in indexing new smart contracts, at least on Rinkeby.

You could try to look in NFTOwners table in your Moralis Server to see if you have that information synced for those NFTs.

Yep, it looks like they were synced in the table today:


If the ā€œgetAllTokenIds()ā€ method queries this table, does it mean that it shouldā€™ve worked or is it something else ?

That method doesnā€™t query that table, but you could use the data from that table now.
You have to do a query in that table.

Alright, thank you for the help and quick replies :smiley:

Iā€™m having the same issue, did you manage to make it work somehow?