> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rankraft.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Filtering

> Narrow any report with a filter tree of and, or and not.

Report endpoints take an optional `filter`: one condition, or a tree of `and`, `or` and `not`.

```json theme={"system"}
{
  "and": [
    { "field": "platform", "op": "in", "value": ["chatgpt", "ai_mode"] },
    { "not": { "field": "category", "op": "is", "value": "Brand" } }
  ]
}
```

## Operators

| Operator | Value | Matches when |
| - | - | - |
| `is` | one value | equal (case-insensitive) |
| `not_is` | one value | not equal |
| `in` | list of up to 100 | equal to any |
| `not_in` | list of up to 100 | equal to none |
| `contains` | one value | contains the text (case-insensitive) |
| `not_contains` | one value | does not contain the text |

Trees nest at most **3 levels** deep. There is no regular-expression operator.

## Fields by endpoint

| Endpoint | Fields |
| - | - |
| Visibility, Sentiment | `platform`, `prompt` (id or text), `category` |
| Citations | `platform`, `prompt`, `category`, `domain`, `owner` (`own`, `competitor`, `third_party`), `source_kind` |
| AI crawler report | `bot_name`, `bot_provider`, `bot_type`, `verified`, `path`, `page_type` |
| AI referral report | `referral_source`, `path`, `page_type` |

A field outside the list is refused with `422 invalid_filter`, never ignored.

## Examples

Only Google's engines:

```json theme={"system"}
{ "field": "platform", "op": "in", "value": ["ai_overviews", "ai_mode"] }
```

Third-party forums and review sites:

```json theme={"system"}
{ "and": [
  { "field": "owner", "op": "is", "value": "third_party" },
  { "field": "source_kind", "op": "in", "value": ["forum", "review"] }
] }
```

GPTBot hits on blog pages, spoofed ones included:

```json theme={"system"}
{ "and": [
  { "field": "bot_name", "op": "is", "value": "GPTBot" },
  { "field": "path", "op": "contains", "value": "/blog/" },
  { "field": "verified", "op": "in", "value": ["verified", "failed", "partial", "unverified"] }
] }
```

> [!NOTE]
>
> The crawler report leaves out spoofed hits (`verified = failed`) unless your filter mentions `verified` — someone sending GPTBot's name from an unrelated server is not GPTBot.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.