# X (Twitter) 是否转推 API (twitter.check_retweet)

- Canonical page: https://everyinfra.com/twitter-api/check_retweet
- Endpoint: POST /api/v1/social with {"platform": "twitter", "action": "check_retweet", "params": {...}}
- Price: $0.000806 per call ($0.81 per 1,000 requests); failed and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

是否转推按 `username` 和 `id` 判断一个账号有没有转推过某条帖子，返回单个对象：`post_id` 是被查的帖子，`is_retweeted` 是结果。它回答「这个账号转了这条没有」，适合核对合作方有没有按约定转发，或者统计一批账号里有多少转了同一条帖子。

查一批账号时，帖子保持不变，每个账号调一次。X 官方有按帖子 ID 列出转推者的接口，说明转推关系可以按帖子来定位；这一页只回答一个账号的是与否，不列名单。`username` 填要查的账号，可以带 @。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=twitter&action=check_retweet

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | 要查的账号，X 用户短名，可带 @。 |
| id | not declared | yes | not declared | 数字帖子 ID，也可填帖子链接；查 username 有没有转推这条帖子。 |
| url | not declared | no | not declared | 兼容写法，可以不传：帖子链接直接填进必填的 id 即可；id 和 url 都填时以 id 为准。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| username | 用户名（@handle）。 |
| post_id | platform-native meaning |
| is_retweeted | username 是否转推过这条帖子（check_retweet）。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "twitter",
  "action": "check_retweet",
  "params": {
    "username": "nasa",
    "id": "2103610284464316469"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "twitter",
        "action": "check_retweet",
        "params": {
            "username": "nasa",
            "id": "2103610284464316469",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "twitter",
  "action": "check_retweet",
  "results": {
    "username": …,
    "post_id": …,
    "is_retweeted": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 帖子链接可以直接填进 `id` 吗？

可以。`id` 接受数字帖子 ID，也接受帖子链接，所以兼容参数 `url` 不用传；真的两个都填了，以 `id` 为准。填链接时，放的是帖子链接，不是账号主页。返回里的 `post_id` 标明查的是哪条帖子，批量核对时可以用它对应到你的任务表。

### 想知道一条帖子被哪些账号转了，用这一页吗？

不用。这一页要先指定账号，只回答这个账号转没转。想拿到转推者名单，用转推用户那一页：同样按帖子 ID 查，每页约 100 个账号，还带粉丝数和发帖数。手里已经有一份要核对的账号名单时，才适合逐个用这一页查。

### 这一页和是否关注那一页怎么配合？

两页都从 `username` 出发，各返回一个对象。做互动任务的核验时，先用是否关注查关注关系，再用这一页查转推：前者要被关注方的用户名，这一页要帖子 `id`，返回的布尔值也不同。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=twitter
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
