Blockfrost.io Beginner Tutorial | Cardano blockchain viewing NFT — Part 1

Ziyf
2 min readFeb 7, 2022

--

If you don’t want to start or run your own Cardano node as stated in my previous tutorial, there’s another solution.

Blockfrost.io

They will run a node for you and expose APIs to access and process information stored on the Cardano blockchain. The basic tier is free and allows 50,000 requests per day.

In this blog we will learn how to use Blockfrost given APIs to query the Cardano blockchain to get all NFT images from your wallet.

Prerequisites:

  • Free API Key from Blockfrost
  • Postman
  • Wallet you wish to query (stake id)

Getting started:

Whether your are using Yoroi wallet or Nami, click the receiving address which is your wallet address, it should start with addrxxxx

Then go to pool.pm and paste your addrxxx key.

You should see something like this

Here we can see the stakexxx address above the 198 ada. You can also see it in your browser URL tab.

Copy the stakexxx address

View all NFT/tokens in your wallet:

Using postman, have the blockfrost API key in your header.

project_id = BLOCKFROST_API_KEY

Then using GET request

https://cardano-mainnet.blockfrost.io/api/v0/accounts/{stakeID}/addresses/assets

You should get a list of all your assets with units and quantity.

Copy one of the units and then run another GET query:

https://cardano-mainnet.blockfrost.io/api/v0/assets/{unitId}

After getting the result, you should see detailed information about your asset/NFT.

"onchain_metadata": {"name": "Doge image #3749","image": "ipfs://QmcUohJ3AR34hAPr1LAnA9zXXogYJQyMBfmJdC33aaKggF",
....

Now that you have the image URL for IPFS we can fetch the image from the IPFS server.

link here if you don’t know what ipfs is.

GET request to fetch the image.

https://ipfs.io/ipfs/{Qmc….}

TADA you will see your image

Now you can create cool projects such as NFT wallets:

https://github.com/nickoyuan/nft-wallet

In Part 2 we will learn how to mint your own NFT using blockfrost.

Coming soon…

--

--