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.
Parameter | Type | Description |
---|---|---|
contractAddress* | string | The NFT contract address |
tokenId* | string | The token ID |
blockNumber | string | Specifies the block number at which to query for NFT holders |
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 total number of NFTs belonging to the given collection |
nextPageKey | string | Key to get the next page of results if more are available. |
holders | array<object> | array of NFTBalance objects |
contractAddress | string | The contract address of the NFT collection |
contractType | string | The type of the NFT contract ('erc721' or 'erc1155') |
tokenId | string | The token ID of the NFT |
walletAddress | string | The address which owns the NFT now (null for erc1155 tokens) |
tokenBalance | string | The balance of NFT owned by the owner. |
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.
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
Name | Type | Value |
---|---|---|
contractAddress | string |
|
tokenId | string |
|
- 200: OK
{
"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' \