Skip To Content

Blockdaemon Documentation

NFT Tutorials: Collections

Overview
How to Get All Collections Sorted by Name
How to Get All ERC-721 and ERC-1155 Collections
How to Filter Collections by Contract Address
How to Get a Collection by Name
How to Find a Collection by Name and Get Its Assets
How to Render the Image Associated with a Collection
How to Find Out the Type of NFTs in a Collection


Overview

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

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

The example queries below are based on the following endpoints:


How to Get All Collections Sorted by Name

This tutorial explains the steps involved in getting a list of all the collections in the Ethereum Mainnet network and sorting it by name in the reverse alphabetical order (Z–A).

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

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

Step 2.Add the following parameters:

  • field to sort by
    • parameter: sort_by
    • value: name
  • sort order
    • parameter: order
    • value: desc
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/collections?sort_by=name&order=desc

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/collections?sort_by=name&order=desc' -H 'Authorization: Bearer YOUR_API_KEY'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token or a query parameter. Learn more: Authentication Guide

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


How to Get All ERC-721 and ERC-1155 Collections

This tutorial explains the steps involved in getting Ethereum Mainnet collections of ERC-721 and ERC-1155 tokens.

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

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

Step 2. Add the following parameters:

  • token type 1
    • parameter: token_type
    • value: ERC721
  • token type 2
    • parameter: token_type
    • value: ERC1155
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/collections?token_type=ERC721&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/collections?token_type=ERC721&token_type=ERC1155' -H 'Authorization: Bearer YOUR_API_KEY'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token or a query parameter. Learn more: Authentication Guide

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

The response does not contain token types, but you can get them with another endpoint: How to Find Out the Type of NFTs in a Collection


How to Filter Collections by Contract Address

This tutorial explains the steps involved in getting a list of Ethereum Mainnet collections filtered by contract address.

Please note that typically one collection is associated with one contract address. However, sometimes a collection can include multiple contracts.

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

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

Step 2. Add the following parameters:

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

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/collections?contract_address=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D&contract_address=0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB' -H 'Authorization: Bearer YOUR_API_KEY'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token or a query parameter. Learn more: Authentication Guide

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


How to Get a Collection by Name

This tutorial explains the steps involved in getting any Ethereum Mainnet collection by its name.

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

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

Step 2. Add the following parameter:

  • collection name
    • parameter: collection_name
    • value: e.g. Bored Ape Yacht Club
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/collections?collection_name=Bored Ape Yacht Club

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/collections?collection_name=Bored%20Ape%20Yacht%20Club' -H 'Authorization: Bearer YOUR_API_KEY'

Notes:

  • To authorize your request, you need to get a Ubiquity API key and use it as a bearer token or a query parameter. Learn more: Authentication Guide
  • Sometimes collection names contain whitespaces. When using cURL, replace them with %20.

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


How to Find a Collection by Name and Get Its Assets

This tutorial explains the steps involved in finding an Ethereum Mainnet collection by name and getting its assets.

Please note that you do not need to know the exact collection name. Just get collections with names matching a given search string, select the one you are interested in, and get its assets.

Step 1. Use the collections search endpoint with the following details:

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

Step 2. Add the following parameter:

  • collection name
    • parameter: name
    • value: e.g. bored ape
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/collections/search?name=bored ape

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/collections/search?name=bored%20ape' -H 'Authorization: Bearer YOUR_API_KEY'

Notes:

  • To authorize your request, you need to get a Ubiquity API key and use it as a bearer token or a query parameter. Learn more: Authentication Guide
  • When using cURL, replace spaces in your search string with %20.

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

You will get all collections with names matching your search string:

  • Basic Bored Ape Club
  • Bored Ape Comic
  • Bored Ape Yacht Club
  • Bored Ape Mountain Club
  • Bored Awesome Apes
  • Bored Crypto Apes
  • Bored Eminape Yacht Club
  • The Bored Ape Punk Club
  • BoredApeDinoClub
  • etc.

Find the collection you are interested in, e.g. Bored Ape Yacht Club, and copy its contract address from the contracts section:

{
    "id": "86c152df-55e6-562d-a868-51cc72771efb",
    "name": "Bored Ape Yacht Club",
    "logo": "https://ubiquity.storage.blockdaemon.com/collection/86c152df-55e6-562d-a868-51cc72771efb/logo.png",
    "contracts": [
        "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
    ],
    "verified": true
}

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

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

Step 6. Add the following parameter:

  • contract address (copied in the previous step)
    • parameter: collection_address
    • value: e.g. 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/assets?contract_address=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D

Step 7. 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_API_KEY'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token or a query parameter. Learn more: Authentication Guide

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


How to Render the Image Associated with a Collection

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

Notes:

  • Image URLs are returned for the top 100 popular collections. All images are cached by Blockdaemon for quick 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 collections endpoint with the following details:

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

Step 2. Add the following parameter:

  • contract address
    • parameter: contract_address
    • value: e.g. 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/collections?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/collections?contract_address=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D' -H 'Authorization: Bearer YOUR_API_KEY'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token or a query parameter. Learn more: Authentication Guide

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

Copy the image URL from the logo field:

{
    "id": "86c152df-55e6-562d-a868-51cc72771efb",
    "name": "Bored Ape Yacht Club",
    "logo": "https://ubiquity.api.blockdaemon.com/v1/nft/media/ethereum/mainnet/collection/86c152df-55e6-562d-a868-51cc72771efb/logo.png",
    "contracts": [
        "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
    ],
    "verified": true
}

Step 5. Finally, you can render the image.

Use the URL copied in the previous step:

https://ubiquity.api.blockdaemon.com/v1/nft/media/ethereum/mainnet/collection/86c152df-55e6-562d-a868-51cc72771efb/logo.png
  • In your browser, just use the address bar.
  • 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://ubiquity.api.blockdaemon.com/v1/nft/media/ethereum/mainnet/collection/86c152df-55e6-562d-a868-51cc72771efb/logo.png' --output YOUR_FILENAME.png -H 'Authorization: Bearer YOUR_API_KEY'

Note: In all cases authentication is required. You need to get a Ubiquity API key and use it as a bearer token or a query parameter when accessing the image. Learn more: Authentication Guide


How to Find Out the Type of NFTs in a Collection

This tutorial explains the steps involved in finding out the type of NFTs in any Ethereum Mainnet collection.

Step 1. Use the collections or collections search endpoint to get an NFT collection or a list of collections. For example, you can follow these steps: How to Get a Collection by Name

Step 2. Copy the collection ID from the id field:

{
    "id": "86c152df-55e6-562d-a868-51cc72771efb",
    "name": "Bored Ape Yacht Club",
    ...more properties...
}

Step 3. Use the collection endpoint with the following details:

  • protocol: ethereum
  • network: mainnet
  • collection ID: 86c152df-55e6-562d-a868-51cc72771efb (copied in the previous step)
https://ubiquity.api.blockdaemon.com/v1/nft/ethereum/mainnet/collection/338203fe-1361-4ee1-a26b-17ac5308b385

Step 4. 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/collection/86c152df-55e6-562d-a868-51cc72771efb' -H 'Authorization: Bearer YOUR_API_KEY'

Note: To authorize your request, you need to get a Ubiquity API key and use it as a bearer token or a query parameter. Learn more: Authentication Guide

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

The NFT type is specified in the contracts.type field, e.g.:

  • "type": "ERC721"

We don't support Internet Explorer

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