Links

nft_metadata

Gets the NFT's metadata with contract address and token id.
Through nft_metadata, you can fetch the detailed metadata information like specific description of the certain NFT, the link of the image in IPFS and token URI, etc., contractAddress and tokenId are necessary. Using this API, you could acquire abundant information of the certain NFT you want to get acknowledge.
Supported on Ethereum, BNB Chain, Optimism, and Arbitrum.

Parameters

Object - An object with the following fields (required):
  • contractAddress(hex string, required) - the contract address of the collection. BlockVision currently support both ERC721 and ERC1155.
  • tokenId(string, required) - the id of the NFT. Can be in decimal format.

Returns

Object - An object with the following fields:
  • id(integer number) - JSON-RPC id.
  • jsonrpc(string) - JSON-RPC version.
  • result(object) - an object with the following fields:
    • contractAddress(string) - contract address.
    • tokenID(string) - id of the NFT.
    • tokenURI(hex string) - URI of the NFT.
    • protocol(string) - metadata storage protocol, The enumeration value is http, https, ipfs, or "".
    • image(string) - image address.
    • name(string) - name for NFT.
    • description(string) - description for NFT.
    • ercStandard(string) - ERC standard for NFT, The enumeration value is erc721, erc1155, or "".
    • attributes(array of object) - traits/attributes/characteristics for each NFT asset.

Example

Request

curl
TypeScript
curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"id": 1,
"jsonrpc": "2.0",
"method": "nft_metadata",
"params": {
"tokenId": "1",
"contractAddress": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d"
}
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.ETH_MAINNET)
// Access the BlockVision NFT API
bv.getNFTMetadata({
tokenId: '1',
contractAddress: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'
}).then(console.log)

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"contractAddress": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"tokenID": "1",
"tokenURI": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/1",
"protocol": "ipfs",
"image": "ipfs://QmPbxeGcXhYQQNgsC6a36dDyYUcHgMLnGKnF8pVFmGsvqi",
"name": "",
"description": "",
"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"
}
],
"ercStandard": "erc721"
}
}