# Truth Social 用户内容 API (truth_social.user_posts)

- Canonical page: [https://everyinfra.com/truth-social-api/user_posts](https://everyinfra.com/truth-social-api/user_posts?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "truth_social", "action": "user_posts", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 100 per call
- Mode: sync; add "mode": "async" for slow tasks

Truth Social 用户内容按 `username` 列出一个账号发的帖子，正文、语言、互动计数、发布时间、话题和媒体之外，还标出这条是不是转发 `is_repost`、是不是回复 `is_reply`；回复帖另带被回复的那条内容 `reply_to_id` 和对方账号 `reply_to_account_id`。它回答「这个人最近公开说了什么」，常用于跟踪公众人物的公开发言、做发言统计，或者及时拿到某条帖子的原文。

`username` 填用户短名，可以带 @，示例用的是 realDonaldTrump。正文整段返回，写报道时可以直接引用原话，不用再打开原帖补全；每条的 `url` 留着，方便读者回到原帖核对。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | Truth Social 用户短名，可带 @；user_posts 读取其帖子，replies 读取该作者发出的回复，不是读取别人对某帖的评论。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| language | 内容语言代码（如 zh、en），由平台判定，可能不准。 |
| reply_count | 回复数，通常用于评论的子回复。null 表示不公开。 |
| repost_count | 转发数（区别于引用转发）。null 表示不公开。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 作者昵称（显示名）。 |
| author_id | 作者在原平台的唯一 ID。 |
| author_follower_count | 作者粉丝数。null 表示不公开。 |
| author_verified | 作者是否已认证。 |
| reply_to_id | 被回复的内容 ID。 |
| reply_to_account_id | 被回复账号的 ID。 |
| is_reply | 该条是否为回复。 |
| is_repost | 该条是否为转发（ReTruth）。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| media | 附带的媒体内容。 |
| hashtags | 话题标签。 |
| 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": "truth_social",
  "action": "user_posts",
  "params": {
    "username": "realDonaldTrump"
  }
}'
```

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

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `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": "truth_social",
  "action": "user_posts",
  "results": [
    {
      "id": "•••",
      "url": "https://truthsocial.com/@realDonaldTrump/117336883864922392",
      "text": "Keep the lights on, sideline Big Brother: Trump EPA rollback could save ratepayers $310 billion: https://justthenews.com/government/federal-agencies/trumps-epa-gets-action-roots-out-30-billion-waste-fraud-and-abuse",
      "language": "en",
      "reply_count": 20,
      "repost_count": 61,
      "like_count": 187,
      "author_username": "realDonaldTrump",
      "author_name": "•••",
      "author_id": "•••",
      "author_follower_count": 13079019,
      "author_verified": true,
      "is_reply": false,
      "posted_at": "2026-09-26T10:32:40.145000+00:00",
      "platform": "truth_social"
    },
    {
      "id": "•••",
      "url": "https://truthsocial.com/@realDonaldTrump/117336881513699850",
      "text": "Feds arrest, indict hundreds in Trump voter fraud crackdown: 'Catching it all over the country': https://justthenews.com/politics-policy/elections/feds-have-arrested-indicted-hundreds-voter-fraud-crackdown-catching-it",
      "language": "en",
      "reply_count": 24,
      "repost_count": 70,
      "like_count": 214,
      "author_username": "realDonaldTrump",
      "author_name": "•••",
      "author_id": "•••",
      "author_follower_count": 13079019,
      "author_verified": true,
      "is_reply": false,
      "posted_at": "2026-09-26T10:32:04.269000+00:00",
      "platform": "truth_social"
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 只想看这个账号亲手写的原帖，怎么过滤？

用 `is_repost` 和 `is_reply` 过滤：两项都为 false 的是这个账号自己发的原帖。转发（ReTruth）转的是别人的内容，回复是在接别人的话，分析发言立场前先分开。要专门读这个账号发出的回复，用回复列表那一页；两页都不是读别人对某条帖子的评论。原帖筛出来以后，再按 `hashtags` 数一数这个人常谈哪些话题，看 `media` 统计带图带视频的比例。转发可以单列一类：它说明这个人愿意扩散什么，但措辞不是他的。

### 回复帖能看出这个账号最常和谁互动吗？

能。回复类帖子带 `reply_to_account_id` 和 `reply_to_id`，分别是被回复的账号和那条内容。按账号统计，就能看出这个人最常和谁互动。统计前先把回复帖单独挑出来；被回复方存的是账号 ID，拿它去对其他结果里的作者 ID，比按昵称对可靠。普通原帖没有被回复的对象，这两项在表格里留空即可。对方原话不在结果里，要看就得找到那条帖子的完整链接，交给单条内容那一页。

### 盯住几个关键账号时，用户内容和热榜怎么配合？

盯住几个关键账号时，用用户内容定时拉取，每个短名各调一次；想知道他们的帖子有没有冲上全站热门，再对照热榜。两边按帖子 `id` 对上，就能算出一个账号的上榜频率。一条帖子在这里和热榜上各读到一次，两次的点赞、转发直接相减，就是间隔里涨了多少。`posted_at` 是 UTC 时区的 ISO 8601 时间，两边按它对齐，才好比较同一时段的发帖和上榜情况。作者粉丝数每次都随帖子返回，定时拉取时顺手记下，就是这个账号的粉丝走势。

## Also

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