Endpoints
| Endpoint | Returns and price |
|---|---|
GET /v1/searchSearch posts | Page of posts · $0.20 per 1,000 results |
GET /v1/search/usersSearch accounts | Page of accounts · $0.20 per 1,000 results |
GET /v1/search/trendSearch a trend | Page of posts · $0.20 per 1,000 results |
All routes take Authorization: Bearer $TWITTERXAPI_KEY and level. Collections return one page; continue with the cursor.
Write the query
qtakes X search syntax, for examplefrom:marclou since:2026-01-01 until:2026-02-01.- URL-encode the whole query with
curl -G --data-urlencodeorURLSearchParams, and keep it unchanged while following the cursor.
GET/v1/searchPage of posts
Search posts
One page of public posts matching an X search query. POST /v1/search accepts the same values as a JSON body (query, cursor, level) for long queries.
| Parameter | In | Description |
|---|---|---|
q requiredstring | query | X search query, 1–500 characters. URL-encode the whole value. |
cursorstring | query | Value of pagination.next_cursor from the previous page. Omit for the first page. |
levelraw | moderate | contentful | query | Response level. Defaults to moderate. |
Returns: Page of posts · Price: $0.20 per 1,000 results
cURL
curl -G "https://twitterxapi.com/api/v1/search" \
-H "Authorization: Bearer $TWITTERXAPI_KEY" \
--data-urlencode "q=from:marclou since:2026-01-01 until:2026-02-01"GET/v1/search/usersPage of accounts
Search accounts
One page of accounts matching a name, username or query text.
| Parameter | In | Description |
|---|---|---|
q requiredstring | query | X search query, 1–500 characters. URL-encode the whole value. |
cursorstring | query | Value of pagination.next_cursor from the previous page. Omit for the first page. |
levelraw | moderate | contentful | query | Response level. Defaults to moderate. |
Returns: Page of accounts · Price: $0.20 per 1,000 results
cURL
curl -G "https://twitterxapi.com/api/v1/search/users" \
-H "Authorization: Bearer $TWITTERXAPI_KEY" \
--data-urlencode "q=indie hackers"GET/v1/search/trendPage of posts
Search a trend
The search X runs when someone opens a trend. Pass the trend's name as q.
| Parameter | In | Description |
|---|---|---|
q requiredstring | query | X search query, 1–500 characters. URL-encode the whole value. |
cursorstring | query | Value of pagination.next_cursor from the previous page. Omit for the first page. |
levelraw | moderate | contentful | query | Response level. Defaults to moderate. |
Returns: Page of posts · Price: $0.20 per 1,000 results
cURL
curl -G "https://twitterxapi.com/api/v1/search/trend" \
-H "Authorization: Bearer $TWITTERXAPI_KEY" \
--data-urlencode "q=#AI"