No metadata found for some NFTs

I’ve been integrating the moralis API’s into a project but ran into a snag where it couldn’t return the metadata. I’m using the /nft/{address}/{id} endpoint like this

https://deep-index.moralis.io/api/v2/nft/0xcdFea41c4A8e70Fb4838426069483dC50cbf5041/3926?chain=matic&format=decimal

With this I get a correct response for every id until 671 which gives the response “No metadata found! Try again later”. Meanwhile there are NFT’s out there which have a much higher ID (like this one).

Is this a limitation of the API? Or is there something else I’m missing?

Try resyncing the metadata for it if you get that particular response or error - is the metadata field for 671 empty in the response? Web3API.token - Moralis

Otherwise fetch the token_uri and get the metadata manually.

When trying I get the response below, I’ll have a look into resyncing.

{
“message”: “No metadata found! Try again later”
}

did you try to resync the uri or only the metadata?

you can try to resync the uri first, then check if that uri works/is available.

I’ve attempted resyncing the metadata using the APIs below. I’ve also used the

https://deep-index.moralis.io/api/v2/nft/{address}/{id}/metadata/resync?chain=matic&flag=metadata&mode=async
https://deep-index.moralis.io/api/v2/nft/{address}/sync?chain=matic

Both return a success code so the requests whent through. After this the original requests still returns the same reply.

Which API is used to fetch the token URI?

you can go to this page: https://admin.moralis.io/web3Api

and select uri, and will result this: https://deep-index.moralis.io/api/v2/nft/1241241244/1312312/metadata/resync?chain=eth&flag=uri&mode=sync

1 Like

I’ve used https://deep-index.moralis.io/api/v2/nft/{address}/{id}/metadata/resync?chain=eth&flag=uri&mode=sync it gives the following message: { "status": "The metadata could not be updated! Try again later" }

ok, what is the token uri for that nft?

It looks like this:

{
    "name": "Encode Bronze Key",
    "description": "Encode Bronze Key\n\n** Disclaimer ** Before purchase please ensure you check what Comic Books this key has claimed, the tool to check this is available at https://encode.network",
    "image": "https://enc-cbg.mypinata.cloud/ipfs/QmQdJLmXseBonCJe7qEShLDKBknLVXrP7Hv95BVV85ci84",
    "level": "BRONZE_LEVEL",
    "animation_url": "https://enc-cbg.mypinata.cloud/ipfs/Qmaptgxi4gFAqHdaDX6dGj4NmyAiD3nc13uEDJm6PhZoqE"
}

this looks lie metadata, what is the url that points to this metadata?

The URL is https://enc-cbg.mypinata.cloud/ipfs/bafkreiajbpvdi4srxjszzyu24gtbb3yr4z2sbnbjqvukr3yxlvyfqgiyke which I got from the API https://deep-index.moralis.io/api/v2/nft/0xcdFea41c4A8e70Fb4838426069483dC50cbf5041/1?chain=matic which returns the meta data for the token. The whole response is below:

{
    "token_address": "0xcdfea41c4a8e70fb4838426069483dc50cbf5041",
    "token_id": "1",
    "block_number_minted": "22632938",
    "owner_of": "0x012b623a1d2f05e2da7e9256c6d7b045b4d474c6",
    "block_number": "22632938",
    "amount": "1",
    "contract_type": "ERC721",
    "name": "EncodeKeys",
    "symbol": "ENCK",
    "token_uri": "https://enc-cbg.mypinata.cloud/ipfs/bafkreiajbpvdi4srxjszzyu24gtbb3yr4z2sbnbjqvukr3yxlvyfqgiyke",
    "metadata": "{\"name\":\"Encode Bronze Key\",\"description\":\"Encode Bronze Key\\n\\n** Disclaimer ** Before purchase please ensure you check what Comic Books this key has claimed, the tool to check this is available at https://encode.network\",\"image\":\"https://enc-cbg.mypinata.cloud/ipfs/QmQdJLmXseBonCJe7qEShLDKBknLVXrP7Hv95BVV85ci84\",\"level\":\"BRONZE_LEVEL\",\"animation_url\":\"https://enc-cbg.mypinata.cloud/ipfs/Qmaptgxi4gFAqHdaDX6dGj4NmyAiD3nc13uEDJm6PhZoqE\"}",
    "synced_at": "2022-03-17T16:53:17.403Z",
    "is_valid": 1,
    "syncing": 2,
    "frozen": 0
}

and you try to resync the metadata for that specific token id 1 from 0xcdFea41c4A8e70Fb4838426069483dC50cbf5041 because it is not the correct one?

The API works fine for tokens with id 1 to 670. I’m having issues with tokens that have an id greater than 670. So I’ve tried re-syncing number 671 with index.moralis.io/api/v2/nft/{address}/{id}/metadata/resync?chain=matic&flag=uri&mode=sync
So that would give https://deep-index.moralis.io/api/v2/nft/0xcdFea41c4A8e70Fb4838426069483dC50cbf5041/671/metadata/resync?chain=matic&flag=uri&mode=sync

Trying this will give the response { "status": "The metadata could not be updated! Try again later" }

The metadata / URI is form token 1 as the API to get the data isn’t working for 671, so I couldn’t get the data for that token.

how do you know that token with id 671 exists?

Hmm that’s strange. I was testing my code and wanted to see if it would work on every key level (bronze, silver & gold). So I tested it on this silver key which according to the opensea details has an ID of 3926, which gave the response I mentioned before. I started doing some tests and found that the API only worked on ID’s smaller than 671.

From this I’m guessing the ID mentioned on opensea and those used within the API aren’t the same?

I don’t know what is with that ID, how did you create that NFT?

I didn’t. I’m building on top of it but there seem to be several issues with it.
Looks like I’m either going to need to dig into the contract or contact the original devs :confused:

Have you got solution about this? i faced same issue

I faced this issue you have any solution about this?

In need more info about your specific case. You can create a new forum post for it.