How to Get a Collection by Unique ID

This tutorial explains the steps involved in getting any Ethereum Mainnet collection by its unique ID. The response contains the type of NFTs in the collection as well as other details associated with it.

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 a collection ID from the id field:

{
    "id": "4203aedd-7964-5fe1-b932-eb8c4fda7822",
    "name": "Bored Ape Yacht Club",
    ...more properties...
}

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

  • protocol: ethereum

  • network: mainnet

  • collection ID: 4203aedd-7964-5fe1-b932-eb8c4fda7822 (copied in the previous step)

    https://svc.blockdaemon.com/nft/v1/ethereum/mainnet/collection/4203aedd-7964-5fe1-b932-eb8c4fda7822
    

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/4203aedd-7964-5fe1-b932-eb8c4fda7822' -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. Your results will look something like this:

{
    "collection": {
        "id": "4203aedd-7964-5fe1-b932-eb8c4fda7822",
        "name": "Bored Ape Yacht Club",
        "description": "The Bored Ape Yacht Club is a collection of 10,000 unique Bored Ape NFTs— unique digital collectibles living on the Ethereum blockchain. Your Bored Ape doubles as your Yacht Club membership card, and grants access to members-only benefits, the first of which is access to THE BATHROOM, a collaborative graffiti board. Future areas and perks can be unlocked by the community through roadmap activation. Visit www.BoredApeYachtClub.com for more details.",
        "logo": "media/collection/4203aedd-7964-5fe1-b932-eb8c4fda7822/logo.png",
        "banner": "",
        "verified": true,
        "contracts": [
            {
                "address": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
                "name": "BoredApeYachtClub",
                "symbol": "BAYC",
                "description": "",
                "image_url": "",
                "type": "ERC721"
            }
        ],
        "meta": {
            "discord_url": "https://discord.gg/3P5K3dzgdB",
            "external_url": "http://www.boredapeyachtclub.com/",
            "twitter_username": "BoredApeYC"
        },
        "sub_collection": []
    }
}

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

  • "type": "ERC721"