getOwnersForCollection
Gets all owners for a given NFT contract
This endpoint is supported on the following chains and networks:
  • Ethereum: Mainnet, Goerli
  • Polygon: Mainnet, Mumbai
To see chain support across all features, check out the feature matrix.

Parameters

  • contractAddress: [string] - contract address for the NFT collection

Returns

  • owners: [array] list of all addresses that own one of the NFTs from the queried contract address.

Example

The example below is for Ethereum Mainnet. If you are using Polygon you'll need to use your polygon endpoint instead: https://polygon-mainnet.g.alchemy.com/nft/v2/your-api-key/getNFTs...

Request

Alchemy SDK
Fetch (JS)
Axios (JS)
Postman
Curl
1
// Github: https://github.com/alchemyplatform/alchemy-sdk-js
2
// Setup: npm install @alch/alchemy-sdk
3
import {
4
Network,
5
initializeAlchemy,
6
getOwnersForCollection,
7
} from "@alch/alchemy-sdk";
8
9
// Optional Config object, but defaults to demo api-key and eth-mainnet.
10
const settings = {
11
apiKey: "demo", // Replace with your Alchemy API Key.
12
network: Network.ETH_MAINNET, // Replace with your network.
13
maxRetries: 10,
14
};
15
16
const alchemy = initializeAlchemy(settings);
17
18
// Print total NFT count returned in the response:
19
const ownersForCollection = await getOwnersForCollection(
20
alchemy,
21
"0x61fce80d72363b731425c3a2a46a1a5fed9814b2"
22
);
23
console.log(ownersForCollection);
24
Copied!
1
import fetch from 'node-fetch';
2
3
var requestOptions = {
4
method: 'GET',
5
redirect: 'follow'
6
};
7
8
const apiKey = "demo"
9
const baseURL = `https://eth-mainnet.alchemyapi.io/nft/v2/${apiKey}/getOwnersForCollection`;
10
const contractAddr = "0x61fce80d72363b731425c3a2a46a1a5fed9814b2";
11
const fetchURL = `${baseURL}?contractAddress=${contractAddr}`;
12
13
fetch(fetchURL, requestOptions)
14
.then(response => response.json())
15
.then(response => JSON.stringify(response, null, 2))
16
.then(result => console.log(result))
17
.catch(error => console.log('error', error));
Copied!
1
import axios from 'axios';
2
3
// replace with your Alchemy api key
4
const apiKey = "demo";
5
const baseURL = `https://eth-mainnet.alchemyapi.io/nft/v2/${apiKey}/getOwnersForCollection`;
6
const contractAddr = "0x61fce80d72363b731425c3a2a46a1a5fed9814b2";
7
8
var config = {
9
method: 'get',
10
url: `${baseURL}?contractAddress=${contractAddr}`,
11
headers: { }
12
};
13
14
axios(config)
15
.then(response => console.log(JSON.stringify(response.data, null, 2)))
16
.catch(error => console.log(error));
Copied!
1
URL: https://eth-mainnet.g.alchemy.com/nft/v2/demo/getOwnersForCollection/?contractAddress=0x61fce80d72363b731425c3a2a46a1a5fed9814b2
2
RequestType: GET
Copied!
1
curl 'https://eth-mainnet.g.alchemy.com/nft/v2/demo/getOwnersForCollection/?contractAddress=0x61fce80d72363b731425c3a2a46a1a5fed9814b2'Response
Copied!
1
{"contractAddress":
2
["0x001a61213d72f2f3c95ff743c80f472749ab8ad3",
3
"0x003a1acce28eb335f3ff1e93a5b09cd4b598ef62",
4
"0x00614efd868dabb5f92e15b0440d1f85ac0f9be1",
5
"0x006f48d6ed87efd9e0bc56cc7a8703d0455c2858",
6
"0x008b7903f1f0b825636739c7a3defb7eebc94f1d",
7
"0x008c79f10cbd14070b106b05d5fd494e084ee8a5",
8
"0x00ce8f7e0ec4f03a821e8cb3d84479d76151d0a9",
9
"0x00f3a0fcc47ba9f7a757c255aaa6a286a524cef9"]
10
}
Copied!