GhostMarket
Search
K
Comment on page

Refreshing Metadata

If you update NFT metadata, this API endpoint triggers an update of the GhostMarket metadata database.
GhostMarket indexes and caches NFT metadata, so it can be quickly and efficiently retrieved without requiring multiple accesses of the blockchain RPC nodes.
If you update the metadata manually, it may be necessary to force a refresh of our cached metadata.
To do this, use the refreshMetadata API endpoint, specifying the chain, contract and tokenId params as required.
https://api.ghostmarket.io/api/v2/refreshMetadata
Request method has to be a PATCH, with the following data
data : {chain: "n3", contract: "0xaa4fb927b3fe004e689a278d188689c9f050a8b2", tokenId: "QzAyMzY2"}
  • See the Blockchain Short Name table for the list of supported chain names.
  • The tokenId is the token id specifying the NFT within the collection (NFT contract)
Example:
curl -X PATCH 'https://api.ghostmarket.io/api/v2/refreshMetadata' \
-d 'data : {"chain": "n3", "contract": "0xaa4fb927b3fe004e689a278d188689c9f050a8b2", "tokenId": "QzAyMzY2"}'
200: Success Response
{ "success": true } // Metadata successfully Updated
200: Error Responses
{"error":"Could not find an NFT with token ID XXXXXX"} // ID not existing on server
{"error":"NFT was queued in the last 24h, please wait."} // Metadata refresh is already pending
{"error":"Unsupported value for 'chain' parameter."} // Non-Existent chain name passed
{"error":"Could not find a contract with hash 0xyyyyyyyyyyyyyyy"} //Non-existent contract address passed