Search tweets with X advanced-search operators
x_searchSearch tweets with X advanced-search operators. Read-only: returns public data and changes nothing. Costs 1 credit per result returned, with a minimum of 1 credit per request.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | BCP-47 language filter e.g. "en", "ja" (maps to `lang:XX`). | |
| count | Yes | Number of results to return (1–20). Defaults to 10. | |
| query | Yes | Raw search query — supports all X advanced-search operators, e.g. "openai lang:en". | |
| cursor | No | The previous response's `nextCursor`, to fetch the next page. Omit it for the first page. | |
| sortOrder | No | Result ordering: "Latest" = chronological newest-first (default), "Top" = X's engagement ranking. | |
| withinHours | No | Only return tweets newer than this many hours. |