NFT Metadata in Insight

NFT Metadata in Insight

We are now supporting NFT metadata for Insight NFT balance endpoints (ERC-721 and ERC-115).

By adding metadata=true query parameter to the request, the response will include metadata about the NFT - name, description, image URL, background color, external URL, collection and contract info in addition to the balance.

Here's an example of the data that can be returned:

{
  "chainId": 137,
  "tokenAddress": "0x819384ee58c4aadcf170a78728addafb6301d871",
  "tokenId": "3907",
  "balance": "1",
  "name": "Cloude Doodle #3907",
  "description": "The Doodle Cloud Kingdom is an ally of the Bekantan Kingdom to defend and show strength.",
  "image_url": "ipfs://QmVCu8NRuKUb64jDQqg3fsPrXa19W37Y7Cx2Vo8C5fdZe5/3907.png",
  "extra_metadata": {
    "dna": "20a571eaae29e115ed30716bf4282f7663ab3f7c",
    "edition": 3907,
    "date": 1660320491602,
    "attributes": [
        {
          "trait_type": "Background",
          "value": "Gradient (55)"
        },
        {
          "trait_type": "Body",
          "value": "Cumulos (61)"
        },
        {
          "trait_type": "Hat",
          "value": "Bando (7)"
        },
        {
          "trait_type": "Mouth",
          "value": "Stoic"
        },
        {
          "trait_type": "Eyes",
          "value": "Villain"
        },
        {
          "trait_type": "Nose",
          "value": "Disgusted (57)"
        }
    ],
    "compiler": "HashLips Art Engine"
  },
  "collection": {
    "name": "Cloude Doodle"
  },
  "contract": {
    "type": "ERC721",
    "name": "Cloude Doodle",
    "symbol": "CLD"
  }
}

Try it out on our playground

Or call it directly from code

const getNFTsWithMetadata = async (address: string) => {
  try {
    const response = await fetch(
      `https://1.insight.thirdweb.com/v1/tokens/erc721/${address}?metadata=true`,
      {
        headers: {
          "x-client-id": <your-client-id>,
        },
      },
    );
    const response = await response.json();
    return response;
  } catch (error) {
    console.error("Error:", error);
  }
};

📖 Learn more about Insight - it’s open source and ready to power your applications!