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
| Parameter | Type | Required | Description |
|---|---|---|---|
chain | String | Yes | Blockchain network name (e.g., Ethereum, Polygon). See supported networks. |
contractAddress | String | Yes | Valid NFT contract address. |
tokenId | String | Yes | Unique identifier of the NFT. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
name | String | NFT name. |
tokenId | String | Unique token ID. |
tokenUri | String | Metadata URI (JSON file containing NFT attributes). |
image | String | High-resolution image URL. |
imagePreviewUrl | String | Preview image URL (optimized for fast loading). |
imageThumbnailUrl | String | Thumbnail image URL. |
animationUrl | String | URL for audio/video assets (if applicable). |
attributes | Object | Custom traits (e.g., rarity, edition) following the attribute model. |
assetContracts | Object | Contract details (contract model). |
collection | Object | Collection 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
- Marketplace Integration: Display detailed NFT listings with rich metadata.
- Wallet Services: Show NFT holdings with visual thumbnails and attributes.
- Analytics Tools: Track rarity traits and collection trends.