NFT MetaData not returned because wrong token_uri

Check out below response msg, no metadata returned because there’s a bug on token_uri.
It should be


curl -X 'GET' \
  '' \
  -H 'accept: application/json' \

part of response

      "token_address": "0x22d5f9b75c524fec1d6619787e582644cd4d7422",
      "token_id": "204",
      "block_number_minted": "25433916",
      "owner_of": "0xc159698c6bd7422a9dbdedc848ff6d35a15fa689",
      "block_number": "27518134",
      "token_hash": "77cabf5efe50032a20e20c14f27ae728",
      "amount": "1000000000000000000",
      "contract_type": "ERC1155",
      "name": null,
      "symbol": null,
      "token_uri": "",
      "metadata": null,
      "synced_at": "2022-04-21T00:15:09.818Z"    },

Token uri is correct. It is the hex form of the 204 number.

Try to resync the metadata with resyncmetadata function.

No one would use hex form of token ID (and with so many 0s ) to name a file of metadata.
Resync did not solve the problem.
Code change must be done about the token_uri assemble.
This is actually a CRITICAL ISSUE.

other similar cases:

"token_uri": ""

what is the exact issue that you thing that is happening here?

hex(204) = 0xcc, that is how ERC1155 token_uri standard works, it uses the hex value in the token uri

I see. You are right. It is recommended to use hex value to replace id in token uri.
What we are doing is to build a NFT exchanging market.
We met several ERC1155 contracts that use dec value in token uri.
We can’t get metadata for these contracts by using moralis NFT API.

can you paste specific contract address and token id where it doesn’t work?
also, if you can extract the token_uri directly from chain for that particular token id and contract

As I posted before:
Contract: 0x22d5f9b75c524fec1d6619787e582644cd4d7422
The actual token uri is:
but not:
Thank you for your replies.
And I understand that this issue is caused by the “incorrect” implementation of ERC1155.
Moralis NFT API works as expected according to the standard of ERC1155.
At the end as a 3rd party NFT marketplace, we have to give up supporting these kind of ERC1155 NFT implementation.

This is the token_uri returned from the contract:{id}.json

You could ask that NFT marketplace to fix the final token uri and after that it should work.

Moralis now supports refresh for all NFTs automatically Moralis Updates NFT Metadata