# Filtering

<table><thead><tr><th width="197.33333333333331">Relationship Type</th><th>Sample Attribute</th><th>Sample Value</th></tr></thead><tbody><tr><td>Simple Attribute</td><td>orders.total</td><td>Total value of the order</td></tr><tr><td>One-To-One</td><td>orders.shipping_address</td><td>A single address entity or null if one isn't set.</td></tr><tr><td>One-To-Many</td><td>order.line_items</td><td>An array of line_item entities. If there are no line_items associated with this order, the array is empty.</td></tr></tbody></table>

## Simple Filtering

The Rest API currently only supports simple filtering, while our "Server Side API" or "Entity Access" which can be accessed on the server side supports both simple and advanced filtering.&#x20;

Simple filtering allows the API caller to filter results by attributes that can be combined with the `and` logical operator. That format looks like:

```markup
<attributes>:<operator>:<value>,..
```

**Example**: Let's say you have a product that has some product variants. On the product variants table there is a column called `visible` and we want to filter all of theproduct variants that are visible that have a price over $80

{% code fullWidth="true" %}

```sh
$ curl -s -G '<base-url>/wp-json/nc-data/v1/product-variants' -d filter='product_variants.visible:eq:1,price:gt:80'   | jq .data
```

{% endcode %}

In order to get all the product variants we filter product\_variants.visible attribute eq (equal) to 1 since that column is a boolean `and` which is specified by the comma price is greather than 80.

## Supported Operators

The follow operators for filtering are supported.&#x20;

* `eq` - equals
* `equal` - equals
* `lt` - less than
* `gt` - greater than
* `like` - SQL LIKE operator *using `%` as the wildcard*
* `neq` - Not equal to

If you aren't familar with the SQL LIKE operator then using that filter will give you all the data that contains the filtered value. For example:

```markup
/wp-json/nc-data/v1/products?filter=name:like:%bracelet%
```

and in the above example I would return all the products that name contain the word `bracelet`
