[SOLVED] The number of unique owners is off by a lot

Hi everyone ,

I’m using this endpoint https://deep-index.moralis.io/api/v2/nft/{address}/owners from the Moralis API.
My objective is to get the number of unique owners of this collection. I usually get the right number, but it seems for this particular contract address: 0x0e1f990d264a9818460dde1b81c0b04d8a88e751 the figures are always off.

I am currently getting 5774 unique owners, when it should be 7498 as shown here: https://etherscan.io/token/0x0e1f990d264a9818460dde1b81c0b04d8a88e751.

Can someone help me?

For https://deep-index.moralis.io/api/v2/nft/0x0e1f990d264a9818460dde1b81c0b04d8a88e751/owners?chain=eth, I am getting 8005 total owners (“Get all owners of NFTs within a given contract”). Can you try it again?

To get the number of unique owners from the total results of 8005, you would need to filter all the results to only get unique owners based on owner_of value.

Hi,
Thank you for checking. Yes, I can see 8005 as well. But when I try and get unique owners I get 5774. In reality it needs to be 7498, as shown in etherscan.
https://etherscan.io/token/0x0e1f990d264a9818460dde1b81c0b04d8a88e751

Screenshot from 2022-09-29 10-39-16

that is an ERC1155 token, it will not be easy to see where is the issue, etherscan is not always right either

I was investigating and found out a few things:

  1. Alchemy returns the correct value of 7497
  2. Moralis also shows the correct value when iterating through each token ID in the contract address and using the getNFTTokenIdOwners API. After adding the results for all token IDs, the number of unique users was 7497.
  3. I took a wallet that Alchemy identified as holder, but missing from the Moralis API. Then, I used another Moralis’ API (getWalletNFTs) to see what NFTs this wallet is holding, out of curiosity. Interestingly. I can see that they are holding the contract address in question. So there seems to be a bug in the getNFTOwners API.
1 Like

we expect this to be fixed tomorrow, thanks for reporting

2 Likes

this should be fixed now

2 Likes

Confirming on my end that this has been resolved as well.
Thank you!

1 Like

Epic turnaround time on this one @cryptokid, appreciate you!

1 Like