Contents

qn_fetchNFTs RPC method

Currently supports ERC-721 and ERC-1155 compliant contracts (on Ethereum mainnet).

Parameters:

  1. Object - Custom Object with the following fields:

    wallet — (String) — The wallet address to check for NFTs.

    contracts - (String - optional) List of NFT contract addresses you'd like to get ownership data from. Contract addresses may be optionally suffixed with :tokenId to specify a specific NFT id to filter on. For example, 0x2106c...7aeaa:1234 will filter Loopy Donuts on the NFT token with id 1234 only. You may include up to 20 contract addresses per request.

    page — (Integer - optional) The page number you would like returned. Page numbers start at 1 and end at "totalPages". If omitted, defaults to the first page (page 1). If the page number requested is less than 1 or higher than "totalPages", an empty assets array will be returned.

    perPage — (Integer - optional) — The maximum amount of NFT assets to return on each page. You can request up to 40 items per page. If omitted, defaults to 20 items per page.

Returns:

  1. Object - Custom Response Object, or null if no NFTs are found:

    owner - The wallet address we checked for NFTs.

    assets - An array of objects representing NFTs with the following shape:

    name - the name of this specific NFT.

    collectionTokenId - the token id of this NFT in its collection.

    collectionName - the name of this NFT's collection.

    imageUrl - the URL where the image for this NFT can be seen.

    collectionAddress - the contract address that this NFT lives in.

    traits - an array of traits that this NFT has.

    chain - what chain this aggregation happened on.

    network - what network this aggregation happened on.

    provenance - an array with the transfer history for this NFT.

    blockNumber - the block number this transaction was included in.

    date - the date when this transaction was mined.

    from - the address for the sender of this transaction.

    to - the address for the receiver of this transaction.

    to - the token transfer transaction hash.

Code Examples:

from web3 import Web3, HTTPProvider
w3 = Web3(HTTPProvider('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/'))
resp = w3.provider.make_request('qn_fetchNFTs', {
  "wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
  "page": 1,
  "perPage": 10,
  "contracts": [
    "0x2106c00ac7da0a3430ae667879139e832307aeaa",
    "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
  ]
})
print(resp)
Ready to try QuickNode? Start your 7-day free trial