How to Get an NFT by Unique ID
Follow this tutorial to learn how to get an NFT by Unique ID.
This tutorial explains the steps to get any Ethereum Mainnet NFT by its unique ID. The response contains the attributes, mint date, type of a given NFT, and other associated details.
Step 1. Use the assets endpoint to get a list of NFTs.
For example, you can follow these steps: How to Get All NFTs for a Smart Contract
Step 2. Copy an asset ID from the id
field:
{
"id": "5e1f4454-34ff-5118-9987-96b481625128",
"token_id": "9999",
...more properties...
}
Step 3. Use the asset endpoint with the following details:
-
protocol:
ethereum
-
network:
mainnet
-
asset ID:
5e1f4454-34ff-5118-9987-96b481625128
(copied in the previous step)https://svc.blockdaemon.com/nft/v1/ethereum/mainnet/asset/5e1f4454-34ff-5118-9987-96b481625128
Step 4. Execute the query.
For example, in cURL, you should run the following code:
curl -X GET 'https://svc.blockdaemon.com/nft/v1/ethereum/mainnet/asset/5e1f4454-34ff-5118-9987-96b481625128' -H 'Authorization: Bearer YOUR_API_KEY'
Note!
To authorize your request, you need to get an API key and use it as a bearer token or a query parameter. Learn more: Authentication Guide
Step 5. Your results will look something like this:
{
"asset": {
"token_id": "9999",
"token_type": "ERC721",
"media": {
"image_url": "token/0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D/5e1f4454-34ff-5118-9987-96b481625128.png",
"source": "ipfs://QmejYePrutbfWEV8wA3ogTHi2cf2j6hoaPhZSc6vNE43nH"
},
"name": "#9999",
"mint_date": "1619858117",
"token_uri": "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/9999",
"description": "",
"contract_address": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"wallets": [],
"attributes": [
{
"trait_type": "Hat",
"value": "Army Hat"
},
{
"trait_type": "Background",
"value": "Purple"
},
{
"trait_type": "Mouth",
"value": "Bored Unshaven"
},
{
"trait_type": "Earring",
"value": "Gold Hoop"
},
{
"trait_type": "Fur",
"value": "Gray"
},
{
"trait_type": "Eyes",
"value": "Scumbag"
}
],
"burned": false,
"rarity": [
{
"model": "open_rarity",
"score": 0.9954297307820068,
"rank": "5327"
}
]
}
}
The token type is returned by the token_type
field, e.g.:
"token_type": "ERC721"
The mint date is returned in Unix time by the mint_date
field:
"mint_date": "1619858117"
Attributes are located in the attributes
section:
"attributes": [
{
"trait_type": "Hat",
"value": "Army Hat"
},
{
"trait_type": "Background",
"value": "Purple"
},
{...more attributes...}
]
👋 Need Help?
Contact us through email or our support page for any issues, bugs, or assistance you may need.
Updated about 1 month ago