How to view and download an NFT on the blockchain

How to view and download an NFT on the blockchain

If you recently bought an NFT, you may be wondering where exactly that NFT is stored. Exchanges like OpenSea display the NFT image and other information about the NFT like its name, ID, and attributes, but where does OpenSea gather this information?

When an NFT project mints (creates) an NFT, a contract adds metadata about that NFT to the blockchain.

This post will teach you how to look up the details about an NFT directly on the Ethereum blockchain. You will do this by interacting with an NFT project's Ethereum contract.

When you finish reading, you will understand how NFT projects and artists store information about an NFT and how to download the highest quality image of your NFT possible directly from the blockchain.

How to read an Ethereum NFT contract

Step 1: Find the contract address

First, you will need to locate the Ethereum contract address of your NFT. The easiest way to do it is to look it up on OpenSea.

How to find a contract address on OpenSea

  1. Go to your NFTs listing page on OpenSea. (Like this example)
  2. Click the Details dropdown
  3. Click the link in the Contract Address field

Clicking the contract address will take you directly to the contract on EtherScan, which is where we want to go. Although this is the easiest method, you can also usually find the contact address of an NFT project on the project's website, Twitter, or Discord.

The contract address is a long alphanumeric value like:

0x8943C7bAC1914C9A7ABa750Bf2B6B09Fd21037E0

You can take this value and enter it directly into the search field on EtherScan to go to the contract.

Step 2: Find the Token ID

The token ID is also in the Details area on OpenSea right below the contract address.

Step 3: Write the contract

After clicking the contract address link in OpenSea, you should now be on Etherscan. The page should look similar to this contract for Lazy Lions. :

https://etherscan.io/address/0x8943c7bac1914c9a7aba750bf2b6b09fd21037e0

Etherscan is a blockchain explorer that allows you to view transactions on the Ethereum blockchain and interact with contracts directly.

If you scroll down a bit, you should see a table displaying Transactions. Click the Contract tab.

Then click Read Contract.

Then find a field called tokenURI. Enter your Token ID in this field then click Query.

The contract should generate a URI that looks like a URL for a website.

In the above example, the Lazy Lions URI is:

https://www.lazylionsnft.com/api/2862

Copy this URI and paste it into your browser's address bar, and press Enter.

Step 4: Read the NFT metadata

You should now see a JSON output of your NFT metadata. JSON is a way to organize information for coding. The output should look something like this:

{"name":"#2862","tokenId":2862,"image":"https://gateway.pinata.cloud/ipfs/Qme6rBzYrvv2rnXBbv1dbjCvjEs3Mu4PgafMs6eyCkaxw4","external_url":"https://www.lazylionsnft.com/","attributes":[{"trait_type":"Background","value":"Adamant"},{"trait_type":"Body","value":"Pink"},{"trait_type":"Bodygear","value":"Ethereum Shirt"},{"trait_type":"Earring","value":"Nothing"},{"trait_type":"Eyes","value":"Raised Eyebrow"},{"trait_type":"Headgear","value":"Nothing"},{"trait_type":"Mane","value":"Top Knot - Ice"},{"trait_type":"Mouth","value":"Yawning"}]}

You can drop this into a JSON pretty print tool to make it easier to read.

Now you can view all the information stored on the Ethereum blockchain about your NFT! In the example above you can see that the lion

Has a pink body: {"trait_type":"Body","value":"Pink"}

Is wearing an Ethereum shirt: {"trait_type":"Bodygear","value":"Ethereum Shirt"}

Is yawning: {"trait_type":"Mouth","value":"Yawning"}

But most importantly, we can also download the highest quality image available directly from the project's contract on the Ehtereum blockchain.

How to download an NFT image

You can find the image of an NFT in the NFT's tokenURI. In the JSON metadata output, you should see an image value that links directly to the NFT image.

In our example tokenURI the image value is:

https://gateway.pinata.cloud/ipfs/Qme6rBzYrvv2rnXBbv1dbjCvjEs3Mu4PgafMs6eyCkaxw4

Navigating to this image will open a majestic Lazy Lion. You can download the image by right-clicking on the image and saving the image on your computer.

You know now how to:

  • Find the Contract Address of your NFT
  • Find the tokenID of your NFT
  • Read an NFT contract
  • View the metadata of an NFT directly on the Ethereum blockchain
  • Download the highest-quality version of an NFT image from the blockchain
Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Ad Tech Explained.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.