How to Get a Subcollection

Follow this tutorial to learn how to get a subcollection.

Some collections, e.g. Art Blocks, contain subcollections. This tutorial explains the steps involved in getting a subcollection of a given parent collection in Ethereum Mainnet.

Step 1. Use the collections or collections search endpoint to find a parent collection.

For example, you can follow these steps: How to Get a Collection by Name

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

{
    "id": "d4d662da-d02a-5ae1-9e79-783c5abe020f",
    "name": "Art Blocks",
    ...more properties...
}

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

  • protocol: ethereum

  • network: mainnet

  • collection ID: d4d662da-d02a-5ae1-9e79-783c5abe020f (copied in the previous step)

    https://svc.blockdaemon.com/nft/v1/ethereum/mainnet/collection/d4d662da-d02a-5ae1-9e79-783c5abe020f
    

Step 4. Execute the query.

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

curl -X GET 'https://svc.blockdaemon.com/nft/v1/ethereum/mainnet/collection/d4d662da-d02a-5ae1-9e79-783c5abe020f' -H 'Authorization: Bearer YOUR_API_KEY'

📘

Note!

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

Step 5. Copy a subcollection id from the sub_collection section:

{
    "collection": {
        "id": "d4d662da-d02a-5ae1-9e79-783c5abe020f",
        "name": "Art Blocks",
        "description": "Art Blocks is leading a new generation of art. Hosting projects from today’s most innovative digital artists, our platform combines creative coding with blockchain technology to establish a new paradigm for the creation and ownership of art.",
        "logo": "collection/d4d662da-d02a-5ae1-9e79-783c5abe020f/logo.png",
        "banner": "",
        "verified": true,
        "contracts": [],
        "meta": {},
        "sub_collection": [
            {
                "id": "937538b7-9d37-526c-aa41-0a6af53e1b73",
                "name": "Art Blocks Curated"
            },
            { ...more subcollections... }
        ]
    }
}

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

  • protocol: ethereum

  • network: mainnet

  • collection ID: 937538b7-9d37-526c-aa41-0a6af53e1b73 (copied in the previous step)

    https://svc.blockdaemon.com/nft/v1/ethereum/mainnet/collection/937538b7-9d37-526c-aa41-0a6af53e1b73
    

Step 7. Execute the query.

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

curl -X GET 'https://svc.blockdaemon.com/nft/v1/ethereum/mainnet/collection/937538b7-9d37-526c-aa41-0a6af53e1b73' -H 'Authorization: Bearer YOUR_API_KEY'

📘

Note!

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

Step 8. Get the response.

Some subcollections contain their own subcollections, which can be retrieved with the same endpoint. See the sub_collection section in the example below. Also, please note that the parent_id field contains the ID of the parent collection.

{
    "collection": {
        "id": "937538b7-9d37-526c-aa41-0a6af53e1b73",
        "name": "Art Blocks Curated",
        "description": "The Curated Collection includes projects that have been selected by Art Blocks’ Curation Board for their world-class innovation, technical rigor, and aesthetic beauty.",
        "logo": "",
        "banner": "",
        "verified": false,
        "contracts": [],
        "meta": null,
        "parent_id": "d4d662da-d02a-5ae1-9e79-783c5abe020f",
        "sub_collection": [
            {
                "id": "e2ff882b-4218-5011-86d5-e0251ec99049",
                "name": "Sudfah by Melissa Wiederrecht"
            },
            { ...more subcollections... }
        ]
    }
}

👋 Need Help?

Contact us through email or our support page for any issues, bugs, or assistance you may need.