NFT API
Get NFT History

Get NFT History

Overview

The Get NFT History endpoint obtains data on all EOA wallets that have once owned a specific NFT. Results are sorted in ascending order, so the initial owner of the token will appear at the top. For a search, you must specify both tokenId and contract, which are required path parameters. Additionally, metadata and sale_price can be included by setting their field values to true.

A successful request to the endpoint will return a JSON response with data on token ownership history, labeled as items. These items will include their id and transfer data, along with metadata and sale_price if you opt to include them in your response. The transfer data will feature the following fields: from_address, to_address, origin, block_number, block_timestamp, and tx_hash.

Usage

In this example, we receive data on all EOA wallets that have once owned a specific NFT with the contract 0x282BDD42f4eb70e7A9D9F40c8fEA0825B7f68C5D and ID 5340.

import * as Parsiq from '@parsiq/parsiq.js';
 
const client = Parsiq.createClient(process.env.API_KEY, Parsiq.ChainId.ETH_MAINNET);
 
const nftHistory = client.nft.getTokenHistory(
    '5340',
    `0x282BDD42f4eb70e7A9D9F40c8fEA0825B7f68C5D`,
    {sale_price: true},
    {limit: 1}
);
 
for await (const nft of nftHistory) {
    console.log(nft);
}

Output:

{
  id: '0000000000d6cef0-000e-00000005-00000',
  transfer: {
    from: '0x0000000000000000000000000000000000000000',
    to: '0x5b098b00621eda6a96b7a476220661ad265f083f',
    origin: '0x5b098b00621eda6a96b7a476220661ad265f083f',
    block_number: 14077680,
    block_timestamp: 1643152326,
    tx_hash: '0x6ed7aee8e00c21046871cc2832a327b2a805b9f8ce60d7d807cb75d3e7547712'
  },
  sale_price: {
    value_raw: '1',
    value_calculated: null,
    token_address: '0x6ba6f2207e343923ba692e5cae646fb0f566db8d',
    token_decimals: null,
    token_symbol: 'Ͼ'
  }
}

Parameters

Path params
chainId
string
REQUIRED
version
string
REQUIRED
contract
string
REQUIRED
tokenId
number
REQUIRED
Query params
metadata
boolean
sale_price
boolean
offset
string
limit
number
estimate_cu
boolean