4.通过合约地址和TokenID获取NFT元数据
GET
https://api-testnet.confluxscan.net/nft/preview通过合约地址和TokenID获取NFT元数据。返回格式见示例值
请求参数
Query 参数
contract
string
合约地址
示例值:
cfxtest:acb3vn9rxjcvwfbvzn92wcybe4f0th45np8tfh46sx
tokenId
string
必需
NFT的tokenid
示例值:
1
withMetadata
string
默认填true
示例值:
true
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
code
integer
请求返回代码
-1代表失败,0代表成功
message
string
请求返回消息
请求返回的附加信息
data
object
必需
contract
string
合约地址
tokenId
integer
NFT的tokenid
name
string
NFT名称
image
string
NFT的封面
description
string
NFT简介
rawData
object
必需
示例
{
"code": 0,
"message": "OK",
"data": {
"contract": "cfxtest:acb3vn9rxjcvwfbvzn92wcybe4f0th45np8tfh46sx",
"tokenId": 1,
"name": "测试徽章1",
"image": "https://ipfs.jugugu.cn/ipfs/QmUZdqvb4TX5ACxTSjWqbo9un3gBnRW59gvDMFHZWefx2t",
"description": "测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1",
"rawData": {
"funcCall": "uri(1)",
"tokenUri": {
"raw": "https://ipfs.jugugu.cn/ipfs/QmaMb8nyHK5cUCNTpHLEWjYyUZWFsnWbKKt5nt8ftW1jEJ",
"gateway": ""
},
"metadata": {
"name": "测试徽章1",
"image": "https://ipfs.jugugu.cn/ipfs/QmUZdqvb4TX5ACxTSjWqbo9un3gBnRW59gvDMFHZWefx2t",
"description": "测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1测试徽章1",
"extra_image": null,
"attributes": [
{
"trait_type": "发行方",
"value": "mika"
}
]
}
}
}
}
最后修改时间: 2 年前