nft_approvals
Allows you to easily fetch historical NFT approval events for any address without having to scan the entire chain.
You can specify the contract address and account address, then you can obtain all the approval events of that collection which the account address has. If you don't specify the account address, the API can return all the approval events happening in that collection.
Supported on Ethereum, BNB Chain, Optimism, and Arbitrum.

Parameters

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.
  • accountAddress(hex string, optional) - the account address you want to query.
  • fromBlockNumber(integer number, optional) - the starting time range you want to fetch events over.
  • toBlockNumber(integer number, optional) - the ending time range you want to fetch events over.
  • fromAddress(hex string, optional) - the sending address in the transaction.
  • toAddress(hex string, optional) - the receiving address in the transaction.
  • pageSize(integer number, optional, default 20 max 50) - max number of results to return per call.
  • pageIndex(integer number, optional, default 1) - page index.

Returns

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:
    • nextPageIndex(integer number) - next page index.
    • data(array of objects, defined below) - response datas, sorted in ascending order by block number.
  • Object schema:
    • blockNumber(integer number) - the block where the transfer occurred.
    • txHash(hex string) - transaction hash.
    • blockHash(hex string) - block hash.
    • logIndex(integer number) - event index.
    • tokenId(string) - id of the NFT.
    • contractAddress(hex string) - contract address.
    • approved(hex string) - approved address.
    • owner(hex string) - owner address.

Example

Request

curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"jsonrpc": "2.0",
"method": "nft_approvals",
"params": {
"fromBlockNumber": 0,
"toBlockNumber": 0,
"toAddress":"",
"contractAddress":"0xad9Fd7cB4fC7A0fBCE08d64068f60CbDE22Ed34C",
"pageSize": 2,
"pageIndex": 1
}
}'

Result

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"data": [
{
"tokenID": "5828",
"contractAddress": "0xad9Fd7cB4fC7A0fBCE08d64068f60CbDE22Ed34C",
"blockNumber": 13950629,
"txHash": "0x96979a2e64a214bc9feed6f73934728035c19c43da2b4922f03405e619da81db",
"blockHash": "0x186d9447b1188bf88a78ebe15e322e044bc566337ea8e5bbcafdc93e9b868128",
"logIndex": 86,
"owner": "0x5bD8C88109B0680fF8EE0481716dC1AAedDC7D07",
"approved": "0x0000000000000000000000000000000000000000"
},
{
"tokenID": "8156",
"contractAddress": "0xad9Fd7cB4fC7A0fBCE08d64068f60CbDE22Ed34C",
"blockNumber": 13950606,
"txHash": "0x2f67c7713daf8253dfe955fbdcad610d84f12b530b14f087343371a83a572614",
"blockHash": "0xdab19dc8c7fecde2c2df6736101cf68a74c8854ca2eb656b23e2acf131ecca67",
"logIndex": 23,
"owner": "0x6a9D009f2b7b4D2F655858f828fe7B4105814832",
"approved": "0x0000000000000000000000000000000000000000"
}
],
"nextPageIndex": 2
}
}
Copy link
Outline
Parameters
Returns
Example
Request
Result