nft_owners
Gets the current or previous owner of any NFT.
Through nft_owners, you can fetch the data of current and historical owner of that NFT,
contractAddress
and tokenId
are necessary. Using this API, some airdrops and marketing strategies could be made according to this returning stats. Plus, you could see which account keeps holding this NFT.Supported on Ethereum, BNB Chain, Optimism, and Arbitrum.
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.tokenId(string, required)
- id of the NFT.
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 object, defined below)
- response data.
- Object schema:
owner(string)
- owner account address.timestamp(integer number)
- the unix timestamp like 1646943803.date(string)
- the UTC date string like 2022-03-10 20:23:23.blockNumber(integer number)
- block number.
curl
TypeScript
curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 0,
"method": "nft_owners",
"params": {
"contractAddress": "0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB",
"tokenId": "5822"
}
}'
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.getNFTOwners({
contractAddress: '0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB',
tokenId: '5822'
}).then(console.log)
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"data": [
{
"owner": "0x7DDFFbc38121a7b21AA4B0bc96318E86EF2D0cb7",
"timestamp": 1646943803,
"date": "2022-03-10 20:23:23",
"blockNumber": 14361235
},
{
"owner": "0x7Eb28B2f14A59789ec4c782A5DD957F9C8F33f6b",
"timestamp": 1613938992,
"date": "2021-02-21 20:23:12",
"blockNumber": 11902448
},
{
"owner": "0x1e32a859d69dde58d03820F8f138C99B688D132F",
"timestamp": 1498236982,
"date": "2017-06-23 16:56:22",
"blockNumber": 3918882
}
]
}
}
Last modified 1mo ago