> ## Documentation Index
> Fetch the complete documentation index at: https://x-preview-mintlify-24fef6d1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Powerstream Operators

> This page provides a complete list of operators available when building rules for. Reference for the X API v2 standard tier covering powerstream.

This page provides a complete list of operators available when building rules for [Powerstream](/x-api/powerstream/introduction).

## Overview

Powerstream uses Boolean queries with operators to filter Posts based on keywords and metadata. Rules can be up to 2,048 characters and you can have up to 1,000 rules.

***

## User operators

| Operator | Summary | Example |
| :- | :- | :- |
| `from:` | Matches posts from a specific user | `from:xdevelopers` or `from:123456` |
| `to:` | Matches posts directed to a specific user | `to:jvaleski` |
| `retweets_of:` | Matches reposts of a specific user | `retweets_of:xdevelopers` |

***

## Content operators

| Operator | Summary | Example |
| :- | :- | :- |
| `contains:` | Matches posts containing specific text/keywords | `contains:hello` or `contains:-2345.432` |
| `url_contains:` | Matches posts with URLs containing specific text | `url_contains:"com/willplayforfood"` |
| `lang:` | Matches posts in specific languages | `lang:en` |

***

## Entity operators

| Operator | Summary | Example |
| :- | :- | :- |
| `has:` | Matches posts containing specific entities | `has:images`, `has:geo`, `has:mentions` |
| `is:` | Matches posts of specific types or properties | `is:retweet`, `is:reply` |

### Available `has:` options

* `has:mentions` — Posts that mention another user
* `has:geo` — Posts with geolocation data
* `has:links` — Posts containing links
* `has:media` — Posts containing media
* `has:lang` — Posts with detected language
* `has:symbols` — Posts containing cashtags
* `has:images` — Posts containing images
* `has:videos` — Posts containing videos

### Available `is:` options

* `is:retweet` — Retweets
* `is:reply` — Replies to other posts

***

## Location operators

| Operator | Summary | Example |
| :- | :- | :- |
| `place:` | Matches posts from specific places/locations | `place:"Belmont Central"` or `place:02763fa2a7611cf3` |
| `bounding_box:` | Matches posts within a geographic bounding box | `bounding_box:[-112.424083 42.355283 -112.409111 42.792311]` |
| `point_radius:` | Matches posts within a radius of a point | `point_radius:[-111.464973 46.371179 25mi]` or `point_radius:[-111.464973 46.371179 15km]` |

***

## User profile operators

| Operator | Summary | Example |
| :- | :- | :- |
| `bio:` | Matches posts from users with specific bio content | `bio:"data scientist"` |
| `bio_name:` | Matches posts from users with specific name in bio | `bio_name:PhD` |

***

## Post reference operators

| Operator | Summary | Example |
| :- | :- | :- |
| `retweets_of_status_id:` | Matches reposts of specific posts | `retweets_of_status_id:1234567890123456789` |
| `in_reply_to_status_id:` | Matches replies to specific posts | `in_reply_to_status_id:1234567890123456789` |

***

## Special syntax operators

| Operator | Summary | Example |
| :- | :- | :- |
| `@` | Mention operator | `@username` |
| `"phrase"` | Matches exact phrases | `"exact phrase"` |

***

## Logical operators

| Operator | Summary | Example |
| :- | :- | :- |
| `OR` | Logical OR between expressions | `x OR facebook` |
| Space/AND | Logical AND between expressions | `x facebook` (both terms must be present) |
| `()` | Grouping for complex expressions | `(x OR facebook) iphone` |
| `-` | Negation/exclusion | `x -facebook` (x but not facebook) |

***

## Building rules

### Basic examples

```
# Match posts from a specific user

from:xdevelopers

# Match posts containing keywords

contains:API contains:developer

# Match posts with images in English

has:images lang:en
```

### Combining operators

```
# Posts from @xdevelopers OR @api that aren't retweets

(from:xdevelopers OR from:api) -is:retweet

# Posts mentioning AI with images, excluding retweets

contains:AI has:images -is:retweet lang:en

# Posts within 25 miles of a location

point_radius:[-73.935242 40.730610 25mi] lang:en
```

***

## Next steps

<CardGroup cols={2}>
  <Card title="Powerstream introduction" icon="bolt" href="/x-api/powerstream/introduction">
    Get started with Powerstream
  </Card>

  <Card title="Handling disconnections" icon="plug" href="/x-api/fundamentals/handling-disconnections">
    Handle streaming disconnections
  </Card>

  <Card title="Recovery and redundancy" icon="https://mintcdn.com/x-preview-mintlify-24fef6d1/Y9anV6Yuzgh5cdxI/icons/xds/icon-shield-keyhole.svg?fit=max&auto=format&n=Y9anV6Yuzgh5cdxI&q=85&s=8fbe1ded64d42dac41e31ed00a07bdba" href="/x-api/fundamentals/recovery-and-redundancy" width="24" height="24" data-path="icons/xds/icon-shield-keyhole.svg">
    Recover missed data
  </Card>
</CardGroup>
