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.

Querying via Postman

If you prefer querying via Postman, the description of PARSIQ Endpoints for Get NFT Metadata (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 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 nftMetadata = await client.nft.getMetadata(
    `1`,
    '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D'
);
 
console.log(nftMetadata)

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