Function searchNFTs filter by field name

I canā€™t filter on the keys that are in the metadata, I can only search on the ā€œnameā€ key, but not on the other keys, I created a key called ā€œartistIdā€ which contains the name and first name from the artist to be able to filter the nfts by artist but I get this error ā€œmessageā€: ā€œfilter must be a valid enum valueā€

Can you give a complete example that works and one that doesnā€™t work?

yes, in the metadata I have several keys, via the moralis function ā€œsearchNFTsā€ I managed to search for the nfts via the basic key ā€œnameā€ so it works but when I try to filter via another key in the metadata it works no, I added a key in the metadata which is called ā€œartistIdā€ and therefore I try to find all the nfts that belong to an artist via the ā€œartistIdā€ key which is in the metadata but it does not work I receive the following message ā€œfilter must be a valid enum valueā€

I think that current functionality works only with a set of predefined keys

could you tell me which ones please !

They should be listed in a drop down in documentation when you try the endpoint. One of them is global to search on all the metadata

Iā€™ll get back when I have more info

Hello, have you found a few things for me please!?

based on v1 documentation https://v1docs.moralis.io/moralis-dapp/web3-api/nft-api#searchnfts

these are the available options:

filter(required): What fields the search should match on. To look into the entire metadata set the value to global. To have a better response time you can look into a specific field like name. Available values : name; description; attributes; global; name,description; name,attributes; description,attributes; name,description,attributes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.