[SOLVED] NFT token_uri and metadata will not sync for ENS tokens

I am trying to get NFT metadata via the Token API:

 const moralisNft: IMoralisNftMetadata = <IMoralisNftMetadata> await Moralis.Web3API.token.getTokenIdMetadata({
            address: contractAddress,
            token_id: tokenId,
            chain: this.moralisChain

Contract: 0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85
Token Id: 64541599517874338551765946070328721926123343285885017130316322431075400526172
chain: eth
I have tried on opensea, and it works just fine: https://opensea.io/assets/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/64541599517874338551765946070328721926123343285885017130316322431075400526172.

However, from Moralis, the metadata and token_uri always come back as null. To try and fix this, I have tried to use the reSyncMetadata API. I consistently get a 202, indicating that the NFT metadata will be synced, but the results never change. The response from the getTokenIdMetadata API always has token_uri, synced_at and metadata as null, and syncing as 1.

It would be fine if metadata wasn’t syncing by itself, but since token_uri isn’t working either, I can’t even fetch the metadata myself. Please help!

1 Like

ok, got it, this is not a standard nft contract and maybe that is why resync functionality didn’t work.

we will investigate


Alright, thanks! It is an ENS name so even if it’s not standard, it’s probably worth supporting since they’re pretty common :slight_smile:

yes, it is an ENS name, we started to support it but we din’t sync all of them yet

1 Like

@kmistele, this works now:

x = await Moralis.Web3API.token.getTokenIdMetadata({address:"0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", token_id: "64541599517874338551765946070328721926123343285885017130316322431075400526172", chain: "eth"})

for other token ids from ENS you can use resync with uri parameter to resync the metadata

1 Like