Store NFT Metadata on IPFS
Store NFT Metadata on IPFS
In this guide, we will look into how you can effortlessly store the metadata of an NFT on IPFS. Note that storing the metadata on IPFS will happen during the creation of the token-type (NFT tenplate).
📘Storing the metadata on IPFS will not allow you to update it in the future.
Prerequisutes
You already have an NFT collection (contract) created using the NFT-API. View the Getting Started guide if you haven't.
contractAddress
: The public address of your contract.
Request Endpoint: reference
HTTP
POST /api/v2/token-types/creations
Example Request
We will use the create token-type endpoint and within the request body, we will specify the storage type for the metadata.
HTTP
POST /api/v2/token-types/creations
Request Body
📘At the very end, in the
storage
object, we have defined the"type": "ipfs"
.
JSON
{
"secretType": "MATIC",
"contractAddress": "0xf5b11b4f458cc12a7989a146c5db2e7d500e2241",
"creations": [{
"name": "NFT with metadata on IPFS",
"description": "This NFTs metadata is stored on IPFS",
"image": "https://static.wikia.nocookie.net/parody/images/4/42/74915084_10162764640400387_6139958579186106368_o.jpg",
"backgroundColor": "#eeeeee",
"externalUrl": "https://en.wikipedia.org/wiki/Space_Chickens_in_Space",
"animationUrls": [{
"type": "video",
"value": "https://img.arkane.network/marketing/SpaceChickens/space_chickens_trailer.mp4"
},
{
"type": "audio",
"value": "https://file-examples-com.github.io/uploads/2017/11/file_example_WAV_10MG.wav"
}
],
"maxSupply": "25",
"fungible": false,
"burnable": true,
"attributes": [{
"type": "property",
"name": "Talent",
"value": "Leadership"
},
{
"type": "property",
"name": "Allergic",
"value": "Monstonuts"
},
{
"type": "property",
"name": "Hobby",
"value": "Scouts"
},
{
"type": "stat",
"name": "Cool",
"value": "9",
"maxValue": "10"
},
{
"type": "stat",
"name": "Daring",
"value": "8",
"maxValue": "10"
},
{
"type": "stat",
"name": "Noise",
"value": "8",
"maxValue": "10"
},
{
"type": "stat",
"name": "Age",
"value": "3"
},
{
"type": "boost",
"name": "Crafting",
"value": "+5"
},
{
"type": "boost",
"name": "Leadership",
"value": "+10"
}
],
"storage": {
"type": "ipfs"
}
}]
}
Response Body
JSON
{
"success": true,
"result": {
"creations": [
{
"id": "bd008bca-9a22-4f2a-9f97-79fa78a803bb",
"status": "PENDING",
"tokenTypeId": 6,
"metadata": {
"name": "NFT with metadata on IPFS",
"description": "This NFTs metadata is stored on IPFS",
"image": "https://static.wikia.nocookie.net/parody/images/4/42/74915084_10162764640400387_6139958579186106368_o.jpg",
"imagePreview": "https://static.wikia.nocookie.net/parody/images/4/42/74915084_10162764640400387_6139958579186106368_o.jpg",
"imageThumbnail": "https://static.wikia.nocookie.net/parody/images/4/42/74915084_10162764640400387_6139958579186106368_o.jpg",
"backgroundColor": "#eeeeee",
"background_color": "#eeeeee",
"animationUrl": "https://img.arkane.network/marketing/SpaceChickens/space_chickens_trailer.mp4",
"animation_url": "https://img.arkane.network/marketing/SpaceChickens/space_chickens_trailer.mp4",
"externalUrl": "https://en.wikipedia.org/wiki/Space_Chickens_in_Space",
"external_url": "https://en.wikipedia.org/wiki/Space_Chickens_in_Space",
"animationUrls": [
{
"type": "video",
"value": "https://img.arkane.network/marketing/SpaceChickens/space_chickens_trailer.mp4"
},
{
"type": "audio",
"value": "https://file-examples-com.github.io/uploads/2017/11/file_example_WAV_10MG.wav"
}
],
"attributes": [
{
"type": "property",
"name": "Talent",
Last updated