# How to use filters in Facebook & Instagram Ads sources

You can filter the data you import using Graph API syntax: \[filter\_1, filter\_2, ..., filter\_N].

To apply a single filter, use one filter (\[filter\_1]). The structure looks like this:

```json
[
   {
      "field":"adset.name",
      "operator":"CONTAIN",
      "value":"Blog"
   }
]
```

* **field** - the field name you want to apply the filter to
* **operator** - the condition you want to use in the filter. The Facebook Ads API allows one of the following values: EQUAL, NOT\_EQUAL, GREATER\_THAN, GREATER\_THAN\_OR\_EQUAL, LESS\_THAN, LESS\_THAN\_OR\_EQUAL, IN\_RANGE, NOT\_IN\_RANGE, CONTAIN, NOT\_CONTAIN, IN, NOT\_IN, STARTS\_WITH, ENDS\_WITH, ANY, ALL, AFTER, BEFORE, ON\_OR\_AFTER, ON\_OR\_BEFORE, NONE, TOP
* **value** - the value to compare a field against. It can be a number (without quotes), a string (with quotes), or an array of values (numbers or strings)

A single filter looks like this:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/62f212925c214850abad4986/file-zSSyePdaK0.png)

***Some common single-filter examples, ready to copy and paste:***

1\. Filter by ad name containing a value:

```json
[
   {
      "field":"ad.name",
      "operator":"CONTAIN",
      "value":"Blog"
   }
]
```

2\. Filter by ad set name equal to a value:

```json
[
   {
      "field":"adset.name",
      "operator":"EQUAL",
      "value":"Blog"
   }
]
```

3\. Filter by amount spent:

```
[
   {
      "field":"spend",
      "operator":"GREATER_THAN",
      "value":10.0
   }
]
```

4\. Filter for either item in a list of actions. For example, `action_type` must be `link_click` or `landing_page_view`:

```
[
   {
      "field":"action_type",
      "operator":"IN",
      "value":[
         "link_click",
         "landing_page_view"
      ]
   }
]
```

5\. Use several filters in a single data flow: \[filter\_1, filter\_2]

```
[
   {
      "field":"action_type",
      "operator":"IN",
      "value":[
         "link_click",
         "landing_page_view"
      ]
   },
   {
      "field":"adset.name",
      "operator":"CONTAIN",
      "value":"Blog"
   }
]
```
