Media and traits

Add media, display fields, and attributes to token metadata

Token metadata defines the information and media OpenSea shows for an NFT.

{
  "name": "Dave Starbelly",
  "description": "Friendly OpenSea Creature that enjoys long swims in the ocean.",
  "image": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png",
  "external_url": "https://openseacreatures.io/3",
  "attributes": [
    {
      "trait_type": "Base",
      "value": "Starfish"
    }
  ]
}

Supported fields

FieldTypeDescription
namestringThe name of the item.
descriptionstringA human-readable description. Markdown is supported.
imageURIThe image for the item. OpenSea supports most image formats, including SVG, which OpenSea caches as PNG. Use images at least 3000 by 3000 pixels.
animation_urlURIA multimedia attachment. Supported extensions are GLTF, GLB, WEBM, MP4, M4V, OGV, OGG, MP3, WAV, and OGA. It can also point to an HTML page. Scripts and relative paths within that page are supported, but browser extensions are not.
attributesarrayTraits displayed on the item page and available for collection filtering.
background_colorstringA six-character hexadecimal background color without a leading #.
external_urlURIA link from the item page to your site.

OpenSea supports externally hosted media up to 300 MB. Keep files below 200 MB when possible to reduce load time.

Attributes

Each attribute has a value. Add trait_type to label it, and add display_type when OpenSea should display a number or date in a specific format.

{
  "attributes": [
    {
      "trait_type": "Base",
      "value": "Starfish"
    },
    {
      "display_type": "number",
      "trait_type": "Generation",
      "value": 2,
      "max_value": 10
    },
    {
      "display_type": "date",
      "trait_type": "Birthday",
      "value": 1546360800
    }
  ]
}
Attribute typeFormat
StringUse a string value. You do not need display_type.
NumberUse an integer or float with display_type: "number". max_value is optional. If omitted, OpenSea uses the highest value it has seen for that trait on the contract.
DateUse Unix time in seconds with display_type: "date".
BoostUse display_type: "boost_number" or display_type: "boost_percentage".
Generic stringOmit trait_type and provide only a string value.

Use strings for string traits and numbers for numeric traits. A numeric value wrapped in quotes is treated as a string.