Skip to main content

getnftholders


description: Get holders of the given NFT.

getNFTHolders

How to use getNFTHolders method ?

Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the getNFTHolders method effectively using Blast.

Parameters

Below, you can find the query parameters accepted by the method.

ParameterTypeDescription

contractAddress*

stringThe NFT contract address

tokenId*

stringThe token ID
blockNumberstringSpecifies the block number at which to query for NFT holders
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 total number of NFTs belonging to the given collection
nextPageKeystringKey to get the next page of results if more are available.
holdersarray<object>array of NFTBalance objects
contractAddressstringThe contract address of the NFT collection
contractTypestringThe type of the NFT contract ('erc721' or 'erc1155')
tokenIdstringThe token ID of the NFT
walletAddressstringThe address which owns the NFT now (null for erc1155 tokens)
tokenBalancestringThe balance of NFT owned by the owner.
info

This API is paginated, response items are ordered descending by:

  • tokenBalance
  • ownerAddress

Example Request and Result for getNFTHolders

In this section, you can find an illustrative example of a request made to retrieve the total number of NFTs included in the specified group and the NFTBalance objects using the getNFTHolders 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/getNFTHolders?

Query Parameters

NameTypeValue
contractAddressstring

0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1

tokenIdstring
3095038
{
"count": 1,
"holders": [
{
"contractAddress": "0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1",
"contractType": "erc721",
"tokenId": "3095038",
"ownerAddress": "0x0500bfd99cca3525caf7e2757b160cd0fa097c5736def17c484f45f436f0e07a",
"tokenBalance": "1"
}
]
}
curl -X GET https://starknet-mainnet.blastapi.io/<project-id>/builder/getNFTHolders?contractAddress=0x07606cac9053e9b8b573a4b0a0ce608880f64869e24b8a605210d7a85bb6e5f1&tokenId=3095038 \
-H 'Content-Type: application/json' \