# Query Syntax

> [!WARNING]
> The Web Content API is **deprecated**. Use the [News, Blogs & Forums APIs](news-blogs-forums-overview) instead - same content, one endpoint per content type, and where new features land.

Queries are boolean expressions made of keywords and `field:value` filters.

## Operators

| Operator | Meaning | Example |
| --- | --- | --- |
| `AND` | Both terms (default between terms) | `bitcoin AND etf` |
| `OR` | Either term | `android OR ios` |
| `NOT` | Exclude a term | `tesla NOT spacex` |
| `" "` | Exact phrase | `"climate change"` |
| `( )` | Group terms | `title:(android OR iphone)` |
| `*` | Wildcard | `hack*` |
| `$` | Exact term, no stemming. Supported for English, Spanish, Arabic, Russian, and French. | `gold$` |
| `~N` | Proximity: phrase words within `N` words of each other | `"data breach"~5` |

## Field filters

Use `field:value` to match a specific attribute. Common fields:

| Field | Matches |
| --- | --- |
| `title` | Words in the post title |
| `text` | Words in the post body |
| `language` | Post language, e.g. `language:english` |
| `sentiment` | `positive`, `negative`, or `neutral` |
| `category` | Content category, e.g. `category:"Economy, Business and Finance"` |
| `site_type` | `news`, `blogs`, or `discussions` |
| `thread.title` | Words in the source thread title |
| `organization`, `person`, `location` | Named entities found in the post |
| `social.facebook.likes` | Facebook likes; supports ranges: `social.facebook.likes:>10` |

## Examples

```
title:(Android OR iPhone) social.facebook.likes:>10 language:english
```

```
sentiment:negative title:Tesla category:"Disaster and Accident" language:english
```

## Query rules & limits

- **Proximity (`~N`) is capped at 10 per query.** A query with more than 10 proximity operators is rejected with `400` (`Invalid proximity search`).
- **Leading wildcards are not allowed.** A `*` at the start of a term is dropped (`*phone` becomes `phone`). Use a trailing wildcard instead, e.g. `phone*`.
- **Balance your quotes and parentheses.** A query with an odd number of `"`, or unbalanced `(` `)`, is rejected.
- **Stray wildcards are cleaned up.** A lone `*` surrounded by spaces is removed, and repeated `*` are collapsed into one.

> [!NOTE]
> Fields that describe the source (such as `site_type`, `country`, `replies_count`) belong to the thread. You can write them directly (e.g. `site_type:news`) or as `thread.` fields.
