# X (Twitter) Search Tweets Across Communities API

> Search tweets posted in all X Communities by keyword, sorted by Latest or Top.

Source: https://www.sandbase.ai/apis/twitter/community-search-tweets
API reference: https://www.sandbase.ai/apis/twitter/community-search-tweets/docs

## Facts

- Provider: X (Twitter)
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/twitter/community-search-tweets`
- Price: From $0.003 per call
- Capabilities: api, twitter, social media
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

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

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `query` | string | yes |  |
| `queryType` | string | yes | Latest, Top |
| `cursor` | string | no |  |

## FAQ

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

Send a POST request to https://api.sandbase.ai/v1/api/twitter/community-search-tweets 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 X (Twitter) Search Tweets Across Communities API cost?

From $0.003 per call, billed from your SandBase balance. You are only charged for calls you make; there is no subscription.

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

Required: query (string) and queryType (one of Latest, Top). Optional: cursor (string). The Parameters table and the Playground on this page list every field.

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

A JSON response returned in the same HTTP request (synchronous).

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

No. X (Twitter) Search Tweets Across Communities 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 X (Twitter) API access separately.

## README

### X (Twitter) Search Tweets Across Communities API

Search tweets posted in all X Communities by keyword, sorted by Latest or Top.

The result is returned in `outputs[0].data` as the official X (Twitter) API response, unchanged.

#### Request

```bash
curl -X POST "https://api.sandbase.ai/v1/api/twitter/community-search-tweets" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "AI", "queryType": "Latest"}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `cursor` | string | No | Cursor for pagination |
| `query` | string | Yes | Search query (e.g., keyword) |
| `queryType` | string | Yes | Query type (Latest or Top) |

#### Pricing

Billed at the actual cost of each call, about $0.003 for a typical request; the cost grows with the number of rows returned. Searches with no results are billed at their actual cost. Failed calls are not charged.
