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
| Field | Type | Description |
|---|---|---|
name | string | The name of the item. |
description | string | A human-readable description. Markdown is supported. |
image | URI | The 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_url | URI | A 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. |
attributes | array | Traits displayed on the item page and available for collection filtering. |
background_color | string | A six-character hexadecimal background color without a leading #. |
external_url | URI | A 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 type | Format |
|---|---|
| String | Use a string value. You do not need display_type. |
| Number | Use 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. |
| Date | Use Unix time in seconds with display_type: "date". |
| Boost | Use display_type: "boost_number" or display_type: "boost_percentage". |
| Generic string | Omit 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.
Updated about 4 hours ago
