NFT metadata is wrong

332 NFTs are returned when running this endpoint:

However the metadata of several items are NULL. For example for NFT with Token ID 195:

      "token_address": "0x9ada21a8bc6c33b49a089cfc1c24545d2a27cd81",
      "token_id": "195",
      "amount": "1",
      "contract_type": "ERC721",
      "name": "Project Godjira Genesis",
      "symbol": "PGG",
      "token_uri": "",
      "metadata": null,
      "synced_at": "2022-03-07T07:20:29.657Z"

However it does have metadata. See here:

Or examine the TokenURI:

This seems to be a general problem with many NFT collections queried with the Moralis API.

Resyncing it should fix it I believe.

I only use the token_uri (where that metadata originally comes from) and parse through it if I want metadata, using the returned metadata is too inconsistent.

@glad do you have any code snippet to share on all the fringe cases of parsing the metadata?

Sure; the following is an example using a response from the GetNFTs endpoint.

const metadata = (item) => {

    const response = await axios.get(item.token_uri).catch((err) => {
      if (err.code == 'ENOTFOUND') console.log(err);
   // metadata

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