# X (Twitter) Search

> Search X (Twitter) for top or latest posts on any keyword, hashtag or phrase, with author, time, likes, reposts, replies and views.

- Type: SandBase tool
- Category: Social media
- Price: Free daily quota, then $0.001 per run, billed to your SandBase account
- Page: https://www.sandbase.ai/tools/social/twitter-search

## How it works

1. **Enter a query and choose Top or Latest** Type a keyword, hashtag or quoted phrase in Keyword, up to 100 characters. Search operators such as quotes, OR and from: work as in the X search box. Then set Results to Top for the most engaged posts or Latest for the newest ones.
2. **Search twitter/web/search-timeline** SandBase calls twitter/web/search-timeline with your query as keyword and Top or Latest as search_type. It fetches the first page only, without a cursor. The run is billed to your SandBase account, so you need no X developer account and no X API keys.
3. **Compare likes, reposts and views** Each post shows its author, time, text, likes, reposts, replies and views. The summary gives the post count with totals and medians of views and likes. Open a post on X from its link, or check the numbers in the raw API response.

## What people use it for

- **Brands**: Monitor mentions and reactions after a launch.
- **Analysts**: Follow how a story spreads in real time.
- **Creators**: See which posts on a topic earn reach.

## Twitter data with an API

```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": "AI agents",
  "search_type": "Top"
}'
```

- [twitter/web/search-timeline API](https://www.sandbase.ai/apis/twitter/web/search-timeline)
- [All Twitter APIs](https://www.sandbase.ai/apis/twitter)

## FAQ

### Do I need an X developer account for X (Twitter) Search?

No. X (Twitter) Search runs on the SandBase X API on your SandBase account, so you do not need X API keys.

### Can I use search operators in X (Twitter) Search?

Yes. Quotes, OR, hashtags and from: work the same way as in the X search box.

### What is the difference between Top and Latest in X (Twitter) Search?

Top returns X's Top tab for the query; Latest returns the newest matching posts. X (Twitter) Search reads one page of either.

### Is X (Twitter) Search free?

Partly. X (Twitter) Search uses the SandBase daily free quota first: 100 calls per organization per day, shared and reset at 00:00 UTC. Beyond that, each twitter/web/search-timeline call is billed to your SandBase account at the price shown on the page and in `sandbase inspect`. Details: https://www.sandbase.ai/pricing.

### Can I search X posts with the twitter/web/search-timeline API?

Yes. Call POST /v1/api/twitter/web/search-timeline with your SandBase API key, a keyword and a search_type. The API also supports Media, People and Lists results and cursor paging; see the request example on the page.
