The Web3 API sometimes returns no data for certain tokens in ERC1155 contracts (example given)

I first noticed this error when the /{wallet_address}/nft/{contract_address} endpoint (get all NFTs of a given contract owned in a wallet) was returning a lower number of NFTs owned in a wallet than reality. I narrowed it down to find a couple that were not being returned in this endpoint, and tried accessing them individually through the /nft/{contract_address}/{token_id} endpoint (get an NFT from a specified contract and specified token number) and found that it just was returning absolutely nothing, just an empty JSON response body: {}. I have not observed this on ERC721 tokens, only ERC1155.

It’s as if the API cannot even access these specific ones, for some unknown reason. Here an example of one:
Contract address: 0xd7b397edad16ca8111ca4a3b832d0a5e3ae2438c
Token: 421
URL to return empty JSON response:
https://deep-index.moralis.io/api/v2/nft/0xd7b397edad16ca8111ca4a3b832d0a5e3ae2438c/421?chain=eth&format=decimal

Change the token number and you will see what is supposed to come back. Any idea what’s going on here?

1 Like