# X (Twitter) Search API Reference

Canonical: https://monsterapi.co/docs/api/x-twitter-search

Read the X (Twitter) Search reference. Review parameters, response fields, examples, and current credit prices.

OpenAPI specification: [X (Twitter)](https://monsterapi.co/docs/openapi/platforms/twitter.yaml).

---

Current operation prices: [public catalog](https://monsterapi.co/account/api/v1/public/api-prices). Prices use credits per request.

---

# X (Twitter): Post search results

`GET /twitter/api/search`

Documentation: https://monsterapi.co/docs/api/twitter#post-search-results

Operation ID: `twitter_search`

Returns a page of posts matching a query and ranking. Requires sign-in and is unavailable through the public guest API.

## Authentication

Send your billing API key in the `Authorization: Bearer <YOUR_API_KEY>` header. Your account login is separate.

## Inputs

- `q` (query, required): Required search text: 1 to 256 Unicode letters, numbers, combining marks, punctuation, symbols or spaces, with a non-space character. Controls, line breaks and invisible formatting characters are not accepted.

- `product` (query, optional): Optional ranking: Top, Latest, People, Photos or Videos; default Top.

- `cursor` (query, optional): Optional continuation: send top-level `next_cursor` from [GET /search](https://monsterapi.co/docs/twitter#unavailable-endpoints) unchanged as `cursor` to GET /search. Up to 8,192 characters; base64/base64url decoding to at least five bytes, or two signed 64-bit decimal numbers separated by |. Omit for the first page.

- `limit` (query, optional): Optional requested number of posts: 1 to 100, default 40. The response may contain more or fewer.

## Responses

- 200: Page of posts; a page without posts carries the cursor of the next one

- 400: Query missing or blank, a parameter outside the accepted set, or a cursor that cannot continue this search

Refused at the gateway: the request target, path and query string together, is longer than 8,192 bytes; or the headers, the target counted among them, exceed 16,384 bytes or 64 fields

- 401: #/components/responses/GatewayUnauthorized

- 402: #/components/responses/GatewayPaymentRequired

- 403: X answered with the error of a suspended account

Refused at the gateway: the API key is unknown or revoked

- 404: X answered that the search is not there, or nothing matched and no cursor leads to a next page

- 405: `method_not_allowed`: the endpoint answers GET alone, and any other method, HEAD included, is refused

Refused at the gateway: the path exists, but no operation on it takes the method of the request, HEAD included; `Allow` names the methods that do

- 409: #/components/responses/GatewayConflict

- 429: #/components/responses/GatewayTooManyRequests

- 500: The requested information could not be read; this does not establish that the object is absent

- 501: The requested information is unavailable without sign-in

- 503: Rate limit (`rate_limited`), temporary request failure (`upstream_error`), service capacity unavailable (`no_proxies`), too many concurrent requests (`overloaded`), or request temporarily unavailable (`upstream_stale`)

Refused at the gateway: the check could not complete, the account is suspended, or the platform did not answer; each may pass later, and `Retry-After` comes only when the platform did not answer

## Credits

Check the live price in the documentation before sending. Platform 2xx and 4xx responses can use credits, including empty data. Gateway refusals and 5xx responses do not use credits. Each pagination request is a separate call.

https://monsterapi.co/docs/pricing

## Request template

Replace path placeholders and add the required query parameters from the Inputs section before sending.

```shell

curl --get 'https://api.monsterapi.co/twitter/api/search' \
  -H 'Authorization: Bearer <YOUR_API_KEY>'

```
