> For the complete documentation index, see [llms.txt](https://docs.coupler.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coupler.io/sources/category/ppc/facebook-ads/how-to-use-filters-in-facebook-and-instagram-ads-sources.md).

# 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"
   }
]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coupler.io/sources/category/ppc/facebook-ads/how-to-use-filters-in-facebook-and-instagram-ads-sources.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
