Filtering
Filtering
Each entity supports filtering the results, even on fields that are not present in the resulting entry.
You can see the full list of possible filters for each entity in the relevant API reference page.
Operators
The supported operators are described in the following table:
Operator | Meaning |
---|---|
[eq] | Filter <field> to be equal to the provided value. |
[gt] | Filter <field> to be greater than the provided value. |
[ge] | Filter <field> to be greater than or equal to the provided value. |
[like] | Filter <field> with a wildcard (%) to match the provided value. |
[lt] | Filter <field> to be lower than the provided value. |
[le] | Filter <field> to be lower than or equal to the provided value. |
[ne] | Filter <field> to be not equal to the provided value. |
[nlike] | Filter <field> with a wildcard (%) to not match the provided value. |
Filter types
Each filter corresponds to a specific data type, and each data type supports specific operators, as can be seen in the following table:
Type | Operators |
---|---|
Text | [like] , [nlike] , [eq] , [ne] |
Number | [ge] , [eq] , [lt] , [gt] , [ne] , [le] |
Enum | [ne] , [eq] |
Date | [ge] , [eq] , [lt] , [gt] , [le] |
Syntax
Filter <field>
to equal <value>
<field>
to equal <value>
?<field>=<str>
Apply <operator>
on <field>
with <value>
<operator>
on <field>
with <value>
?<field:str>[<operator>]=<value>
Case sensitivity
Filtering on text fields is case-insensitive.
Filtering the same field multiple times
To filter by the same field multiple times, repeat the filter query parameter as many times as necessary.
Examples
Query parameters | Meaning |
---|---|
? (empty) | Default, all entries are returned. |
?category=Computers | category is Computers |
?category[eq]=Computers | category is Computers |
?category[ne]=Computers | category is not Computers |
?category=Computers&category=Multimedia | category is either Computers or Multimedia |
?osName[like]=Win% | osName starts with Win |
?osName[nlike]=Win% | osName doesn't start with Win |
?score[gt]=4 | score is greater than 4 |
?score[ge]=3&score[le]=7 | score is between 3 and 7 (inclusive) |
?published[gt]=2022-02-28 | published is later than February 28th, 2022 (at midnight). |
Updated 19 days ago