refreshNftMetadata - SDK
Refreshes the cached metadata for a provided NFT contract address and token id. Returns a boolean value indicating whether the metadata was refreshed.
Don’t have an API key?
Start using this method in your app today. Get started for free
Please note that this endpoint is only supported on Ethereum (Mainnet & Sepolia), Polygon (Mainnet, Mumbai & Amoy), Arbitrum One (mainnet) & Optimism (mainnet)
For other chains, you could use the getNFTMetadata endpoint with the refreshCache
parameter set to true to refresh the metadata!
Description
Refreshes the cached metadata for a provided NFT contract address and token id. Returns a boolean value indicating whether the metadata was refreshed.
This method is useful when you want to refresh the metadata for an NFT that has been updated since the last time it was fetched.
Note that the backend only allows one refresh per token every 15 minutes, globally for all users. The last refresh time for an NFT can be accessed on the Nft.timeLastUpdated
field.
To trigger a refresh for all NFTs in a contract, use refreshContract instead.
Parameters
Response
Example Request and Response
Prerequisite: You will need to install the Alchemy SDK before making requests with it.
The commands for installing it using npm or yarn are given below:
Request
Response
Use Cases
Here are some potential use cases for the refreshNftMetadata
method:
-
Up-to-Date NFT Information: NFT metadata, such as images, descriptions, and attributes, can change over time. By refreshing the metadata, developers ensure that their application displays the most current and accurate information about the NFT, enhancing the user experience.
-
Correcting errors: Sometimes errors can occur in the metadata associated with an NFT. For example, the wrong image may have been uploaded or the description may contain a typo. The
refreshNftMetadata
method can be used to correct these errors. -
Improving NFT marketability: The metadata associated with an NFT can significantly impact its marketability. By updating the metadata, NFT owners can improve the chances of their NFTs being sold or traded.
Related Methods
Here are some methods that are similar to the refreshNftMetadata
method:
- refreshContract - Triggers a metadata refresh of all NFTs in the provided contract address.