Log In

getNFTMetadata - NFT API

Gets the metadata associated with a given NFT.

This endpoint is supported on the following chains and networks:

  • Conflux: Core

Parameters

  • contractAddress: [string] address of NFT contract
  • tokenId: [integer or hexadecimal] Id for NFT

Returns

  • JSON Object containing the following fields and potentially more fields.
    • contract: contract for returned NFT
      • address: address of NFT contract
    • id
      • tokenId: Id for NFT (integer or hexadecimal, depending on parameter tokenId type)
      • tokenMetadata
        • tokenType: "CRC-721" or "CRC-1155"
    • tokenUri:
      • raw: Uri representing the location of the NFT's original metadata blob. This is a backup for you to parse when the metadata field is not automatically populated.
      • gateway: Public gateway uri for the raw uri above.
    • metadata: Relevant metadata for NFT contract. This is useful for viewing image url, traits, etc. without having to follow the metadata url in tokenUri to parse manually.
      • nameName of the NFT asset.
      • description: Human-readable description of the NFT asset. (Markdown is supported/rendered on OpenSea and other NFT platforms)
      • image: URL to the NFT asset image. Can be standard URLs pointing to images on conventional servers, IPFS or Arweave. Most types of images (SVGs, PNGs, JPEGs, etc.) are supported by NFT marketplaces.
    • timeLastUpdated: ISO timestamp of the last cache refresh for the information returned in the metadata field.

Example

Request

curl 'https://cfx-core.unifra.io/v1/cf455a9802364d88b8f87b5273d9ddbb/nft-api/getNFTMetadata?contractAddress=cfx:acff8dvjv6pys2ws19dhx753h1h00sum6yhu3m188h&tokenId=0x2713'

Response

{
    "contract": {
        "address": "cfx:acff8dvjv6pys2ws19dhx753h1h00sum6yhu3m188h"
    },
    "id": {
        "tokenId": "10003",
        "tokenMetadata": {
            "tokenType": "CRC-721"
        }
    },
    "title": "敦煌57窟如意美女菩萨-红光",
    "description": "代表2022年,你将需要红色能量守护,敦煌57窟如意美女菩萨祝福你鸿运当头,有如神助般顺顺利",
    "tokenUri": {
        "raw": "https://nft.taopainft.com/v1/token/metadata/8a5f0e288f1947624ebfc679f7793dcf6b3a0ae5/2713.json",
        "gateway": "https://nft.taopainft.com/v1/token/metadata/8a5f0e288f1947624ebfc679f7793dcf6b3a0ae5/2713.json"
    },
    "metadata": {
        "name": "敦煌57窟如意美女菩萨-红光",
        "description": "代表2022年,你将需要红色能量守护,敦煌57窟如意美女菩萨祝福你鸿运当头,有如神助般顺顺利",
        "image": "https://taopainft.oss-cn-hangzhou.aliyuncs.com/%E4%B8%9D%E9%81%93%E5%A5%87%E5%8D%8Ecfx%3Aacff8dvjv6pys2ws19dhx753h1h00sum6yhu3m188h/%E8%A7%86%E9%A2%91%E6%A0%BC%E5%BC%8F%E4%BF%AE%E6%94%B90107/10001-14500_%E5%A6%82%E6%84%8F%E7%BE%8E%E5%A5%B3%E8%8F%A9%E8%90%A8-%E7%BA%A2%E5%85%89.mp4"
    },
    "timeLastUpdated": "2022-07-11T13:09:04.784001Z"
}
Language
Click Try It! to start a request and see the response here!