# Twitter (X) Search API

> Search Twitter / X posts by keyword and get tweets with text, author, time and engagement counts (likes, retweets, replies, views). Supports Top, Latest, Media, People and Lists results.

Source: https://www.sandbase.ai/model/twitter/web/search-timeline
API reference: https://www.sandbase.ai/model/twitter/web/search-timeline/docs

## Facts

- Provider: Twitter
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/twitter/web/search-timeline`
- Price: $0.0015 per call
- Free allowance: 100 calls per organization per UTC day, shared across eligible APIs
- Capabilities: api, twitter
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/twitter/web/search-timeline` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `keyword` | string | yes |  |
| `cursor` | string | no |  |
| `search_type` | string | no |  |

## FAQ

### How do I use the Twitter (X) Search API?

Send a POST request to https://api.sandbase.ai/v1/api/twitter/web/search-timeline with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the Twitter (X) Search API cost?

$0.0015 per call. Every organization gets 100 free calls per UTC day, shared across eligible SandBase APIs including this one; after that each call is billed at this price from your SandBase balance. There is no subscription.

### What parameters does the Twitter (X) Search API accept?

Required: keyword (string). Optional: cursor (string) and search_type (string). The Parameters table and the Playground on this page list every field.

### What does the Twitter (X) Search API return?

A JSON response returned in the same HTTP request (synchronous). The README on this page includes a sample response.

### Do I need a Twitter developer account or API key?

No. Twitter (X) Search runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Twitter API access separately.

## README

### Twitter (X) Search API

Search X (Twitter) for a keyword or query and get matching tweets with author, text, timestamps and engagement metrics. Switch between Top, Latest, Media, People and Lists tabs.

#### Use cases

- Monitor brand, product or competitor mentions on X.
- Collect the latest tweets about an event with `search_type=Latest`.
- Find influential accounts discussing a topic.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/twitter/web/search-timeline" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keyword": "OpenAI"}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `keyword` | string | Yes | Search keyword |
| `cursor` | string | No | Cursor, default is None, used for paging, obtained from the last request |
| `search_type` | string | No | Search type, default is Top, other optional values are Latest, Media, People, Lists |

#### Example response

Real response for the request above, trimmed to the main fields. User names and long IDs are masked.

```json
{
  "status": "ok",
  "next_cursor": "<cursor>",
  "timeline": [
    {
      "tweet_id": "2104987422308335828",
      "screen_name": "OpenAI",
      "created_at": "Tue Sep 29 17:31:24 +0000 2026",
      "lang": "en",
      "favorites": 4456,
      "retweets": 315,
      "replies": 256,
      "quotes": 131,
      "bookmarks": 1224,
      "views": "570812",
      "text": "Codex Security Cloud is getting a major upgrade, with access to cyber-capable models thro…"
    }
  ]
}
```

#### Notes

- Paginate with `cursor` from the previous response (`next_cursor`).

#### Related APIs

- [Get the latest tweet comments](/model/twitter/web/latest-post-comments): Get the latest tweet comments.
- [Get comments](/model/twitter/web/post-comments): Get comments under the tweet.
- [ReTweet User list](/model/twitter/web/retweet-user-list): Get ReTweet User list.
