Skip To Content

Blockdaemon Documentation

NFT Tutorials: Assets

Overview
How to Get NFTs Owned by a Wallet
How to Get All ERC-1155 NFTs Owned by a Wallet
How to Verify That a Wallet Owns an NFT
How to Get All NFTs for a Smart Contract
How to Get NFTs with Given Attributes in a Collection
How to Get All NFTs in a Collection, Sorted by Mint Date
How to Render the Image Associated with an NFT


Overview

Our NFT endpoints support advanced querying options, allowing you to retrieve the exact data you need with a single request.

This page includes short, step-by-step tutorials explaining how to get information on NFT assets in the Ethereum Mainnet network.

All example queries are based on the following endpoint: GET NFT Assets.


How to Get NFTs Owned by a Wallet

This tutorial explains the steps involved in getting a list of Ethereum Mainnet NFTs owned by any given wallet.

Step 1. Use the assets endpoint with the following details:

  • protocol: ethereum
  • network: mainnet
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets

Step 2. Add the following parameter:

  • wallet address
    • parameter: wallet_adderss
    • value: e.g. 0x5682035b6b1D04924C7661b09A974fF0695De6bE
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?wallet_address=0x5682035b6b1D04924C7661b09A974fF0695De6bE

Step 3. Execute the query.

For example, in cURL you should run the following code:

curl -X GET 'https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?wallet_address=0x5682035b6b1D04924C7661b09A974fF0695De6bE' -H 'Authorization: Bearer YOUR_TOKEN'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token.

Step 4. Your results will look something like this example response.


How to Get All ERC-1155 NFTs Owned by a Wallet

This tutorial explains the steps involved in getting a list of Ethereum Mainnet ERC-1155 NFTs owned by any given wallet.
Step 1. Use the collections endpoint with the following details:

  • protocol: ethereum
  • network: mainnet
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets

Step 2. Add the following parameters:

  • wallet address
    • parameter: wallet_adderss
    • value: e.g. 0x5682035b6b1D04924C7661b09A974fF0695De6bE
  • token type
    • parameter: token_type
    • value: ERC1155
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?wallet_address=0x5682035b6b1D04924C7661b09A974fF0695De6bE&token_type=ERC1155

Note: The following token types are also available: ERC20, CRYPTOPUNKS

Step 3. Execute the query.

For example, in cURL you should run the following code:

curl -X GET 'https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?wallet_address=0x5682035b6b1D04924C7661b09A974fF0695De6bE&token_type=ERC1155' -H 'Authorization: Bearer YOUR_TOKEN'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token.

Step 4. Your results will look something like this example response.


How to Verify That a Wallet Owns an NFT

This tutorial explains the steps involved in verifying that a given wallet in the Ethereum Mainnet network owns a given NFT.

Step 1. Use the assets endpoint with the following details:

  • protocol: ethereum
  • network: mainnet
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets

Step 2. Add the following parameters:

  • contract address
    • parameter: contract_address
    • value: e.g. 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D
  • token ID
    • parameter: token_id
    • value: e.g. 9999
  • wallet address
    • parameter: wallet_address
    • value: e.g. 0x46Fd6B647Dc8C82aD8f6cf0CC6b22ACad3f6e39d
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?contract_address=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D&token_id=9999&wallet_address=0x46Fd6B647Dc8C82aD8f6cf0CC6b22ACad3f6e39d

Step 3. Execute the query.

For example, in cURL you should run the following code:

curl -X GET 'https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?contract_address=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D&token_id=9999&wallet_address=0x46Fd6B647Dc8C82aD8f6cf0CC6b22ACad3f6e39d' -H 'Authorization: Bearer YOUR_TOKEN'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token.

Step 4. If the specified NFT is owned by the wallet, the query will return the NFT. Your results will look something like this example response.

If the ownership is not verified, the query will return an empty array:


{
    "data": [],
    "meta": null
}

How to Get All NFTs for a Smart Contract

This tutorial explains the steps involved in getting a list of all the NFTs of any given smart contract in the Ethereum Mainnet network.

Step 1. Use the assets endpoint with the following details:

  • protocol: ethereum
  • network: mainnet
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets

Step 2. Add the following parameter:

  • contract address
    • parameter: contract_address
    • value: e.g. 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?contract_address=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D

Step 3. Execute the query.

For example, in cURL you should run the following code:

curl -X GET 'https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?contract_address=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D' -H 'Authorization: Bearer YOUR_TOKEN'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token.

Step 4. Your results will look something like this example response.


How to Get NFTs with Given Attributes in a Collection

This tutorial explains the steps involved in getting a list of NFTs from any given Ethereum Mainnet collection, filtered by given attributes.

Step 1. Use the assets endpoint with the following details:

  • protocol: ethereum
  • network: mainnet
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets

