Skip to main content

qn_fetchNFTs (v2) RPC Method

Returns aggregated data on NFTs for a given wallet.

Updated on
Aug 21, 2024

qn_fetchNFTs (v2) RPC Method

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
An array with the first element being:
object
A custom object with the following fields:
wallet
string
The wallet address or ENS name to check for NFTs
contracts
string
An array of strings with the list of NFT contract addresses you'd like to get ownership data from. The contract addresses may be optionally suffixed with :tokenId to specify a specific NFT id to filter on. For example, 0x2106c...7aeaa:1234will filter Loopy Donuts on the NFT token with id1234 only. You may include up to 20 contract addresses per request
page
integer
The page number you would like to get returned. The 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
The maximum amount of NFT assets to return on each page. You can request up to 40 items per page. If omitted, this will default to 20 items per page
omitFields
array
Optionally omit specific properties of objects from the assets array of the response. Any property of the asset object can be omitted. If omitFields is not included in the request, response will return all available fields by default

Returns

object
The custom response object, or null if no NFTs are found:
owner
The wallet address we checked for NFTs
ensName
string
The ENS name associated with the address we checked
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
traits
The traits refer to the different attributes of NFTs
value
The specific value associated with each trait of the NFT which can be present in the form of text, numbers, or even images, depending on the type of NFT
trait_type
The type of trait associated with each NFT. It includes attributes like the color, rarity, or any other defining characteristic that sets the NFT apart from others in its collection
imageUrl
The URL where the image for this NFT can be seen
collectionAddress
The contract address that this NFT lives in
chain
It states on which chain this aggregation happened on
network
It states on which network this aggregation happened on
description
The description of the asset
totalItems
The total number of results
totalPages
The total number of results pages available
pageNumber
The page number of results that were returned with this response
Request
1
curl https://docs-demo.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{
5
"id":67,
6
"jsonrpc":"2.0",
7
"method":"qn_fetchNFTs",
8
"params": [{
9
"wallet": "0x91b51c173a4bdaa1a60e234fc3f705a16d228740",
10
"omitFields": [
11
"traits"
12
],
13
"page": 1,
14
"perPage": 10,
15
"contracts": [
16
"0x2106c00ac7da0a3430ae667879139e832307aeaa",
17
"0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
18
]
19
}]
20
}'
21
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free