NFT objects return null values for metadata and token_ui fields

The NFT token object consistently returns null values for metadata and token_uri fields when fetching NFT data using Moralis API and SDK.

Example: This NFT is fully visible on the Opensea website and full data available on the Opensea API

But when using the Moralis API to fetch the same NFT using this request

curl -X 'GET' \
  'https://deep-index.moralis.io/api/v2/nft/0xec8ae6851e02e3679c3f60af72251ed54243b912/12?chain=eth&format=decimal' \
  -H 'accept: application/json' \
  -H 'X-API-Key: <removed token>'

The response object that is returned contains null values for metadata and token_uri

{
  "token_address": "0xec8ae6851e02e3679c3f60af72251ed54243b912",
  "token_id": "12",
  "amount": "1",
  "owner_of": "0x6a9ab67aa546e518883a5f2913d4ce230436a18d",
  "block_number": "13709983",
  "block_number_minted": "13709983",
  "contract_type": "ERC721",
  "name": "Kmotion",
  "symbol": "PUKS",
  "token_uri": null,
  "metadata": null,
  "is_valid": 0,
  "syncing": 0,
  "synced_at": null,
  "frozen": 0
}

This issue is occurring consistently for all NFTs I have tried including on testnet networks such as Rinkeby and Ropsten.

It is affecting the Moralis Web API, the Moralis Javascript SDK, and the react-moralis library.

Similar issues have also been reported in the last few days:
update-on-several-issues-web3-api

After speaking with Crypto Kid and Ivan on Tech in Discord, I believe this issue might be a bug related to the data indexing on the Moralis platform.

Thank you

Some more similar topics posted in this forum:




1 Like

I am also having this exact same issue. When I try to utilize the documentation from the Moralis docs, I’m getting null fields for metadata and token_uri

Currently I’m using this to get all of the NFTs for a specific contract address and user wallet address:

(note: I have replaced the actual values with placeholder text. Assume the actual values return results)

const options = { 
       chain: 'rinkeby',
       token_address: '<contract-address>',
       address: '<user-wallet-address>'
};
const tokenIdMetadata = await Moralis.Web3API.account.getNFTsForContract(options);

And then I get back a response that looks like this (I have replaced some of the actual values with placeholder ones, but the key ones to look at are token_uri and metadata). Previously, at least one of these were populated, but now, none of them.

{
     token_address:	"<token_address>"
     token_id:	"734"
     amount:	"1"
     owner_of:	"<address>"
     block_number:	"123456"
     block_number_minted:	"1234567"
     contract_type	"ERC721"
     name:	"TestNFTProject"
     symbol:	"TNP"
     token_uri:	null
     metadata:	null
     is_valid:	0
     syncing:	0
     synced_at:	null
     frozen:	0
}

I thought maybe there was something wrong with that specific API endpoint, so I tried using another function found in the Moralis documentation:

const tokenIdMetadata = await Moralis.Web3API.token.getTokenIdMetadata(options);

^ I ran into the same thing. All the metadata and token_uri fields were null

I suppose all we can do is wait for the devs to fix this?

Thanks for detailed reports!
We are on it

2 Likes

Hello, is there any update on this?

Does the team know what the cause of the issue is yet? Is there any ETA on its fix yet?

Please keep the community updated. @ivan

Thank you

the original example it is fixed now, do you have other examples that don’t work now?

Well the metadata is still empty for me. I use getAllTokenIds. But I do get the token_uri, so I just call the json file with getJSON.

As demonstrated by the amount of different people and examples showcasing missing metadata and token_ui, this problem is not isolated to a single nft asset and it is not scalable to assume it can be fixed by individually indexing each asset as it is reported.

The problem seems to be related to the underlaying indexing process, which affects many assets/all assets.

In my case, I run a public service which fetches all NFTs for a given logged in users wallet address. It is impossible for me to give example of all users who use my service. And my service cannot rely on the Moralis team to individually index each asset on a case by case scenario. It just isn’t scalable.

I hope this information helps you investigate further.

Thank you @ivan and @cryptokid

We are working on fixing the general problem and not specific cases.

Experiencing the same issue, no way to get the metadata for my NFTs on Rinkeby processed. On the other hand, it is working fine in Mumbai: https://ytvideonft.rhizomik.net

Any updates on this?

it should be better now, at least for the part with missing token_uri, do you still have examples with missing token_uri?

