Sync NFT MetaData

How often does Moralis sync MetaData? Is it possible to force a sync? The reason I am asking is because the data is outdated.

There are millions of NFTs across the different blockchains that Moralis supports. The vast majority of NFTs never change metadata, therefore Moralis doesnā€™t currently re-sync metadata. This is something we may do in the future!

In the near future we will add a way for you to trigger metadata re-sync on a specific token. We know that this feature is important when you develop your NFT and you may be experimenting with different metadata and update it often during the development of your app.

Join our Discord to be updated when this feature is released!

If you really want us to add the auto re-sync feature - add it or upvote it here: https://roadmap.moralis.io/b/feature-requests/

I seeā€¦ then this will not support my use case. I need a total resync of a whole collection

1 Like

Does the CloudFunction have access to any library that can read MetaData directly from the chain, without fetching from the Moralis cache?

Thereā€™s a resync feature now I think, you can try to run the web3 API `/nft/{address}/{tokenId}/metadata/resync

1 Like

you can read data directly from chain from a cloud function too, you can use runContractFunction or web3 directly

Nice, what are the prospects of getting a sync feature for the entire address, so we donā€™t need to do one by one?

1 Like

you mean like for the whole wallet address? I donā€™t think thatā€™s possible now, just individual NFTs

Ah ok. Then I need to loop thru them all to update themā€¦

If the cached metadata of an entire collection is outdated, would it not be beneficial that your API loops them rather than me having to make individual calls for each one to make it right? You know its quite common for projects to ā€œrevealā€ the metadata at a later stage, so this means that the metadata is often wrong in your cache if retrieved before revealā€¦

Yes, but for OpenSea collections this is not true.

For now this is the api endpoint that we have

1 Like

Gotcha! Thanks for considering :grinning:

I canā€™t find information the Cost ā€œx requestsā€ for using

`/nft/{address}/{tokenId}/metadata/resync

?

Hi! Check the response headers

I am doing

await Moralis.Web3API.token.reSyncMetadata

I donā€™t see any headers. I must say this is a weakness in the documentation :slight_smile:

Did you look in your browser network tab for that specific request?

I think that you can call it twice per minute.

I see, I am running it as a cloud function. 2 per minute? I give up on this use case for resyncing an OpenSea collection. I think I will just have to build up a parallell database and call etherscan API and then IPFS direct.

This isnā€™t true at all. A non trivial number of projects use reveal mechanics as part of their NFT project. In some cases it may be possible to actually inspect whether the project metadata has been frozen or not. In any event, this is a significant limitation for anyone using API. Adding a contract sync (or wallet) rather than individual NFT would be a good start.

Also, it seems like a re-sync does pickup new metadata but the token_uri remains the same. Is this by design?

1 Like

Ability to re-sync an entire collection would be a dream come true. :sunglasses:

1 Like