nft_collectionOwners
Get the owners information of an NFT collection.
Through nft_collectionOwners, you can fetch the owners' information of a certain NFT collection,
contractAddress
is necessary. Using this API, you could clearly see which account addresses hold this collection, and it could be used in airdrop and related marketing strategies.Supported on Ethereum and BNB Chain.
Object
- An object with the following fields (required):contractAddress(hex string, required)
- the contract address of the collection. BlockVision currently support both ERC721 and ERC1155.
Object
- An object with the following fields:id(integer number)
- json-rpc id.jsonrpc(string)
- json-rpc version.result(object)
- an object with the following fields:data(array of string)
- owners address.
curl
TypeScript
curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"jsonrpc": "2.0",
"method": "nft_collectionOwners",
"params": {
"contractAddress": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"
}
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ETH_MAINNET)
// Access the BlockVision NFT API
bv.getNFTCollectionOwners({
contractAddress: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'
}).then(console.log)
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"data": [
"0x46c9ff6740dCCB6D3761f01a87Aea8676707813F",
"0xf645D7A8e42C690c8867f298F4962F8ce631780b",
"0x4e324583454de822eEF0ddCce9a2BA4085aA6e27",
"0x42f04C45e96be43e6069f84a713e31FFf694C8a2",
"0x7FCbc5A56B8515AD8B8Af3964D4D3b2DFb2FFa69",
"0x9Fe176816F90145F8aEd9fFDedEE158ed8423bA2",
"0xE2E07551f6454B0812bce305aD223bcf65bDa254",
"0xD936830b51Ae9CA406e3B025b313bB709d6ab999",
"0x7EFf7eeE42Dc0Bd27081A78fE23CFE2a72697f2B",
...
}
}
Last modified 1mo ago