Get NFT Details: API Guide for Retrieving Token Information

·

This API allows you to retrieve comprehensive details about NFTs, including token metadata, collection information, contract data, and special attributes. Below is the complete documentation for integrating this endpoint into your Web3 applications.


API Endpoint

GET https://web3.okx.com/api/v5/mktplace/nft/asset/detail

👉 Explore our NFT API solutions


Required Parameters

ParameterTypeRequiredDescription
chainStringYesBlockchain network name (e.g., Ethereum, Polygon). See supported networks.
contractAddressStringYesValid NFT contract address.
tokenIdStringYesUnique identifier of the NFT.

Response Parameters

ParameterTypeDescription
nameStringNFT name.
tokenIdStringUnique token ID.
tokenUriStringMetadata URI (JSON file containing NFT attributes).
imageStringHigh-resolution image URL.
imagePreviewUrlStringPreview image URL (optimized for fast loading).
imageThumbnailUrlStringThumbnail image URL.
animationUrlStringURL for audio/video assets (if applicable).
attributesObjectCustom traits (e.g., rarity, edition) following the attribute model.
assetContractsObjectContract details (contract model).
collectionObjectCollection metadata (collection model).

Example Request

curl -X GET "https://web3.okx.com/api/v5/mktplace/nft/asset/detail?chain=Ethereum&contractAddress=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D&tokenId=123"

👉 Need help with API integration?


Example Response

{
  "name": "CryptoPunk #123",
  "tokenId": "123",
  "tokenUri": "ipfs://QmXYZ...",
  "image": "https://example.com/punk123.png",
  "imagePreviewUrl": "https://example.com/punk123_preview.jpg",
  "imageThumbnailUrl": "https://example.com/punk123_thumb.jpg",
  "attributes": {
    "background": "blue",
    "type": "alien",
    "accessories": ["laser eyes"]
  },
  "assetContracts": {
    "name": "CryptoPunks",
    "address": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
  },
  "collection": {
    "name": "CryptoPunks",
    "description": "10,000 unique collectible characters."
  }
}

FAQ

1. What chains are supported for NFT queries?

This API supports Ethereum, Polygon, BNB Chain, and other major networks. Check the full list here.

2. How do I handle rate limits?

Standard rate limits apply (100 requests/minute). Use pagination for bulk queries.

3. Can I filter NFTs by attributes?

Yes, parse the attributes object to filter NFTs by traits like rarity or category.

4. Is metadata always stored on-chain?

No. Some NFTs use IPFS or centralized servers. The tokenUri field specifies the location.

5. How do I verify contract authenticity?

Cross-check the contractAddress with official project documentation or blockchain explorers.


Key Use Cases