# Tweet thread

`GET https://api.twittrapi.com/tweet/{tweetId}/thread`

The author's own thread around a tweet: their tweets above it and their replies to themselves below it.

HTML page: https://www.twittrapi.com/docs/reference/tweet-tweetid-thread

The thread ends at the first reply by someone else. Long threads are loaded in the same request; it is still one billed call.

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `tweetId` | path | string | yes |  | Numeric tweet ID (digits only, up to 30), the number at the end of the tweet URL. |

This endpoint also accepts `format=simple` (or the header `X-Response-Format: simple`) for compact, flat JSON with a fixed schema. Same price.

## Response

Raw JSON in the shape of X's TweetDetail query with one TimelineAddEntries instruction: the thread in reading order as tweet entries. When the tweet itself is not available (deleted or withheld), X's answer is returned unchanged.

With `format=simple`: Collection of Tweet objects: {data: [Tweet], nextCursor, previousCursor, hasNextPage}. The thread in reading order, on one page.

## Errors

| Status | When |
| --- | --- |
| 422 | tweetId is not numeric. |
| 404 | X reports the tweet as not found. |

Shared errors (401 missing key, 402 no balance, 429 rate limit, 5xx) are listed on https://www.twittrapi.com/docs/helpful-infos/error-handling. Calls that fail with 400, 407, 408, 409 or a 5xx error are refunded.

## Example request

curl:

```bash
curl 'https://api.twittrapi.com/tweet/20/thread' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

Python:

```python
import httpx

# No SDK method for this endpoint yet, so this is a plain HTTP call.
resp = httpx.get(
    "https://api.twittrapi.com/tweet/20/thread",
    headers={"X-API-KEY": "YOUR_API_KEY"},
    timeout=60,
)
data = resp.json()
```

Node.js:

```js
import { TwittrAPI } from "twittrapi";

const client = new TwittrAPI({ apiKey: process.env.TWITTRAPI_API_KEY });
// No wrapper method for this endpoint yet; client.get() sends the same authenticated GET.
const data = await client.get({
  path: "/tweet/20/thread",
});
```

RapidAPI:

```bash
curl 'https://twitter-aio.p.rapidapi.com/tweet/20/thread' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
  --header 'x-rapidapi-host: twitter-aio.p.rapidapi.com'
```
