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
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:
-
Updating NFT information: NFT owners can use the
refreshNftMetadata
method to update the metadata associated with their NFT. For example, they can update the name, description, image, or other attributes. -
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 have a significant impact on 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.