# X (Twitter) Tweets by IDs API

> Look up several tweets at once by a comma-separated list of tweet IDs, with text, author and engagement counts.

Source: https://www.sandbase.ai/apis/twitter/tweets-by-ids
API reference: https://www.sandbase.ai/apis/twitter/tweets-by-ids/docs

## Facts

- Provider: X (Twitter)
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/twitter/tweets-by-ids`
- Price: From $0.0075 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/tweets-by-ids` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `tweet_ids` | string | yes |  |

## FAQ

### How do I use the X (Twitter) Tweets by IDs API?

Send a POST request to https://api.sandbase.ai/v1/api/twitter/tweets-by-ids 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) Tweets by IDs API cost?

From $0.0075 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) Tweets by IDs API accept?

Required: tweet_ids (string). The Parameters table and the Playground on this page list every field.

### What does the X (Twitter) Tweets by IDs 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) Tweets by IDs 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) Tweets by IDs API

Look up several tweets at once by a comma-separated list of tweet IDs, with text, author and engagement counts.

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/tweets-by-ids" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tweet_ids": "1585341984679469056,1846987139428634858"}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `tweet_ids` | string | No | Comma-separated list of tweet IDs. |

#### Pricing

Billed at the actual cost of each call, about $0.0075 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.
