getOwnersForContract - SDK

Gets all the owners for a given NFT contract along with the token balance.

Don’t have an API key?

Start using this method in your app today.


Gets all the owners for a given NFT contract along with the token balance.


contractAddressstringThe NFT contract to get the owners for.
optionsobjectOptional parameters to use for the request.

options paramters

withTokenBalancesbooleanWhether to include the token balances per token id for each owner. Defaults to false when omitted.
pageKey?stringOptional page key to paginate the next page for large requests.


Promise<GetOwnersForContractResponse> / Promise<GetOwnersForContractWithTokenBalancesResponse>objectAn object containing the owners of a contract.

GetOwnersForContractResponse parameters

ownerarray of stringsAn array of owner addresses for the provided contract address.
pageKey?stringOptional Page key that is returned when a collection has more than 50,000 owners.

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:

npm install alchemy-sdk
yarn add alchemy-sdk


// Imports the Alchemy SDK
const { Alchemy, Network } = require("alchemy-sdk");

// Configures the Alchemy SDK
const config = {
    apiKey: "alchemy-replit", // Replace with your API key
    network: Network.ETH_MAINNET, // Replace with your network

// Creates an Alchemy object instance with the config to use for making requests
const alchemy = new Alchemy(config);

const main = async () => {
    // define the contract address
    const address = "0x61fce80d72363b731425c3a2a46a1a5fed9814b2";

    //Call the method to fetch the owners for the contract
    const response = await alchemy.nft.getOwnersForContract(address)

    //Logging the response to the console



  owners: [
    ... 1980 more items

Code Sandbox

You can test out the getOwnersForContract method using the code sandbox below:

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, the getOwnersForContract 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 a large number of 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:

  • searchContractMetadata: Search for a keyword across the metadata of all ERC-721 and ERC-1155 smart contracts.