getOwnersForContract - SDK
Gets all the owners for a given NFT contract and the token balance.
Don’t have an API key?
Start using this method in your app today. Get started for free
Description
Gets all the owners for a given NFT contract along with the token balance.
Note that token balances are omitted by default. To include token balances for each owner, use GetOwnersForContractWithTokenBalancesOptions, which has the withTokenBalances
field set to true
.
Parameters
options
parameters
GetOwnersForContractWithTokenBalancesOptions
parameters
Response
GetOwnersForContractResponse
object properties
GetOwnersForContractWithTokenBalancesResponse
object properties
owner
properties
Example Request and Response
Prerequisite: You will need to install the Alchemy SDK before making requests with it.
The commands for installing it using npm or yarn are given below:
Request
Response
Use Cases
Here are some potential use cases for the getOwnersForContract
function:
-
Portfolio tracking: The
getOwnersForContract
method can be used to track a user’s portfolio of NFTs from a specific contract. This information can be used to display the user’s NFT holdings and their current market value. -
Marketplace analytics: NFT marketplaces can use the
getOwnersForContract
method to analyze the ownership distribution of NFTs from a particular contract. This information can be used to identify trends and inform marketplace strategies. -
Royalty tracking: Similar to the
getOwnersForNft
method, thegetOwnersForContract
method can be used to track the ownership of NFTs representing intellectual property, such as music or art, and ensure that royalties are paid to the correct parties. -
Fraud prevention: The
getOwnersForContract
method can also be used to detect potential fraudulent activity. For example, if many NFTs from a specific contract are being rapidly and frequently transferred to different wallet addresses, it may be a sign of a fraudulent transaction.
Related Methods
Here are the methods related to getOwnersForContract
:
- getOwnersForNft: Gets all the owners for a given NFT contract address and token ID.