Search Tweets

Search public posts on X (Twitter).

Credits

Each successful response deducts 2 credits from your organization. Requests that fail (4xx / 5xx) are not billed.

See the credits documentation for the full rate table.


POST
/data/twitter/tweets/search

Authorization

bearerAuth
AuthorizationBearer <token>

Organization API key from Integrations → API keys.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body for POST /data/twitter/tweets/search.

query*string

Search keywords for posts on X.

Length1 <= length <= 200
cursor?string

Opaque cursor from a previous response meta.nextCursor.

Lengthlength <= 1024
count?integer

Maximum tweets to return (capped at 20).

Range1 <= value <= 20
Default20
category?string

Search tab / category on X.

Value in

  • "Top"
  • "Latest"
  • "People"
  • "Photos"
  • "Videos"
filters?

Additional structured filters (subset of upstream search).

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/data/twitter/tweets/search" \  -H "Content-Type: application/json" \  -d '{    "query": "string"  }'
{  "requestId": "string",  "posts": [    {      "id": "string",      "body": "string",      "author": "string",      "name": "string",      "timestamp": "string",      "url": "string",      "images": [        "string"      ],      "video": "string",      "engagements": {        "bookmarkCount": 0,        "favoriteCount": 0,        "quoteCount": 0,        "replyCount": 0,        "retweetCount": 0,        "viewsCount": 0      }    }  ],  "meta": {    "returnedCount": 0,    "hasMore": true,    "nextCursor": "string"  }}
{  "requestId": "01HXYZABCDEF",  "error": {    "code": "validation_error",    "message": "query: String must contain at least 1 character(s)",    "issues": [      {        "path": "query",        "message": "String must contain at least 1 character(s)"      }    ]  }}
{  "requestId": "01HXYZABCDEF",  "error": {    "code": "unauthorized",    "message": "Invalid or revoked API key."  }}
{  "requestId": "01HXYZABCDEF",  "error": {    "code": "rate_limited",    "message": "Rate limit exceeded for linkedin. Try again later.",    "retryAfter": 42  }}
{  "requestId": "01HXYZABCDEF",  "error": {    "code": "upstream_error",    "message": "Upstream request failed."  }}