/configure-marketplace metadatafilter add

Add a metadata filter to an existing tracker

Black Edition

The /configure-marketplace metadatafilter add command enables you to fine tune your trackers to only post information about items that match specific metadata traits. You can have none, one or multiple filters active at the same time and combine them in powerful ways, to target exactly the specific set of items you would like to. You can use it to exclude certain traits, find 1/1s, or only track mints of the Green underwear items in your collection.

To get a metadata filter role working, simply start with the normal process of adding a tracker via /configure-marketplaces sales add or the respective commands for mint or listing trackers. After adding the tracker, you can add metadata filters via /configure-marketplace metadatafilter add. When adding a filter, you will be asked for four things. The tracker-id (which you can retrieve from /configure-marketplace sales list or the other list commands) is the first one and indicates which tracker the filter will be applied to. The attribute path is the second parameter and determines where in your metadata we will search for the specific attribute you would like to include or exclude. The operator specifies how we search for data in your retrieved attribute. Lastly, we ask for an attribute-value, meaning the content you want to include or exclude. A detailed explanation of all parameters is provided below our examples.

If you are not sure how to build the correct attribute-path or attribute-value, you can leverage our Metadata filter builder to help you out.

It is important to note that both attribute-path and attribute-value are case sensitive and need to exactly match your metadata. If your metadata attribute is Rarity, using an attribute-path rarity will NOT work.

When having special characters and whitespace in your attribute path, you may have to wrap your attribute names in double quotes or use a native JSONpath expression. Please see our examples below for specifics.

Examples

See examples in our documentation on /configure-tokenroles metadatafilter add

Parameters

ParameterDetails
tracker-id

The tracker ID to which you would like to add a metadata filter. You can find this ID via /configure-marketplace sales list or the respective commands for mint and listing trackers.

attribute-path

The attribute name or JSON path within your NFT metadata that you would like to filter values for. See below for some common examples of attributes and respective metadata.

operator

Once the attribute has been extracted, what operator would you like to compare the value to. The operator can be one of the following:

equals

The text extracted from attribute-path must exactly match (case sensitive) the attribute-value. Use this only when the targeted attribute is a number or text.

does not equal

The text extracted from attribute-path may not be exactly the same (case sensitive) as the text provided via the attribute-value. Use this only when the targeted attribute is a number or text.

contains

The contains operator works with both text and list attributes (see examples below). If the data extracted from attribute-path is a text, the filter condition is met if it contains the text (case sensitive) provided via attribute-value.

If the data extracted from attribute-path is a list, the filter condition is met if any one of the items in the list exactly matches (case sensitive) the text from the attribute-value parameter.

does not contain

The does not contain operator works with both text and list attributes (see examples below). If the data extracted from attribute-path is a text, the filter condition is met if it does not contain the text (case sensitive) provided via attribute-value.

If the data extracted from attribute-path is a list, the filter condition is met if none one of the items in the list matches (case sensitive) the text from the attribute-value parameter.

starts with

The text extracted from attribute-path must start with the same (case sensitive) as the text provided via the attribute-value. Use this only when the targeted attribute is a number or text.

ends with

The text extracted from attribute-path must end with the same (case sensitive) as the text provided via the attribute-value. Use this only when the targeted attribute is a number or text.

attribute-value

The attribute value is what the filter will compare the content found via the attribute-path with. For more details, including specific examples for various NFTs, see the documentation for /configure-tokenroles metadatafilter add.