0%
SupportNFT API
How Can I Update the NFTs Metadata Using Alchemy’s NFT API?

How Can I Update the NFTs Metadata Using Alchemy’s NFT API?

Written by Author headshotKilliane Menand
Published on October 1, 20241 min read

If you need to update the metadata for all the NFTs in your contract or for a specific NFT, Alchemy offers methods that allow you to refresh this data easily. Please note that the reingestContract method is being replaced by the new invalidateContract method. Below are the steps you can follow to update your NFT metadata.

To update the metadata for every NFT in your contract, you can use the invalidateContract method. This method will re-fetch and update the metadata for all tokens under the specified contract.

Example invalidateContract Call:

bash
Copied
curl --request GET \ --url 'https://eth-mainnet.g.alchemy.com/nft/v3/docs-demo/invalidateContract?contractAddress=0xe785E82358879F061BC3dcAC6f0444462D4b5330' \ --header 'accept: application/json'

Simply replace the contractAddress parameter with the address of your own contract. For more detailed information, please refer to the API documentation for the invalidateContract method.

If you want to refresh the metadata for just one specific NFT, you can use the getNFTMetadata method with the refreshCache parameter set to true. This will force the metadata to be refreshed for that individual token.

Example getNFTMetadata Call:

bash
Copied
curl --request GET \ --url 'https://eth-mainnet.g.alchemy.com/nft/v3/docs-demo/getNFTMetadata?contractAddress=0xe785E82358879F061BC3dcAC6f0444462D4b5330&tokenId=44&refreshCache=false' \ --header 'accept: application/json'

Replace contract_address with your contract’s address and token_id with the token ID of the specific NFT you want to refresh.

The reingestContract method is being replaced by the invalidateContract method, which offers a more reliable way to update NFT metadata. If you are experiencing issues with reingestContract, we recommend switching to invalidateContract for better results.

For any further questions or issues regarding NFT metadata updates, feel free to reach out to our support team by opening a ticket, and stay tuned for updates as we continue to enhance our API features!

Was this article helpful?
Share:
Banner background image

Not finding what you need?