How to store your NFT metadata on IPFS

This page describes how you can store your NFT metadata on InterPlanetary File System (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 metadta on IPFS will not allow you to update it in the future.

Prerequisutes

  1. You already have an NFT collection (contract) created using the NFT-API. Click here to view the getting started guide if you haven't.
  2. contractAddress: The public address of your contract.

Request Endpoint: reference

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.

POST /api/v2/token-types/creations

Request Body

๐Ÿ“˜

At the very end, in the storage object, we have defined the "type": "ipfs".

{
  "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

{
  "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",
              "value": "Leadership",
              "traitType": "Talent",
              "trait_type": "Talent"
            },
            {
              "type": "property",
              "name": "Allergic",
              "value": "Monstonuts",
              "traitType": "Allergic",
              "trait_type": "Allergic"
            },
            {
              "type": "property",
              "name": "Hobby",
              "value": "Scouts",
              "traitType": "Hobby",
              "trait_type": "Hobby"
            },
            {
              "type": "stat",
              "name": "Cool",
              "value": "9",
              "maxValue": "10",
              "displayType": "number",
              "display_type": "number",
              "traitType": "Cool",
              "trait_type": "Cool"
            },
            {
              "type": "stat",
              "name": "Daring",
              "value": "8",
              "maxValue": "10",
              "displayType": "number",
              "display_type": "number",
              "traitType": "Daring",
              "trait_type": "Daring"
            },
            {
              "type": "stat",
              "name": "Noise",
              "value": "8",
              "maxValue": "10",
              "displayType": "number",
              "display_type": "number",
              "traitType": "Noise",
              "trait_type": "Noise"
            },
            {
              "type": "stat",
              "name": "Age",
              "value": "3",
              "displayType": "number",
              "display_type": "number",
              "traitType": "Age",
              "trait_type": "Age"
            },
            {
              "type": "boost",
              "name": "Crafting",
              "value": "+5",
              "displayType": "boost_number",
              "display_type": "boost_number",
              "traitType": "Crafting",
              "trait_type": "Crafting"
            },
            {
              "type": "boost",
              "name": "Leadership",
              "value": "+10",
              "displayType": "boost_number",
              "display_type": "boost_number",
              "traitType": "Leadership",
              "trait_type": "Leadership"
            },
            {
              "type": "system",
              "name": "tokenTypeId",
              "value": "6",
              "traitType": "Token Type ID",
              "trait_type": "Token Type ID"
            },
            {
              "type": "property",
              "name": "maxSupply",
              "value": "25",
              "traitType": "Max Supply",
              "trait_type": "Max Supply"
            }
          ],
          "contract": {
            "address": "0xf5b11b4f458cc12a7989a146c5db2e7d500e2241",
            "name": "Test",
            "symbol": "TE",
            "image": "string",
            "imageUrl": "string",
            "image_url": "string",
            "description": "Testing",
            "externalLink": "www.venly.io",
            "external_link": "www.venly.io",
            "externalUrl": "www.venly.io",
            "external_url": "www.venly.io",
            "media": [],
            "type": "ERC_1155"
          },
          "fungible": false
        }
      }
    ]
  }
}