# Engagement check

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

Whether one user retweeted, replied to or quoted a tweet.

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

## 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. |
| `username` | query | string | no |  | Handle of the user to check, with or without @. Either username or userId is required. |
| `userId` | query | string | no |  | Numeric ID of the user to check, instead of username. |

## Notes

- Billed as three calls: one each for retweets, replies and quotes.
- No simple format: with format=simple the response is the same as without it.

## Response

Built by the API: {"tweetId", "userId", "username", "retweeted", "retweetId", "replied", "replyIds", "repliedInThread", "threadReplyIds", "quoted", "quoteIds"}. replied means a direct reply to the tweet; repliedInThread also counts replies elsewhere in its conversation. retweeted is null when the user retweets so often that the check could not reach the tweet's time; retweetId is the user's retweet.

## Errors

| Status | When |
| --- | --- |
| 422 | tweetId is not numeric. |
| 400 | username and userId are both missing. |
| 422 | username or userId is not valid, or the username lookup failed. |
| 404 | The user could not be 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/2127075627668832611/engagement?username=NASA' \
  --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/2127075627668832611/engagement",
    headers={"X-API-KEY": "YOUR_API_KEY"},
    params={
        "username": "NASA",
    },
    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/2127075627668832611/engagement",
  query: {
    username: "NASA",
  },
});
```

RapidAPI:

```bash
curl 'https://twitter-aio.p.rapidapi.com/tweet/2127075627668832611/engagement?username=NASA' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
  --header 'x-rapidapi-host: twitter-aio.p.rapidapi.com'
```

## Example response

Shortened: arrays keep their first items and long strings are cut.

Raw (default):

```json
{
  "tweetId": "2127075627668832611",
  "userId": "11348282",
  "username": "NASA",
  "retweeted": true,
  "retweetId": "2127101633247019094",
  "replied": false,
  "replyIds": [],
  "repliedInThread": false,
  "threadReplyIds": [],
  "quoted": false,
  "quoteIds": []
}
```
