2

I have recently purchased an NFT on Opensea:

https://opensea.io/assets/0x495f947276749ce646f68ac8c248420045cb7b5e/35392070563509681805150427162397186746015806770332227833352734069616516530177

I am keen to explore the Metadata - in particular extracting the image URL from the Metadata (which I believe is stored on Googles cloud platform).

If I view the contract (https://etherscan.io/tx/0xcf4a0a69f727380f9716fbe243f0a4b63da5bd9e3933cdbb6ff02bd4fe9221ee), I was expecting to see the URL in the metadata, however I can only see a hashed set of input data.

I believe that it is possibly because I am looking at the transaction, rather than the underlying contract, but I cannot figure out how to view the original ERC721 contract from the Etherscan page? All roads seem to lead to this page which I believe is the main Opensea contract: https://etherscan.io/address/0x495f947276749ce646f68ac8c248420045cb7b5e

2
  • Were you able to figure out how to get the metadata? I have the same question. Aug 31, 2021 at 7:18
  • @stochasticcrap no!
    – Mr T
    Sep 14, 2021 at 18:03

1 Answer 1

3

There may be a way to retrieve the metadata through Etherscan but because of the broadness of the space of possible Ethereum contracts (effectively infinite), Etherscan really only provides the most raw representation of contracts/tokens/transactions/etc. either as the EVM bytecode or the source code of the contract. Also it looks like the contract for the linked NFT is actually a ERC-1155 rather than a ERC721 contract.

enter image description here

For Opensea contracts, by far the easiest and most reliable way to get any information is to use their API (which they provide a convenient browser explorer for): https://docs.opensea.io/reference/retrieving-a-single-asset

Opensea API explorer

It looks like for the NFT you linked the relevant image urls are:

{ 
  ...,
  "image_url": "https://lh3.googleusercontent.com/YNu5EBZXJQKIaynTrm6M1QeJwJaGkmLVYZ-4DmfGcySEuV-SHM9B0xqdDR5ij6D9yiPUgdH7rGSTfTGjgURoaMHLSr5AG9-MIVCk3g",
  "image_preview_url": "https://lh3.googleusercontent.com/YNu5EBZXJQKIaynTrm6M1QeJwJaGkmLVYZ-4DmfGcySEuV-SHM9B0xqdDR5ij6D9yiPUgdH7rGSTfTGjgURoaMHLSr5AG9-MIVCk3g=s250",
  "image_thumbnail_url": "https://lh3.googleusercontent.com/YNu5EBZXJQKIaynTrm6M1QeJwJaGkmLVYZ-4DmfGcySEuV-SHM9B0xqdDR5ij6D9yiPUgdH7rGSTfTGjgURoaMHLSr5AG9-MIVCk3g=s128",
  ...
}

Your Answer

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

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