qn_fetchNFTs (v2) RPC Method - Token and NFT API
Please note that this RPC method requires the Token and NFT API v2 bundle add-on enabled on your QuickNode endpoint. Additionally, for a contract to be fully indexed, it must be verified on Etherscan.
Parameters
array
array
Loading...
object
Loading...
wallet
string
Loading...
contracts
string
Loading...
page
integer
Loading...
perPage
integer
Loading...
omitFields
array
Loading...
Returns
object
Loading...
owner
Loading...
ensName
string
Loading...
assets
Loading...
name
Loading...
collectionTokenId
Loading...
collectionName
Loading...
traits
Loading...
value
Loading...
trait_type
Loading...
imageUrl
Loading...
collectionAddress
Loading...
chain
Loading...
network
Loading...
description
Loading...
totalItems
Loading...
totalPages
Loading...
pageNumber
Loading...
Request
curl https://docs-demo.quiknode.pro/ \ -X POST \ -H "Content-Type: application/json" \ --data '{ "id":67, "jsonrpc":"2.0", "method":"qn_fetchNFTs", "params": [{ "wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", "omitFields": [ "traits" ], "page": 1, "perPage": 10, "contracts": [ "0x2106c00ac7da0a3430ae667879139e832307aeaa", "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D" ] }] }'
require 'eth' client = Eth::Client.create 'https://docs-demo.quiknode.pro/' payload = { "jsonrpc": "2.0", "method": "qn_fetchNFTs", "params": [ "wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", "omitFields": [ "provenance", "traits" ], "page": 1, "perPage": 10, "contracts": [ "0x2106c00ac7da0a3430ae667879139e832307aeaa", "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D" ] ], "id": "1" } response = client.send(payload.to_json) puts response
import { ethers } from "ethers"; (async () => { const provider = new ethers.JsonRpcProvider("https://docs-demo.quiknode.pro/"); const heads = await provider.send("qn_fetchNFTs", [ { wallet: "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", omitFields: ["traits"], page: 1, perPage: 10, contracts: [ "0x2106c00ac7da0a3430ae667879139e832307aeaa", "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D", ], }, ]); console.log(heads); })();
var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "id": 67, "jsonrpc": "2.0", "method": "qn_fetchNFTs", "params": [{ "wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", "omitFields": [ "traits" ], "page": 1, "perPage": 10, "contracts": [ "0x2106c00ac7da0a3430ae667879139e832307aeaa", "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D" ] }] }); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://docs-demo.quiknode.pro/", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
import requests import json url = "https://docs-demo.quiknode.pro/" payload = json.dumps({ "id": 67, "jsonrpc": "2.0", "method": "qn_fetchNFTs", "params": [{ "wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", "omitFields": [ "traits" ], "page": 1, "perPage": 10, "contracts": [ "0x2106c00ac7da0a3430ae667879139e832307aeaa", "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D" ] }] }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
require "uri" require "json" require "net/http" url = URI("https://docs-demo.quiknode.pro/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "id": 67, "jsonrpc": "2.0", "method": "qn_fetchNFTs", "params": [{ "wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", "omitFields": [ "traits" ], "page": 1, "perPage": 10, "contracts": [ "0x2106c00ac7da0a3430ae667879139e832307aeaa", "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D" ] }] }) response = https.request(request) puts response.read_body
from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('https://docs-demo.quiknode.pro/')) resp = w3.provider.make_request('qn_fetchNFTs', [{ "wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", "omitFields": [ "traits" ], "page": 1, "perPage": 10, "contracts": [ "0x2106c00ac7da0a3430ae667879139e832307aeaa", "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D" ] }]) print(resp)
import { Core } from '@quicknode/sdk' const core = new Core({ endpointUrl: "https://docs-demo.quiknode.pro/", config: { addOns: { nftTokenV2: true, }, }, }) core.client .qn_fetchNFTs({ wallet: "0xD10E24685c7CDD3cd3BaAA86b09C92Be28c834B6", perPage: 2, }) .then(res => console.log(res))
Response
{ "jsonrpc": "2.0", "id": 67, "result": { "owner": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740", "ensName": null, "assets": [ { "collectionName": "Loopy Donuts", "collectionTokenId": "1747", "collectionAddress": "0x2106c00ac7da0a3430ae667879139e832307aeaa", "name": "Loopy Donut #1747", "description": "", "imageUrl": "https://quicknode-content.quicknode-ipfs.com/ipfs/QmSNmVFTJv6cG9M8ZRU8T9F4Kz9HHxmV85ssGP5W8ZsTPa/1747.png", "chain": "ETH", "network": "MAINNET" }, { "collectionName": "Loopy Donuts", "collectionTokenId": "1971", "collectionAddress": "0x2106c00ac7da0a3430ae667879139e832307aeaa", "name": "Loopy Donut #1971", "description": "", "imageUrl": "https://quicknode-content.quicknode-ipfs.com/ipfs/QmSNmVFTJv6cG9M8ZRU8T9F4Kz9HHxmV85ssGP5W8ZsTPa/1971.png", "chain": "ETH", "network": "MAINNET" }, { "collectionName": "Loopy Donuts", "collectionTokenId": "2979", "collectionAddress": "0x2106c00ac7da0a3430ae667879139e832307aeaa", "name": "Loopy Donut #2979", "description": "", "imageUrl": "https://quicknode-content.quicknode-ipfs.com/ipfs/QmSNmVFTJv6cG9M8ZRU8T9F4Kz9HHxmV85ssGP5W8ZsTPa/2979.png", "chain": "ETH", "network": "MAINNET" }, { "collectionName": "Loopy Donuts", "collectionTokenId": "3432", "collectionAddress": "0x2106c00ac7da0a3430ae667879139e832307aeaa", "name": "Loopy Donut #3432", "description": "", "imageUrl": "https://quicknode-content.quicknode-ipfs.com/ipfs/QmSNmVFTJv6cG9M8ZRU8T9F4Kz9HHxmV85ssGP5W8ZsTPa/3432.png", "chain": "ETH", "network": "MAINNET" }, { "collectionName": "Loopy Donuts", "collectionTokenId": "3643", "collectionAddress": "0x2106c00ac7da0a3430ae667879139e832307aeaa", "name": "Loopy Donut #3643", "description": "", "imageUrl": "https://quicknode-content.quicknode-ipfs.com/ipfs/QmSNmVFTJv6cG9M8ZRU8T9F4Kz9HHxmV85ssGP5W8ZsTPa/3643.png", "chain": "ETH", "network": "MAINNET" }, { "collectionName": "Loopy Donuts", "collectionTokenId": "3854", "collectionAddress": "0x2106c00ac7da0a3430ae667879139e832307aeaa", "name": "Loopy Donut #3854", "description": "", "imageUrl": "https://quicknode-content.quicknode-ipfs.com/ipfs/QmSNmVFTJv6cG9M8ZRU8T9F4Kz9HHxmV85ssGP5W8ZsTPa/3854.png", "chain": "ETH", "network": "MAINNET" }, { "collectionName": "Loopy Donuts", "collectionTokenId": "4592", "collectionAddress": "0x2106c00ac7da0a3430ae667879139e832307aeaa", "name": "Loopy Donut #4592", "description": "", "imageUrl": "https://quicknode-content.quicknode-ipfs.com/ipfs/QmSNmVFTJv6cG9M8ZRU8T9F4Kz9HHxmV85ssGP5W8ZsTPa/4592.png", "chain": "ETH", "network": "MAINNET" }, { "collectionName": "Loopy Donuts", "collectionTokenId": "4878", "collectionAddress": "0x2106c00ac7da0a3430ae667879139e832307aeaa", "name": "Loopy Donut #4878", "description": "", "imageUrl": "https://quicknode-content.quicknode-ipfs.com/ipfs/QmSNmVFTJv6cG9M8ZRU8T9F4Kz9HHxmV85ssGP5W8ZsTPa/4878.png", "chain": "ETH", "network": "MAINNET" }, { "collectionName": "Loopy Donuts", "collectionTokenId": "5585", "collectionAddress": "0x2106c00ac7da0a3430ae667879139e832307aeaa", "name": "Loopy Donut #5585", "description": "", "imageUrl": "https://quicknode-content.quicknode-ipfs.com/ipfs/QmSNmVFTJv6cG9M8ZRU8T9F4Kz9HHxmV85ssGP5W8ZsTPa/5585.png", "chain": "ETH", "network": "MAINNET" }, { "collectionName": "Loopy Donuts", "collectionTokenId": "6652", "collectionAddress": "0x2106c00ac7da0a3430ae667879139e832307aeaa", "name": "Loopy Donut #6652", "description": "", "imageUrl": "https://quicknode-content.quicknode-ipfs.com/ipfs/QmSNmVFTJv6cG9M8ZRU8T9F4Kz9HHxmV85ssGP5W8ZsTPa/6652.png", "chain": "ETH", "network": "MAINNET" } ], "totalPages": 2, "totalItems": 18, "pageNumber": 1 } }
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free