0

i am new to this world of web3. I scrapped opensea.io TOP NFT collections in mongo and now I want to know is there any web3 method that takes NFT name only and returns metadata.

My collection in mongodb has NFT collection name and image URl and I want to know that if there is any way that I can get metadata from ethereum network using Web3.js or ether.js method.

2 Answers 2

0

You would have to know the contract address of the contract and the token ID to get the tokenURI(metadata url) from the contract. Create a contract instance with the contract address, and call the "tokenURI" method with the token ID toke get the url.

1

To complete Grizzly, Web3 contracts dont save the NFT data, but save the URI. NFT data are commonly saved on IPFS.

If you have the full URI saved then just make the request to it.

If you miss a part of the URI, then as mentioned Grizzly, you must send a request to the contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.