NFT API
Get NFT Metadata

Get NFT Metadata

Overview

The Get NFT Metadata endpoint obtains metadata on a specific NFT. For a search, you must specify both tokenId and contract, which are required path parameters.

A successful request to the endpoint will return a JSON response with metadata on a specific token, along with data on its collection, transfer, and sale_price. The transfer data will feature the following fields: transaction_hash, block_number, block_timestamp, from_address, to_address, and origin.

Usage

In this example, we receive data metadata on a specific NFT with the contract 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D and ID 1.

import * as Parsiq from '@parsiq/parsiq.js';
 
const client = Parsiq.createClient(process.env.API_KEY, Parsiq.ChainId.ETH_MAINNET);
 
const metadata = await client.nft.getMetadata(`1`, '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D');
 
console.log(metadata)

Output:

{
 "metadata": {
  "content": {
   "image": "ipfs://QmPbxeGcXhYQQNgsC6a36dDyYUcHgMLnGKnF8pVFmGsvqi",
   "attributes": [
    {
     "trait_type": "Mouth",
     "value": "Grin"
    },
    {
     "trait_type": "Clothes",
     "value": "Vietnam Jacket"
    },
    {
     "trait_type": "Background",
     "value": "Orange"
    },
    {
     "trait_type": "Eyes",
     "value": "Blue Beams"
    },
    {
     "trait_type": "Fur",
     "value": "Robot"
    }
   ]
  },
  "is_json": true,
  "token_uri": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1"
 }
}

Parameters

Path params
chainId
string
REQUIRED
version
string
REQUIRED
contract
string
REQUIRED
tokenId
number
REQUIRED
Query params
estimate_cu
boolean