# Threads 用户内容 API (threads.user_posts)

- Canonical page: https://everyinfra.com/threads-api/user_posts
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "threads", "action": "user_posts", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 10, max 50 per call
- Mode: sync; add "mode": "async" for slow tasks

Threads 用户内容接口按用户短名 `username` 读取这个账号发的帖子，每条带正文 `text`、链接 `url`、短码 `code`、点赞、评论、转发、引用转发、分享和浏览数，以及发布时间。它回答「这个账号最近发了什么、哪几条反响好」，适合盯一个品牌或创作者的发帖节奏，挑出表现好的帖子。

`username` 可以带 @，但不能填完整的主页链接。`mentions` 列出正文里 @ 到的用户名，`hashtags` 按出现顺序列出话题标签，没有话题标签时不出现。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | profile / user_posts / followers 的 Threads 用户短名，可带 @；profile 与 user_posts 不解析完整主页 URL。followers 返回粉丝数量，不是粉丝名单。 |
| limit | integer (1–50) | no | 10 | 这次调用最多返回的条数，整数，1–50；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| code | 内容短码，用于拼 URL。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 作者昵称（显示名）。 |
| author_is_verified | 作者是否已认证。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| repost_count | 转发数（区别于引用转发）。null 表示不公开。 |
| quote_count | 引用转发数。 |
| share_count | 分享/转发数。null 表示不公开，不等于 0。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| media_type | platform-native meaning |
| hashtags | 正文里的话题标签数组，按出现顺序；没有时不出现这个字段。 |
| mentions | 正文里 @ 到的用户名。 |

## 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": "threads",
  "action": "user_posts",
  "params": {
    "username": "zuck"
  }
}'
```

```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": "threads",
        "action": "user_posts",
        "params": {
            "username": "zuck",
        },
    },
    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 7. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "threads",
  "action": "user_posts",
  "results": [
    {
      "id": "•••",
      "code": "Ddt7cL5EfUG",
      "url": "https://www.threads.com/@zuck/post/Ddt7cL5EfUG",
      "text": "Agrippa said it's time to get back to work 😎",
      "author_username": "zuck",
      "author_name": "•••",
      "author_is_verified": true,
      "like_count": 3245,
      "comment_count": 294,
      "repost_count": 180,
      "quote_count": 29,
      "posted_at": "2026-09-25T16:50:21+00:00",
      "platform": "threads",
      "media_type": "image"
    },
    {
      "id": "•••",
      "code": "Ddpj4YZkd3P",
      "url": "https://www.threads.com/@zuck/post/Ddpj4YZkd3P",
      "text": "Here's everything I announced at Meta Connect today 👇",
      "author_username": "zuck",
      "author_name": "•••",
      "author_is_verified": true,
      "like_count": 2644,
      "comment_count": 597,
      "repost_count": 159,
      "quote_count": 34,
      "posted_at": "2026-09-24T00:07:31+00:00",
      "platform": "threads"
    }
  ],
  "count": 7,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 手里只有 Threads 主页链接，能直接传给 `username` 吗？

不能。用户内容、主页和粉丝数量接口都按用户短名取，`username` 可以带 @，不解析完整主页 URL。读单条帖子则相反，要传帖子的完整链接。短名不是昵称，昵称在 `author_name` 里。

### `mentions` 能用来做什么？

`mentions` 是正文里 @ 到的用户名，可以统计一个账号常提到哪些账号。`hashtags` 同理，按出现顺序给出话题标签。这两个字段都只来自正文，不含评论区。

### 拿到帖子后，想看图片和评论怎么办？

把结果行里的 `url` 交给内容详情，读图片地址、张数和付费合作标注；交给评论接口，读帖子下面的评论。这里的结果没有图片字段，也没有付费合作标识。`view_count` 和 `share_count` 为 null 表示不公开，不等于 0。

## Also

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