The primary object in the OpenSea API is the asset, which represents a unique digital item whose ownership is managed by the blockchain. The below CryptoSaga hero is an example of an asset shown on OpenSea.

26362636

Here's an overview of some of the fields contained in an asset:

Field Name

Description

Notes

token_id

The token ID of the NFT

image_url

An image for the item. Note that this is the cached URL we store on our end. The original image url is image_original_url

background_color

The background color to be displayed with the item

name

Name of the item

external_link

External link to the original website for the item

traits

A list of traits associated with the item (see traits section)

last_sale

When this item was last sold (null if there was no last sale)

collection

see Collection Model

asset_contract

see Asset Contract Model

owner

see Account Model

deprecated - use 'top_ownerships' instead

top-ownerships

array of Accounts (see Account Model)

ERC721: returns current owner
ERC1155: returns all owners

rarity_data

Contains rarity data for the asset. See Rarity Data below.

Only contains data if the creator has enabled rarity (check field is_rarity_enabled on the Collection model), else null.

Traits

Traits are special properties on the item, that can either be numbers or strings. Below is an example of how OpenSea displays the traits for a specific item.

10681068

Here are some of the fields contained in a trait:

Field Name

Type

Description

trait_type

string

The name of the trait (for example color)

value

string or number

The value of this trait (can be a string or number)

display_type

string

How this trait will be displayed (options are number, boost_percentage, boost_number, and date). See the adding metadata section for more details

Rarity Data

Rarity data contains the calculated rarity information of an asset within a collection. This data is stored on the asset model under the field rarity_data.

Field Name

Type

Description

strategy_id

string

The rarity strategy string identifier. Current value will be "openrarity”.

strategy_version

string

The version of the strategy.

For “openrarity”, this will be the python package version of the OpenRarity library used to calculate the returned score and rank.

rank

int

The rank of the asset within the collection, calculated using the rarity strategy defined by strategy_id and strategy_version.

score

float

The rarity score of the asset, calculated using the rarity strategy defined by strategy_id and strategy_version.

calculated_at

timestamp

The time we calculated rarity data at, as a timestamp in UTC.

Note: This may not equal the time a creator has uploaded or changed metadata.

max_rank

int

The maximum rank in the collection. Ranking for an asset should be considered the out of <max_rank>.

Typically max_rank will be equal to collection supply if all assets have been fully revealed with metadata loaded into opensea system, and every asset has unique ranks.

Before reveal is complete, rarity_data.max_rank < collection.stats.total_supply.

tokens_scored

int

The total tokens in the collection that have non-null traits and was used to calculate rarity data.

This will equal collection.stats.total_supply once Opensea has the revealed trait data for all assets in the collection.