# X (Twitter) 转推用户 API (twitter.retweeters)

- Canonical page: https://everyinfra.com/twitter-api/retweeters
- Endpoint: POST /api/v1/social with {"platform": "twitter", "action": "retweeters", "params": {...}}
- Price: $0.000806 per call ($0.81 per 1,000 requests); failed and empty results are not charged
- Returns: list, one page of up to 100 per call; the number of rows varies from page to page and a short page is not the end (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page; no next_page_token means the end)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- Mode: sync; add "mode": "async" for slow tasks

转推用户按 `id` 读取转推了某条帖子的账号，每行是一个账号：用户名、名称、`follower_count`、`following_count`、`post_count`，以及用户搜索没有的 `media_count`，也就是账号发过的图片和视频数。它回答「这条帖子被哪些账号转了」，适合找传播里的放大器，或者复盘一次传播靠谁推起来。

`id` 也可以填帖子链接，此时 `url` 不用传，同时填了也只认 `id`。一页约 100 个账号，转推多的帖子要带上 `page_token` 往后翻，每页单独算一次调用。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| id | not declared | yes | not declared | 数字帖子 ID（x.com/用户名/status/ 后的数字），也可填帖子链接；返回转推了这条帖子的账号，每页约 100 个。 |
| page_token | not declared | no | not declared | 翻页令牌：把上一次响应里的 next_page_token 原样传回，拿下一页；不传从第一页开始。令牌 24 小时有效，每页算一次调用。 |
| url | not declared | no | not declared | 兼容写法，可以不传：帖子链接直接填进必填的 id 即可；id 和 url 都填时以 id 为准。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| media_count | 账号发过的图片 / 视频数（retweeters）。 |
| next_page_token | platform-native meaning |
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| username | 用户名（@handle）。 |
| url | 该记录在原平台上的可访问链接。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| follower_count | 粉丝数。null 表示不公开，不等于 0。 |
| following_count | 关注数。null 表示不公开，不等于 0。 |
| post_count | 发布内容总数。null 表示不公开，不等于 0。 |
| 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": "retweeters",
  "params": {
    "id": "2116263878807998722"
  }
}'
```

```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": "retweeters",
        "params": {
            "id": "2116263878807998722",
        },
    },
    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": "retweeters",
  "results": [
    {
      "media_count": …,
      "next_page_token": …,
      "id": …,
      "username": …,
      "url": …,
      "name": …,
      "text": …,
      "follower_count": …,
      "following_count": …,
      "post_count": …,
      "platform": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 一页不足 100 个账号，是不是已经读完了？

不是。每页只是约 100 个，条数不固定，短页不代表到底。判断读完的唯一依据是响应里没有 `next_page_token`；传 `limit` 也不能改变每页数量。令牌只有 24 小时有效，超时就从第一页重新读。

### `media_count` 怎么读？

它是这个账号发过的图片和视频数，和 `post_count` 对照着看：媒体数占发帖总数的比例高，说明账号偏爱发图片和视频。用户搜索那一页没有这个字段，转推用户这一页才有。`follower_count`、`following_count`、`post_count` 为 null 表示不公开，不等于 0。

### 转推用户和用户搜索都返回账号，怎么选？

已经有一条帖子，想知道谁转了它，用这一页，传 `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
