Search X posts
xcrap_searchSearch X/Twitter posts by query, including operators like from:, to:, exact phrases, filters, and date ranges. Returns matching posts with author, timestamp, text, metrics, and pagination.
Instructions
Full-text search over X/Twitter posts, with the same operators X's own search understands.
This is how you answer "what are people saying about Y", "find posts from @x about Z", "any recent posts linking to this site" or "what did @x post about the launch last week". The query is passed to X as-is, so operators work: from:nasa, to:jack, "exact phrase", -exclude, lang:en, filter:links, min_faves:100.
When to use this instead of the alternatives:
Use xcrap_get_user_tweets or xcrap_get_user_history to read one account's posts without a topic.
Use xcrap_get_trends for what is trending in general, with no query.
Use xcrap_get_replies for the conversation under one specific post.
Args:
q (string, required): the search query, operators included.
feed ('latest' | 'top' | 'photos' | 'videos'): 'latest' (default) for newest first, 'top' for X's most relevant, or only posts with photos or videos.
since (string): oldest post to match, as a date such as "2025-01-01".
until (string): newest post to match, as a date.
cursor (string): the next_cursor from a previous call, for the next page. Omit for the first page. Do not invent one.
format ('markdown' | 'json'): default 'markdown'.
Returns markdown: a "Search:" heading with the result count and feed, then each post with its author, timestamp, permalink, text and metrics, and a "Next page" cursor line when there is more. Returns json: { query, feed, since, until, count, next_cursor, tweets[ ] }.
Costs 15 calls per 15 minutes — the tightest budget here. Write one precise query with operators instead of several broad ones. A 503 means search capacity is used up for now; wait for the time it gives.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | The search query, including any X search operators, e.g. "from:nasa mars". | |
| feed | No | 'latest' (default) for newest first, 'top' for most relevant, 'photos' or 'videos' for media posts only. | latest |
| since | No | Oldest post to match, as a date: "2025-01-01" or an ISO timestamp. | |
| until | No | Newest post to match, as a date: "2025-03-31" or an ISO timestamp. | |
| cursor | No | Pagination cursor from a previous call. Omit for the first page; never construct one by hand. | |
| format | No | Output format. 'markdown' (default) is compact, human-readable and costs roughly a tenth of the tokens of the same data as JSON — prefer it for reading and summarising. Use 'json' only when you need exact field access: numeric ids, media URLs, per-metric values, or provenance metadata. | markdown |