This API method helps you to get the list of NFT token owners.
Supported on BSC and ETH mainnet only.
Parameters
Token Address
- The address of the tokenToken Type
: Please specify the type of token you query for, e.g. "ERC721", "ERC1155", etc.PageSize
- pageSize is hex encoded and should be less equal than 100 (each page return at most pageSize items)PageKey
- It should be empty for the first page. If more results are available, a pageKey will be returned in the response. Pass the pageKey to fetch the next pageSize items.
Returns
pageKey
- stringtokenIds
- token id and owneritems
tokenId
- string, the id of the tokenownerAddress
- string, the address of the ownerbalance
- string
API Endpoint
The format of a MegaNode API endpoint is https://{chain}-{network}.nodereal.io/v1/{API-key}
Here is an example:
https://bsc-mainnet.nodereal.io/v1/4c0a1c23661a4e26bcbcwed461e34ea9
For other chains or networks, you could refer to this guidance Find API key & endpoint.
Example
Request
curl https://bsc-mainnet.nodereal.io/v1/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"nr_getNFTTokenOwners","params":["0x07d971c03553011a48e951a53f48632d37652ba1","ERC721","0x14",""],"id": 1 }'
Result
{
"id": "1",
"jsonrpc": "2.0",
"result": {
"pageKey": "qh000000-0X5j-WSqq-mCLq-kPfWRH8B1GPS",
"items": {
"tokenId": "0x123",
"ownerAddress": "0x123",
"balance": "0x0000000000000000000000000000000000000000000000000000000000001bdf"
}
}
}