How to get the owner of an NFT?

The historical price activity of NFT is a true reflection of the market value of NFT through the actual on-chain trading behavior that occurred.

If you are building an NFT analysis platform, trading tool, or other NFT ecological Dapps, we provide data services containing massive NFT historical trading data and price information to help you more comprehensively analyze and understand the specified NFT assets.

Retrieve an NFT

To call this endpoint, you need to fill in two parameters

  • contract_address (string): Address of the contract for an NFT collection, beginning with 0x
  • token_id (integer): The token ID for the specific NFT. Each NFT will be assigned a unique id, the value generally ranges from 1 to N, with N being the total number of NFTs in a collection.

And add the following code to the main.js

import fetch from 'node-fetch';

// Replace with your NFTGo API key:
const apiKey = "YOUR-API-KEY";
const options= {
  method: 'GET',
  headers: {
    accept: 'application/json',
    'X-API-KEY': apiKey
  }
};
// Replace with the contract address you want to query:
const contractAddress = "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"
// Replace with the token id you want to query:
const tokenId = "4495"
const url = `https://data-api.nftgo.io/eth/v1/nft/${contractAddress}/${tokenId}/metrics`;
;

// Make the request and print the formatted response:
fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));

Your output should look like this.

{
  "last_updated": 1652598929,
  "sale_num_7d": 0,
  "sale_num_all": 4,
  "max_price": {
    "tx_hash": "0x8443c7fd50cecbfac1e5a330fed8e53ee8e611c6029dcbd6097ca729c9360328",
    "price_token": 98.5,
    "token_symbol": "ETH",
    "token_contract_address": "0x0000000000000000000000000000000000000000",
    "price_usd": 202001.28197466402,
    "price": {
      "quantity": 98.5,
      "value": 98.5,
      "crypto_unit": "ETH",
      "usd": 202001.28197466402
    },
    "tx_url": "https://etherscan.io/tx/0x8443c7fd50cecbfac1e5a330fed8e53ee8e611c6029dcbd6097ca729c9360328",
    "time": 1651506757
  },
  "min_price": {
    "tx_hash": "0xf28cc8354a14b627632a81dd7d87e0edbf9c40f9d0c94ee4cda0f13f07ec1b7c",
    "price_token": 0.15,
    "token_symbol": "ETH",
    "token_contract_address": "0x0000000000000000000000000000000000000000",
    "price_usd": 425.0667547828569,
    "price": {
      "quantity": 0.15,
      "value": 0.15,
      "crypto_unit": "ETH",
      "usd": 425.0667547828569
    },
    "tx_url": "https://etherscan.io/tx/0xf28cc8354a14b627632a81dd7d87e0edbf9c40f9d0c94ee4cda0f13f07ec1b7c",
    "time": 1619864413
  },
  "last_price": {
    "tx_hash": "0x8443c7fd50cecbfac1e5a330fed8e53ee8e611c6029dcbd6097ca729c9360328",
    "price_token": 98.5,
    "token_symbol": "ETH",
    "token_contract_address": "0x0000000000000000000000000000000000000000",
    "price_usd": 202001.28197466402,
    "price": {
      "quantity": 98.5,
      "value": 98.5,
      "crypto_unit": "ETH",
      "usd": 202001.28197466402
    },
    "tx_url": "https://etherscan.io/tx/0x8443c7fd50cecbfac1e5a330fed8e53ee8e611c6029dcbd6097ca729c9360328",
    "time": 1652571359
  },
  "avg_price_usd": {
    "3M": 197405.47912092094,
    "1y": 197405.47912092094,
    "all": 98988.12209388186
  },
  "past_owners": [
    {
      "address": "0x6e185658442ab2a27f86402fc36b379c8ffc76f8",
      "holding_time": 32588789
    },
    {
      "address": "0x0232d1083e970f0c78f56202b9a666b526fa379f",
      "holding_time": 92988
    },
    {
      "address": "0xcc22f5b0f39d10be2a5414a53650b281538130a9",
      "holding_time": 23971
    },
    {
      "address": "0x7baf191cfaa4a0b08991fb728179baaf3917836a",
      "holding_time": 9818
    },
    {
      "address": "0x1050aa5151ba80d37e437c5253ee9476b82aadf1",
      "holding_time": 1198
    },
    {
      "address": "0x2cca12bfe9554596509acfa437af75d7937635f5",
      "holding_time": 605
    }
  ],
  "create_time": 1619854595,
  "start_holding_time": 1652571964,
  "longest_holding_time": 32588789
}