Step 2. Add the following parameters:

  • collection name
    • parameter: collection_name
    • value: e.g. Bored Ape Yacht Club
  • attribute 1
    • parameter: attributes
    • value: a key:value pair, e.g. Background:Purple
  • attribute 2
    • parameter: attributes
    • value: a key:value pair, e.g. Earring:Gold Hoop
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?collection_name=Bored Ape Yacht Club&attributes=Background:Purple&attributes=Earring:Gold Hoop

Step 3. Execute the query.

For example, in cURL you should run the following code:

curl -X GET 'https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?collection_name=Bored%20Ape%20Yacht%20Club&attributes=Background:Purple&attributes=Earring:Gold%20Hoop' -H 'Authorization: Bearer YOUR_TOKEN'

Notes:

  • To authorize your request, you need to get a Ubiquity API key and use it as a bearer token.
  • Sometimes collection names and attributes contain whitespaces. When using cURL, replace them with %20.

Step 4. Your results will look something like this example response.

The specified attributes will be mentioned in the traits section of the response among other attributes. For example, the query above returns NFTs with purple background and a gold hoop earring:

"traits": [
   {
       "type": "Hat",
       "value": "Army Hat"
   },
   {
       "type": "Background",
       "value": "Purple"
   },
   {
       "type": "Mouth",
       "value": "Bored Unshaven"
   },
   {
       "type": "Earring",
       "value": "Gold Hoop"
   },
   {
       "type": "Fur",
       "value": "Gray"
   },
   {
       "type": "Eyes",
       "value": "Scumbag"
   }
]

How to Get All the NFTs in a Collection, Sorted by Mint Date

This tutorial explains the steps involved in getting a list of all the NFTs in any given Ethereum Mainnet collection, sorted by mint date from the earliest to the latest.

Step 1. Use the assets endpoint with the following details:

  • protocol: ethereum
  • network: mainnet
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets

Step 2. Add the following parameters:

  • collection name
    • parameter: collection_name
    • value: e.g. Bored Ape Yacht Club
  • field to sort by
    • parameter: sort_by
    • value: mint_date
  • sort order
    • parameter: order
    • value: asc
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?collection_name=Bored Ape Yacht Club&sort_by=mint_date&order=asc

Step 3. Execute the query.

For example, in cURL you should run the following code:

curl -X GET 'https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?collection_name=Bored%20Ape%20Yacht%20Club&sort_by=mint_date&order=asc' -H 'Authorization: Bearer YOUR_TOKEN'

Notes:

  • To authorize your request, you need to get a Ubiquity API key and use it as a bearer token.
  • Sometimes collection names and attributes contain whitespaces. When using cURL, replace them with %20.

Step 4. Your results will look something like this example response.


How to Render the Image Associated with an NFT

This tutorial explains the steps involved in rendering the image associated with a given NFT in the Ethereum Mainnet network.

Notes:

  • Image URLs are returned for assets from the top 100 popular collections. All images are cached by Blockdaemon for quickly access.
  • Blockdaemon collects NFT information and data from various third-party sources (“NFT Content”). We do not create, own or control NFT Content and we do not routinely monitor NFT Content for violations of these Terms. You acknowledge that Blockdaemon has no responsibility or liability related to NFT Content and agree that you must evaluate, and decide for yourself if you wish to use any NFT Content.

Step 1. Use the assets endpoint with the following details:

  • protocol: ethereum
  • network: mainnet
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets

Step 2. Add the following parameters:

  • contract address
    • parameter: contract_address
    • value: e.g. 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D
  • token ID
    • parameter: token_id
    • value: e.g. 9999
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?contract_address=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D&token_id=9999

Step 3. Execute the query.

For example, in cURL you should run the following code:

curl -X GET 'https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?contract_address=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D&token_id=9999' -H 'Authorization: Bearer YOUR_TOKEN'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token.

Step 4. Your results will look something like this example response. The image URL is located in the data.image_url field:

{
    "data": [
        {
            "token_id": "9999",
            "image_url": "https://storage.googleapis.com/blockdaemon-nft-staging/token/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D/9999",
            "name": "#9999",
            "contract": {
                "address": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
                "name": "BoredApeYachtClub",
                "symbol": "BAYC",
                "description": "...",
                "image_url": "https://storage.googleapis.com/blockdaemon-nft-staging/contract/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D/logo.png",
                "type": "ERC721"
            },
            "wallets": [...],
            "traits": [...],
            "mint_date": "1619858117"
        }
    ],
    "meta": {...}
}

Note: See the data.contract.image_url field to find the image associated with the smart contract.

Step 5. Finally, you can render the image.

  • In your browser, just paste the URL in the address bar and press Enter.
  • In Postman, click on the URL in the response. A tab with a new query will open. Run it, and Postman will render the image.
  • In cURL, run the following code to download the image to your working directory:
curl -X GET 'https://storage.googleapis.com/blockdaemon-nft-staging/token/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D/9999' --output YOUR_FILENAME.jpg

We don't support Internet Explorer

Please use Chrome, Safari, Firefox, or Edge to view this site.