API · X
GET /x/search/tweets
Search recent X posts with X’s search operators (needs logged-in sessions).
| Request | GET /v1/x/search/tweets |
| Operation id | x.search.tweets |
| Cost | 10 credits, refunded if the call fails |
| Auth | API key: Authorization: Bearer <key> or x-api-key. |
Search recent X posts with X’s search operators (needs logged-in sessions).
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
q | string | yes | X search query. Example: from:NASA moon. |
product | "latest" | "top" | no | latest (newest first, default) or top. One of latest, top. |
since | string | no | Only posts on or after this time (sent to X as since_time:): YYYY-MM-DD (UTC) or an ISO 8601 timestamp. Example: 2026-11-01. |
until | string | no | Only posts on or before this time (sent to X as until_time:): YYYY-MM-DD (UTC) or an ISO 8601 timestamp. Example: 2026-11-01. |
after | string | no | Cursor: the previous page's meta.next_token. |
Responses
| Status | Meaning | Schema |
|---|---|---|
200 | Matching posts, with a next_token. | XTimelineResponse |
400 | Invalid input. Nothing was charged. | Error |
401 | Missing or invalid API key. | Error |
402 | Not enough credits, a spend cap was reached, or payment is required. | Error |
403 | The target is private, or the account is suspended. | Error |
404 | The post or account does not exist, was deleted, or is suspended. | Error |
429 | Too many requests. Wait for Retry-After seconds. | Error |
503 | X is temporarily unavailable. Retryable; nothing was charged. | Error |
XTimelineResponse fields
| Field | Type | Description |
|---|---|---|
data | XTweet[] | |
includes | XIncludes | Objects the response refers to by id, each once: authors, quoted and reposted posts, media, polls. |
meta | XTimelineMeta |
Errors use one shape everywhere; see Errors for every code and what to do.