5 min read
Overview
Whether you’re building a portfolio tracker or just want to inspect what NFTs a wallet is holding, this guide shows you how to quickly fetch all NFTs owned by an Ethereum address using QuickNode’s qn_fetchNFTs
method.
Instead of manually scanning token balances, you can get everything in one call—including images, metadata, collection info, and more. We'll walk you through the setup, explain how the method works, and show you how it fits into a broader set of tools for working with NFTs.
What You Will Do
- Query Ethereum Mainnet for NFTs owned by a wallet
- Use the
qn_fetchNFTs
method to retrieve structured NFT data - Discover other NFT-related methods available through QuickNode
What You Will Need
- A free QuickNode account
- A wallet address to test with
- A tool to make JSON-RPC requests (e.g., Terminal, Windows Powershell, Postman)
How to Fetch NFTs
Step 1: Set Up Your QuickNode Endpoint
To use the qn_fetchNFTs
method, you'll need a QuickNode Ethereum endpoint with the Token and NFT API v2 bundle enabled. Since creating an endpoint and enabling this add-on is free, you can get started right away.
- Sign up at QuickNode and create an Ethereum endpoint.
- Enable the Token and NFT API v2 bundle add-on in your endpoint. This enables several RPC methods through your endpoint.
- Save your endpoint URL.
Step 2: Fetch NFTs for a Wallet Address
The qn_fetchNFTs
method returns all NFTs currently owned by a given address. It supports both ERC-721 and ERC-1155 tokens and includes useful metadata for display. For more details on the qn_fetchNFTs
method, check out our documentation.
You can query the qn_fetchNFTs
method using common web3 libraries and languages such as cURL, JavaScript, Python, Ruby, and more.
- cURL
- JavaScript
- Python
- Ruby
- ethers.js
- Web3.py
- Eth.rb
curl YOUR_QUICKNODE_ETHEREUM_ENDPOINT \
-X POST \
-H "Content-Type: application/json" \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "qn_fetchNFTs",
"params": [{
"wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
"page": 1,
"perPage": 10
}]
}'
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"id": 1,
"jsonrpc": "2.0",
"method": "qn_fetchNFTs",
"params": [{
"wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
"page": 1,
"perPage": 10
}]
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("YOUR_QUICKNODE_ETHEREUM_ENDPOINT", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
import requests
import json
url = "YOUR_QUICKNODE_ETHEREUM_ENDPOINT"
payload = json.dumps({
"id": 1,
"jsonrpc": "2.0",
"method": "qn_fetchNFTs",
"params": [{
"wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
"page": 1,
"perPage": 10
}]
})
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("YOUR_QUICKNODE_ETHEREUM_ENDPOINT")
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": 1,
"jsonrpc": "2.0",
"method": "qn_fetchNFTs",
"params": [{
"wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
"page": 1,
"perPage": 10
}]
})
response = https.request(request)
puts response.read_body
import { ethers } from "ethers";
(async () => {
const provider = new ethers.JsonRpcProvider("YOUR_QUICKNODE_ETHEREUM_ENDPOINT");
const heads = await provider.send("qn_fetchNFTs", [
{
wallet: "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
page: 1,
perPage: 10
},
]);
console.log(heads);
})();
from web3 import Web3, HTTPProvider
w3 = Web3(HTTPProvider('YOUR_QUICKNODE_ETHEREUM_ENDPOINT'))
resp = w3.provider.make_request('qn_fetchNFTs', [{
"wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
"page": 1,
"perPage": 10
}])
print(resp)
require 'eth'
client = Eth::Client.create 'YOUR_QUICKNODE_ETHEREUM_ENDPOINT'
payload = {
"jsonrpc": "2.0",
"method": "qn_fetchNFTs",
"params": [
"wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
"page": 1,
"perPage": 10
],
"id": "1"
}
response = client.send(payload.to_json)
puts response
Don't forget to replace YOUR_QUICKNODE_ETHEREUM_ENDPOINT
with your QuickNode Ethereum endpoint URL before running the command.
This request will return a list of NFTs owned by the wallet address 0x91b51c173a4bdaa1a60e234fc3f705a16d228740
.
Step 3: Review the Response
The response contains an array of NFTs, each with token ID, contract address, metadata, image URL, and collection name. Here’s what a simplified response looks like:
{
"result": {
"owner": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
"ensName": null,
"assets": [
{
"updatedAtBlock": "9925193",
"collectionName": "Cool Cats",
"collectionTokenId": "123",
"collectionAddress": "0xabc...",
"tokenId": "123",
"name": "Cool Cat #123",
"description": "Cool Cat #123",
"imageUrl": "https://...",
"traits": [...]
}
],
"totalPages": 6,
"totalItems": 55,
"pageNumber": 1
}
}
You can use this data directly in your app UI—display token images, show rarity traits, or group by collection.
Check out our Ethereum Wallet Explorer sample app to see how you can use the Token and NFT API v2 bundle in your app.
Related Methods Worth Exploring
While the qn_fetchNFTs
method is built to help you pull wallet holdings cleanly and efficiently, there are other methods you can use to get more information about NFTs like the following:
qn_fetchNFTCollectionDetails
– Get collection details for a specific collectionqn_fetchNFTsByCollection
– Fetch all NFTs in a specific collectionqn_getTransfersByNFT
– Retrieve transfer history for a particular NFTqn_verifyNFTsOwner
– Quickly verify whether a wallet owns specific token(s)
These can be combined to power full-featured NFT dashboards, galleries, or alerts.
Note that the Token and NFT API v2 bundle add-on also supports querying ERC-20 token details, which can be useful for building dashboards, portfolio trackers, and other applications.
Conclusion
In this guide, we showed you how to use the qn_fetchNFTs
method to quickly fetch all NFTs owned by a wallet. Whether you’re building an explorer, collector dashboard, or NFT game, this method and other NFT-related methods in the bundle can save you time and complexity.
If you have any questions, feel free to use our Discord server or provide feedback using the form below. Stay up to date with the latest by following us on Twitter and our Telegram announcement channel.
We ❤️ Feedback!
Let us know if you have any feedback or requests for new topics. We'd love to hear from you.