# X (Twitter) 账号转发的帖子 API (twitter.user_reposts)

- Canonical page: [https://everyinfra.com/twitter-api/user_reposts](https://everyinfra.com/twitter-api/user_reposts?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "twitter", "action": "user_reposts", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, one page of up to 20 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

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | X 用户短名，可带 @，也可填主页链接 https://x.com/<用户名>；返回这个账号转发的帖子，按转发时间从新到旧，每页 20 条。 |
| page_token | not declared | no | not declared | 翻页令牌：把上一次响应里的 next_page_token 原样传回，拿下一页；不传从第一页开始。令牌 24 小时有效，每页算一次调用。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| retweet_count | 转发数。 |
| reply_count | 回复数，通常用于评论的子回复。null 表示不公开。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 作者昵称（显示名）。 |
| author_url | 作者在原平台的主页链接。 |
| author_follower_count | 作者粉丝数。null 表示不公开。 |
| quote_count | platform-native meaning |
| bookmark_count | 书签（收藏）数。 |
| language | 内容语言代码（如 zh、en），由平台判定，可能不准。 |
| conversation_id | 所属对话串 ID（根推文 ID），同一串的回复据此归在一起。 |
| is_reply | platform-native meaning |
| is_quote | 是否引用推文。 |
| is_repost | platform-native meaning |
| reply_to_id | platform-native meaning |
| reply_to_user_id | 所回复用户的数字 ID。 |
| reply_to | platform-native meaning |
| media | 推文图片 / 视频：type（photo / video / animated_gif）、url（图片或视频封面）、width、height、duration_sec（视频秒数）、video_url（码率最高的 mp4）。 |
| hashtags | 正文里的话题标签数组，按出现顺序；没有时不出现这个字段。 |
| mentions | 正文里 @ 到的用户名。 |
| links | 正文里的外链（展开后的完整网址）。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_avatar_url | 作者头像图片链接（多数平台带签名、会过期）。 |
| author_bio | platform-native meaning |
| author_is_verified | platform-native meaning |
| author_created_at | platform-native meaning |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| reposted_by | 转发这条帖子的账号（用户名）；这一行本身是被转发的原帖。不是转发进来的行没有这个字段。 |
| reposted_at | 转发的时间。不是转发进来的行没有这个字段。 |

## 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": "user_reposts",
  "params": {
    "username": "nasa"
  }
}'
```

```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": "user_reposts",
        "params": {
            "username": "nasa",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:22:03Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "twitter",
  "action": "user_reposts",
  "results": [
    {
      "id": "•••",
      "url": "https://x.com/NASASpox/status/2123892108893295099",
      "text": "Another week of exploration, partnership, and discovery at @NASA!\n\n📡 Voyager 1 reaches one light-day from Earth\n🇯🇵 @••• visits Japan and JAXA\n🧪 @••• ISS research heads home to advance medicine and future missions\n\nHere’s your NASA Minute!",
      "like_count": 397,
      "retweet_count": 48,
      "reply_count": 16,
      "view_count": 120614,
      "posted_at": "2026-11-20T21:31:53+00:00",
      "author_username": "N•••x",
      "author_name": "N•••x",
      "author_url": "https://x.com/•••",
      "author_follower_count": 20752,
      "quote_count": 5,
      "bookmark_count": 20,
      "language": "en",
      "conversation_id": "2123892108893295099",
      "is_reply": false,
      "is_quote": false,
      "is_repost": true,
      "media": [
        {
          "type": "video",
          "url": "https://pbs.twimg.com/media/HXmO91SXUAAwUEh.jpg",
          "width": 1080,
          "height": 1920,
          "duration_sec": 100.7,
          "video_url": "https://video.twimg.com/amplify_video/2123885768443674624/vid/avc1/1080x1920/XU-ESVN5knbA18fV.mp4?tag=29"
        }
      ],
      "mentions": [
        "NASA",
        "N•••n",
        "S•••n"
      ],
      "author_id": "•••",
      "author_avatar_url": "https://pbs.twimg.com/•••",
      "author_bio": "•••",
      "author_is_verified": true,
      "author_created_at": "2025-04-03T20:34:05+00:00",
      "platform": "twitter",
      "reposted_by": "NASA",
      "reposted_at": "2026-11-20T22:32:40+00:00"
    },
    {
      "id": "•••",
      "url": "https://x.com/NASASolarSystem/status/2123830179617186024",
      "text": "Millions of people fly every day, but there’s only one trip like this. 🚀\n\nSend your name nearly a billion miles to Saturn’s moon Titan with NASA’s Dragonfly mission. Boarding passes for you and your crew: https://go.nasa.gov/dragonfly-names",
      "like_count": 545,
      "retweet_count": 107,
      "reply_count": 23,
      "view_count": 121493,
      "posted_at": "2026-11-20T17:25:48+00:00",
      "author_username": "N•••m",
      "author_name": "N•••m",
      "author_url": "https://x.com/•••",
      "author_follower_count": 2977774,
      "quote_count": 13,
      "bookmark_count": 114,
      "language": "en",
      "conversation_id": "2123830179617186024",
      "is_reply": false,
      "is_quote": false,
      "is_repost": true,
      "media": [
        {
          "type": "video",
          "url": "https://pbs.twimg.com/media/HXlcSwjWQAAzLF2.png",
          "width": 720,
          "height": 405,
          "duration_sec": 50,
          "video_url": "https://video.twimg.com/amplify_video/2123830107949117440/vid/avc1/1920x1080/TEGVtCeTF12JkdXh.mp4?tag=16"
        }
      ],
      "links": [
        "https://go.nasa.gov/dragonfly-names"
      ],
      "author_id": "•••",
      "author_avatar_url": "https://pbs.twimg.com/•••",
      "author_bio": "•••",
      "author_is_verified": true,
      "author_created_at": "2008-06-19T03:16:46+00:00",
      "platform": "twitter",
      "reposted_by": "NASA",
      "reposted_at": "2026-11-20T17:55:17+00:00"
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## 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
