getnftcollectionholders
description: Get holders of the given NFT collection.
getNFTCollectionHolders
How to use getNFTCollectionHolders method ?
Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the getNFTCollectionHolders method effectively using Blast.
Parameters
Below, you can find the query parameters accepted by the method.
Parameter | Type | Description |
---|---|---|
contractAddress* | string | The contract address of the NFT collection |
blockNumber | string | The block number when the contract was deployed |
pageSize | number | Maximum number of records to be retrieved in one page (max 100, default 25) |
pageKey | string | Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response |
Returns
Parameter | Type | Description |
---|---|---|
count | number | The number of holders for the given NFT |
nextPageKey | string | Key to get the next page of results if more are available. |
holders | array<object> | array of NFTCollectionBalance objects |
contractAddress | string | The contract address of the NFT collection |
contractType | string | The type of the NFT contract ('erc721' or 'erc1155') |
walletAddress | string | The address which owns the NFT now (null for erc1155 tokens) |
totalTokenBalance | string | The total balance of tokens owned by the specified owner in the collection |
distinctTokenBalance | string | The balance of distinct tokens owned by the specified owner in the collection |
This API is paginated, response items are ordered descending by:
- totalTokenBalance
- ownerAddress
Example Request and Result for getNFTCollectionHolders
In this section, you can find an illustrative example of a request made to retrieve the number of holders for a specific NFT and the NFTCollectionBalance objects using the getNFTCollectionHolders method.
The example in this section uses a non-existing project id.
Make sure you replace it with your Starknet endpoint when issuing the Builder API calls.
Don't have a project id? Here's a straightforward guide on how to obtain one!
Returns the total number of NFTs belonging to the given collection and the array of NFTBalance objects.
GET
https://starknet-mainnet.blastapi.io/<project_id>/builder/getNFTCollectionHolders?
Query Parameters
Name | Type | Value |
---|---|---|
contractAddress | string |
|
pageSize | number |
|
- 200: OK
{
"count": 2,
"nextPageKey": "Njg4NWY4ZmQzZTZhOjE3MTExNDg4OTM6NTk6MHgwM2RjMThhMTlmYjllODQ3MDMwZWRhOTc2MzdiMGQ3N2NjMmNjMjA1ODBlNzYxMDBjZDAzZTEyMWVmNGJhZWZm",
"holders": [
{
"contractAddress": "0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1",
"contractType": "erc721",
"ownerAddress": "0x03d3f82dbfa1aa30a8bef00825dc233b9ed5c287e89a4b50a752a66bd9841c06",
"totalTokenBalance": "143",
"distinctTokenBalance": "143"
},
{
"contractAddress": "0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1",
"contractType": "erc721",
"ownerAddress": "0x03dc18a19fb9e847030eda97637b0d77cc2cc20580e76100cd03e121ef4baeff",
"totalTokenBalance": "59",
"distinctTokenBalance": "59"
}
]
}
curl -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getNFTCollectionHolders?pageSize=2&contractAddress=0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1 \
-H 'Content-Type: application/json' \