Search code examples
nftmarketplaceopensea

Why NFT marketplace such as OpenSea can get all nft contracts?


I am currious of why Opensea can get all NFT contract information from blockchain? Not only does Opensea, but all the NFT marketplaces. I know that there are APIs from Etherscan or Polygonscan, but I don't find an API which returns all the contract addresses or token names. Or they just contact with Etherscan and get a private API for that fucntion? Are there any web3 experts can help with my question?

Thank you


Solution

  • As per the ERC-721 and ERC-1155 standards, when a contract is minting or transferring NFTs, it needs to emit an event.

    Marketplaces listen to these events containing collection addresses and token IDs. Combined with another set of standardized functions implemented by the collection contracts, and standardized metadata file format, they are able to automatically retrieve information about:

    • newly minted NFTs
    • their metadata files
    • their image files, name, description, and other attributes

    and store this information in their own database.