Get NFT by Address
Overview
The Get NFT by Address endpoint obtains data on all NFTs currently owned by an EOA wallet, whose address
is a required path parameter. Results are sorted in descending order, so the most recently acquired NFT will
appear at the top. To refine your search, you can add a contract
address as a query parameter. Additionally,
metadata
and sale_price
can be included by setting their field values to true
.
A successful request to the endpoint returns a JSON response with data on the owned NFTs,
labeled as items. These items include their id
, token_id
, collection
and transfer
data,
along with metadata
and sale_price
if you opt to include them in your response. The transfer
data features the following fields: sender
, block_number
, block_timestamp
, and tx_hash
.
Querying via Postman
If you prefer querying via Postman, the description of PARSIQ Endpoints for Get NFT by Address (opens in a new tab) might come in handy. There you will find examples and responses for good and bad requests as well as parameter definitions and their example values.
Usage
In this example, we receive data on all NFTs currently owned by the EOA wallet's address
0xb6042f438D63181E7E220A72e9fff845062EB48d
.
import * as Parsiq from '@parsiq/parsiq.js';
const client = Parsiq.createClient(process.env.API_KEY, Parsiq.ChainId.ETH_MAINNET);
const nfts = client.nft.getByAddress(
`0xb6042f438D63181E7E220A72e9fff845062EB48d`,
{metadata: true, sale_price: true},
{limit: 1}
);
for await (const nft of nfts) {
console.log(nft);
}
Output:
{
id: '0000000000efd251-00d6-00000006-00000',
token_id: '432',
collection: {
address: '0xe5e771bc685c5a89710131919c616c361ff001c6',
total_supply: '8750',
symbol: 'WZNFT',
name: 'WizNFT',
standard: 'ERC721'
},
transfer: {
sender: '0x54e09b5ac394d84c908cbdb8a5b949ede6779d97',
block_number: 15716945,
block_timestamp: 1665395771,
tx_hash: '0x1d65be0152becc8f7a1d18dc0614b7e019ecb077f5be1dfdf1043d316c54dbfb'
},
metadata: {
content: {
name: 'WZRD #432',
description: 'An epic saga, about the story of WZRDS and their Kingdom of Tyrol.',
image: 'https://wzrds.s3.amazonaws.com/images/71c33a35b67f1643b362838f.png',
attributes: [Array]
},
is_json: true,
token_uri: 'https://wzrds.xyz/metadata/432'
},
sale_price: {
value_raw: '9250000000000000',
value_calculated: '0.00925',
token_address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
token_decimals: 18,
token_symbol: 'WETH'
}
}
Parameters
chainId
version
address
contract
metadata
sale_price
offset
limit
estimate_cu