Skip to main content

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.

ParameterTypeDescription

contractAddress*

stringThe contract address of the NFT collection
blockNumberstringThe block number when the contract was deployed
pageSizenumber

Maximum number of records to be retrieved in one page (max 100, default 25)

pageKeystring

Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response

Returns

ParameterTypeDescription
countnumberThe number of holders for the given NFT
nextPageKeystringKey to get the next page of results if more are available.
holdersarray<object>array of NFTCollectionBalance objects
contractAddressstringThe contract address of the NFT collection
contractTypestringThe type of the NFT contract ('erc721' or 'erc1155')
walletAddressstringThe address which owns the NFT now (null for erc1155 tokens)
totalTokenBalancestring

The total balance of tokens owned by the specified owner in the collection

distinctTokenBalancestring

The balance of distinct tokens owned by the specified owner in the collection

info

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.

info

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

NameTypeValue
contractAddressstring

0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1

pageSizenumber
2
{
"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' \