Search X posts
search_xSearch public X (Twitter) posts. Combine query or phrase with filters such as fromUsers, mentions, hashtags, language, minLikes, since/until and onlyOriginal; at least one of query, phrase, hashtags, fromUsers, toUsers or mentions is required. Returns X's own fields: text, author (an object), likeCount, retweetCount, replyCount, viewCount (counts can be null), createdAt, url. X only: search Reddit separately with search_reddit. Costs 1 credit + 1 credit per post returned. When meta.nextCursor is set, call again with cursor set to it for the next page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | latest (default) or top. | latest |
| limit | No | Most posts to return, 1-50. Default 10. X serves about 20 a page whatever is asked, so for more, call again with the cursor. | |
| query | No | Keywords, using X search syntax if useful. | |
| since | No | Only posts at or after this ISO 8601 time. | |
| until | No | Only posts before this ISO 8601 time. | |
| cursor | No | Opaque cursor from the previous page's `meta.nextCursor`. Pass it back unchanged, with the same path and query parameters; a cursor from another request is rejected with 400. | |
| listId | No | Only posts by members of this public List. | |
| phrase | No | An exact phrase that must appear. | |
| sinceId | No | Only posts newer than this post id, exclusive. The way to resume a feed: pass the newest id already seen. | |
| toUsers | No | Replying to any of these usernames. | |
| untilId | No | Only posts older than this post id, exclusive. | |
| anyWords | No | At least one of these words must appear. | |
| hashtags | No | Posts carrying any of these hashtags, with or without the `#` (a full-width `#` works too). X also matches posts that only have the words, so those are left out: a page can come back with fewer posts than `limit`, and `meta.nextCursor` still leads on. | |
| language | No | Language X detected, as a BCP-47 tag such as `en`. Indonesian (`id`) and Hebrew (`he`) are searched by the codes X still uses, `in` and `iw`, which is also what posts carry in `lang`. A region is dropped: `pt-BR` searches Portuguese. | |
| mentions | No | Mentioning any of these usernames. | |
| minLikes | No | ||
| onlyText | No | Exclude posts with links. | |
| fromUsers | No | Posted by any of these usernames. | |
| onlyLinks | No | Only posts containing a link. | |
| minReplies | No | ||
| minReposts | No | ||
| onlyReplies | No | Only replies. | |
| excludeWords | No | None of these words may appear. | |
| onlyOriginal | No | Exclude replies. | |
| quotedPostId | No | Only posts quoting this post. `getXQuotes` is the dedicated endpoint for this. |