Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions x-api/account-activity/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,12 @@ This ensures that applications can process the entire content of longform posts,
Yes. If your app has subscriptions for User A and User B, and User A mentions User B in a Post, your webhook receives two events (one per user). Use the `for_user_id` field to identify the subscription.
</Accordion>

<Accordion title="Why wasn't a Post delivered to my webhook, even though I can look it up now?">
Whether a Post event is delivered is decided once, when the Post is created, based on the Post's visibility and the author's account state at that moment. If the author's account is protected or temporarily restricted when the Post is created, the event is delivered only for subscribed users who are allowed to see it, such as the author's approved followers.

This isn't re-evaluated later. If the author's account becomes public afterward, events for Posts created while it was protected or restricted are not sent. You can still retrieve those Posts with [Post lookup](/x-api/posts/lookup/introduction) once they're visible.
</Accordion>

<Accordion title="Can I replace /all/ in the endpoint to limit activities delivered?">
No. The `/all/` product is the only option, delivering all supported event types.
</Accordion>
Expand Down
8 changes: 8 additions & 0 deletions x-api/posts/filtered-stream/integrate/build-a-rule.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ When [building search queries](/x-api/posts/search/integrate/build-a-query), key

---

## Long posts

Rules are matched against a Post's `text` field. For long posts (more than 280 characters), `text` contains only the first ~280 characters, so keywords, phrases, hashtags, and other text that appear only after that point do not match your rules.

To receive the full text of a long post that matches, add `tweet.fields=note_tweet` to your stream connection. The full text is returned in `note_tweet.text`, but it is not used for matching.

---

## Quote Tweet matching

When using filtered stream, operators match on both the Quote Tweet's content **and** the content from the original Post that was quoted.
Expand Down
31 changes: 31 additions & 0 deletions x-api/posts/search/integrate/build-a-query.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,29 @@ Your queries will be limited depending on which [access level](/x-api/getting-st
| Self-serve | 512 characters | 1,024 characters |
| Enterprise | 4,096 characters | 4,096 characters |

### Request size

Search requests are sent with GET, so the query and all other parameters are part of the URL. In addition to the character limits above, the full percent-encoded URL (path, `query`, fields, expansions, and any other parameters) must stay under about **16 KB**. Requests over this size are rejected with `414 URI Too Long` or `431 Request Header Fields Too Large`. Both mean the request itself is too large, not that the query is invalid.

The query limit is counted in characters, but the URL size is counted in bytes after UTF-8 percent-encoding. Most non-ASCII characters take several bytes once encoded:

| Character type | Example | Encoded size |
| :--- | :--- | :--- |
| ASCII letters and digits | `a`, `7` | 1 byte |
| Space | (space) | 3 bytes as `%20`, 1 byte as `+` |
| Quotes, parentheses, colons | `"`, `(`, `:` | 3 bytes |
| Accented Latin letters | `é` | 6 bytes |
| Chinese, Japanese, and Korean characters | `東` | 9 bytes |
| Emoji | `😀` | 12 bytes |

For example, about 1,700 Japanese characters already encode to more than 15 KB, so a 4,096-character Japanese query cannot be sent in a single request.

If your request is too large:

* Encode spaces as `+` instead of `%20`.
* Split long `OR` lists across several requests with the same time window, then de-duplicate results by Post `id`.
* Request only the `tweet.fields`, `user.fields`, `expansions`, and other fields you use.

---

## Operator availability
Expand Down Expand Up @@ -122,6 +145,14 @@ When [building filtered stream rules](/x-api/posts/filtered-stream/integrate/bui

---

## Long posts

Search queries are matched against a Post's `text` field. For long posts (more than 280 characters), `text` contains only the first ~280 characters, so keywords, phrases, hashtags, and other text that appear only after that point are not matched.

To get the full text of a long post in the response, request `tweet.fields=note_tweet`. The full text is returned in `note_tweet.text`, but it is not used for matching.

---

## Quote Tweet matching

When using Search Posts, operators match on the Quote Tweet's content but **not** on the content from the original Post that was quoted.
Expand Down
4 changes: 4 additions & 0 deletions x-api/posts/search/integrate/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Queries use operators to match Posts. Combine operators with boolean logic:
| Self-serve | 512 chars | 1,024 chars |
| Enterprise | 4,096 chars | 4,096 chars |

<Note>
These limits count characters. The full percent-encoded request URL must also stay under about 16 KB, which non-ASCII queries can reach well before the character limit. Long posts are matched only on their first ~280 characters. See [Build a query](/x-api/posts/search/integrate/build-a-query#request-size) for details.
</Note>

### Operator types

| Type | Description | Example |
Expand Down
Loading