For instance https://okzklqhsc13g.usemoralis.com:2053/server/functions/getAllTokenIds
with payload:
{
“chain”: “0x4”,
“address”: “0x8220f2F8A7ACA053100fd16f23C2D79B809C555E”
}

Getting all 6 NFTs with token_uri but 4 out of 6 with null metadata.

Hi, I believe I have the same / similar issue. token_uri is fine but metadata is empty on some NFTs in the collection (testing on rinkeby). For example this call: https://deep-index.moralis.io/api/v2/nft/0x037fd39fdf087c3155ccea646bc5d7e6253788eb?chain=rinkeby

Has one where metadata is showing, one where it’s not (they were all created in the same way).

This one is fine:

        {
            "token_address": "0x037fd39fdf087c3155ccea646bc5d7e6253788eb",
            "token_id": "7",
            "amount": "1",
            "contract_type": "ERC721",
            "name": "TestPurpleGladiators",
            "symbol": "TPGGGP",
            "token_uri": "https://ipfs.moralis.io:2053/ipfs/QmZ2WK8LENc9EK1YGKEjoafoQDS4tpTRajhMSSFRG5FFH2/7.json",
            "metadata": "{\n  \"name\": \"All Vikings Must Die (Test - Eyes) #7\",\n  \"description\": \"This is the All Vikings must Die collection (test eyes)\",\n  \"image\": \"ipfs://QmX3WUe63xXmyhBadXjVaTQBifoPXXrNTQtcvRb8nTgjeT/7.png\",\n  \"dna\": \"cfa27eeba852b5a1cc1b861892aa36c65b2df024\",\n  \"edition\": 7,\n  \"date\": 1639124478515,\n  \"attributes\": [\n    {\n      \"trait_type\": \"Background\",\n      \"value\": \"Black\"\n    },\n    {\n      \"trait_type\": \"Eyeball\",\n      \"value\": \"White\"\n    },\n    {\n      \"trait_type\": \"Eye color\",\n      \"value\": \"Yellow\"\n    },\n    {\n      \"trait_type\": \"Iris\",\n      \"value\": \"Small\"\n    },\n    {\n      \"trait_type\": \"Shine\",\n      \"value\": \"Shapes\"\n    },\n    {\n      \"trait_type\": \"Bottom lid\",\n      \"value\": \"Middle\"\n    },\n    {\n      \"trait_type\": \"Top lid\",\n      \"value\": \"Middle\"\n    }\n  ],\n  \"compiler\": \"HashLips Art Engine\"\n}",
            "synced_at": "2021-12-11T08:34:40.859Z"
        },

This one is not:


{
            "token_address": "0x037fd39fdf087c3155ccea646bc5d7e6253788eb",
            "token_id": "6",
            "amount": "1",
            "contract_type": "ERC721",
            "name": "TestPurpleGladiators",
            "symbol": "TPGGGP",
            "token_uri": "https://ipfs.moralis.io:2053/ipfs/QmZ2WK8LENc9EK1YGKEjoafoQDS4tpTRajhMSSFRG5FFH2/6.json",
            "metadata": null,
            "synced_at": "2021-12-11T20:12:27.520Z"
        },

When I fetch the ones in my test wallet, it shows is_valid: 0 for those (https://deep-index.moralis.io/api/v2/0xb2E74822d0105C42B1E889c1031c024981E6E2d3/nft?chain=rinkeby). For example:

        {
            "token_address": "0x037fd39fdf087c3155ccea646bc5d7e6253788eb",
            "token_id": "4",
            "block_number_minted": "9789948",
            "owner_of": "0xb2e74822d0105c42b1e889c1031c024981e6e2d3",
            "block_number": "9789948",
            "amount": "1",
            "contract_type": "ERC721",
            "name": "TestPurpleGladiators",
            "symbol": "TPGGGP",
            "token_uri": "https://ipfs.moralis.io:2053/ipfs/QmZ2WK8LENc9EK1YGKEjoafoQDS4tpTRajhMSSFRG5FFH2/4.json",
            "metadata": null,
            "synced_at": "2021-12-13T23:42:33.350Z",
            "is_valid": 0,
            "syncing": 2,
            "frozen": 0
        },

Same issue exists for this collection as well (which was also apparently compiled by Hashlips art engine) https://deep-index.moralis.io/api/v2/nft/0xcc14dd8e6673fee203366115d3f9240b079a4930?chain=rinkeby

https://docs.moralis.io/misc/faq#why-is-metadata-null-for-some-nfts