Skip to content

Filtering

Filter results using the filter query parameter with bracket notation.

Syntax

?filter[fieldName]=value

Each endpoint documents its available filters in the OpenAPI spec below.

Filter Types

Exact Match

Most filters perform exact matching. Comma-separated values are treated as an IN clause:

?filter[id]=5            # Single value
?filter[id]=1,2,5        # Multiple values (WHERE id IN (1, 2, 5))
?filter[active]=1        # Boolean filter
?filter[vendorId]=3      # Foreign key filter

Partial Match (LIKE)

String/text filters typically use partial matching:

?filter[name]=Widget     # Matches "Widget", "Blue Widget", "Widget Pro", etc.

Translation Filters

For multi-language fields, append the locale code:

?filter[name.el]=...
?filter[name.en]=...
?filter[slug.en]=my-product

Between (Range)

Some numeric/date filters support range queries with comma-separated min,max:

?filter[price]=10,50     # WHERE price BETWEEN 10 AND 50

Not Empty

Some filters check for non-empty values:

?filter[hasImage]=1      # Only entities where image is not empty

Combining Filters

Multiple filters are combined with AND logic:

?filter[active]=1&filter[vendorId]=3&filter[categoryId]=12

Discovering Filters from the OpenAPI Spec

Each resource's OpenAPI tag includes a vendor extension x-filters that lists all valid filters with their type:

Filter typeOperatorDescription
exact= / INExact match; comma-separated values become an IN clause
partialLIKESubstring match; wraps the value in %...%
betweenBETWEENRange query; expects two comma-separated values (min, max)
not_emptyIS NOT NULL / != ''Existence check; pass 1 to filter for non-empty values

Example x-filters excerpt from a tag definition:

yaml
x-filters:
  id:
    type: exact
  name:
    type: partial
  price:
    type: between
  hasImage:
    type: not_empty
  active:
    type: exact

Range Filter Example

For between-type filters, pass a comma-separated min and max value:

?filter[price]=10,100

This translates to WHERE price BETWEEN 10 AND 100, returning only products within that price range.

Use the x-filters vendor extensions to programmatically discover which filters each resource supports and what type of matching they perform.