Skip to main content

Resync NFT metadata

GEThttps://deep-index.moralis.io/api/v2/nft/:address/:token_id/metadata/resync

Resync the metadata for an NFT

  • The metadata flag will request the NFT's metadata from an already existing token_uri
  • The uri (default) flag will fetch the latest token_uri from the given NFT contract address. In sync mode the metadata will also be fetched
  • The sync mode will make the endpoint synchronous so it will wait for the task to be completed before responding
  • The async mode (default) will make the endpoint asynchronous so we will wait for the task to be completed before responding
PATH PARAMS
addressstringrequired
The address of the NFT contract
token_idstringrequired
The ID of the token
QUERY PARAMS
chainstring
The chain to query
flagstring
The type of resync to operate
modestring
To define the behaviour of the endpoint
Responses
API KEY
import Moralis  from 'moralis';
import { EvmChain } from '@moralisweb3/evm-utils';

try {
const chain = EvmChain.ETHEREUM;

const address = '0x1234567890123456789012345678901234567890';

const tokenId = 1;

await Moralis.start({
apiKey: 'YOUR_API_KEY',
// ...and any other configuration
});

const response = await Moralis.EvmApi.nft.reSyncMetadata({
address,
chain,
tokenId,
});

console.log(response?.result);
} catch (e) {
console.error(e);
}

Response Example