Fetching Collection Data

Get information about a collection

Use this Query to fetch information about a specific collection.

GetCollectionInfo
query GetCollectionInfo($collectionId: String) {
  GetCollectionInfo(collectionId: $collectionId) {
    activeTokensCount
    balance
    collectionId
    collectionName
    description
    metadata
    numTransactions
    tokenBalancesCount
    tokens
      {  
        tokenId
      }
  }
}
Input Variables
"collectionId" : "KT1SjwraTtii88ZaEs8ReUUsing6wkUreTvM8qfaa"
Sample Response
{
  "data": {
    "GetCollectionInfo": {
      "activeTokensCount": 0,
      "balance": 0,
      "collectionId": "KT1SjwraTtii88ZaEs8ReU6wkUreTvM8qfaa",
      "collectionName": "Smiley Bears",
      "description": "Smiley Bears is a captivating video game designed for kids, where they embark on an enchanting journey with lovable, cuddly bears, exploring a magical forest, solving puzzles, and learning valuable skills along the way.",
      "metadata": {
        "name": "Smiley Bears",
        "description": "Smiley Bears is a captivating video game designed for kids, where they embark on an enchanting journey with lovable, cuddly bears, exploring a magical forest, solving puzzles, and learning valuable skills along the way.",
        "interfaces": [
          "TZIP-12"
        ],
        "authors": [
          "Smiley Bears"
        ],
        "license": {
          "name": "MIT"
        },
        "thumbnailUri": "https://test.com/img/SmileyBears.png"
      },
      "numTransactions": 7,
      "tokenBalancesCount": 1,
      "tokens": {
        "tokenId": "9"
        }
    }
  }
}

Below is an explanation of the response fields.

Response Field

activeTokensCount

The number of tokens, in the collection, with non-zero balances.

balance

Balance of the collection.

collectionId

The unique identifier of the collection. Same with the contract address the collection is deployed in Tezos.

collectionName

The name of the collection.

description

The description of the collection.

metadata

The metadata attached to the collection. This is defined by the development upon the creation of the collection.

numTransactions

Number of all transaction (Tez transfer) operations, related to the collection.

tokenBalancesCount

Number of tokens that where ever created in this collection.

Fetch all created collections

Use the following Query to fetch the collections created by a specified wallet address.

GetCollections
query GetCollections($walletAddress: String!){
  GetCollections(walletAddress: $walletAddress) {
    collectionId
  }
}
Input Variables
"walletAddress": "tz1i7SnAcekYtyPv1RZ9YBbnd8ScNcREVaDK"
Sample Response
{
  "data": {
    "GetCollections": [
      {
        "collectionId": "KT1SjwraTtii88ZaEs8ReU6wkUreTvM8qfaa"
      },
      {
        "collectionId": "KT1G76H9srgnpXBVYEjbiTgXpbMN7cZ3vVMp"
      }
    ]
  }
}

The Query will return as a response, all the collectionIds that have been created from the specified wallet address.

You can further use each collectionId in order to fetch information about each collection.

Last updated