Using API to search "AND" between fields and "OR" within fields

Is there any way to search using the API to execute an “AND” between custom fields and an “OR” within them when supplying multiple values per custom field?

Similar to the way SQL behaves when you query:
select *
from xxx
where yyy in ( 2, 4, 6 )
and zzz = 12

Each asset would have only a single YYY and ZZZ value but my query wants to find all assets with a certain ZZZ value and also match on one of the listed YYY values.

The “OR” feature will match on too many as it would return a ZZZ=12 and a yyy=9 asset which is not desired.

Also tried using labels, keywords, but can’t seem to find a way.

We do only intend on searching/filtering a single folder at a time, in case other methods may be suitable, but GetAssets in the folder API doesn’t appear to be able to filter on custom fields.


This is already explained in the search API documentation at Search API v2

Your use case is outlined in the highlighted section on the top.

Hope this helps.