Threads 用户内容 API
接口健康状态
- 24h 健康值
- 正常
- 健康 / 正常
- 可用
- 少量可用
- 基本不可用
24 小时趋势
30 天趋势
用户内容:返回列表,默认 10 条、单次最多 50 条;主要字段 id、code、url、text、author_username、author_name。
请求发到 POST https://api.everyinfra.com/api/v1/social,platform 填 threads,action 填 user_posts。 单价 $0.56 / 千次(每次 $0.000556),失败和空结果都不收费。 同步返回;慢任务可在请求体加 "mode": "async",先拿 job_id 再轮询。
Threads 用户内容接口按用户短名 username 读取这个账号发的帖子,每条带正文 text、链接 url、短码 code、点赞、评论、转发、引用转发、分享和浏览数,以及发布时间。它回答「这个账号最近发了什么、哪几条反响好」,适合盯一个品牌或创作者的发帖节奏,挑出表现好的帖子。
username 可以带 @,但不能填完整的主页链接。mentions 列出正文里 @ 到的用户名,hashtags 按出现顺序列出话题标签,没有话题标签时不出现。
AI 提示词
#请帮我用 EveryInfra 的「Threads 用户内容」接口(threads/user_posts)写一个数据采集脚本。
接口约定:
- 请求:POST https://api.everyinfra.com/api/v1/social,请求头 Authorization: Bearer <API Key>;Key 从环境变量 EVERYINFRA_API_KEY 读取,不要写进代码。
- 请求体里 platform 填 threads,action 填 user_posts,参数放在 params 里。
- 必填参数:
- username:profile / user_posts / followers 的 Threads 用户短名,可带 @;profile 与 user_posts 不解析完整主页 URL。followers 返回粉丝数量,不是粉丝名单。
- 可选参数:
- limit:这次调用最多返回的条数,整数,1–50;不传按默认值,实际返回可能少于这个数。超过上限会在扣费前返回 422。(默认 10)
- 返回一组记录,每条记录的主要字段:id、code(内容短码)、url、text、author_username、author_name、author_is_verified(作者是否已认证)、like_count、comment_count、repost_count、quote_count(引用转发数)、share_count;一共 17 个字段,完整列表见 https://api.everyinfra.com/api/v1/social/catalog?platform=threads。
- 示例请求体:
{
"platform": "threads",
"action": "user_posts",
"params": {
"username": "zuck"
}
}
- 计费:$0.56 / 千次;失败和空结果不扣费。
- 一次要采几十上百个时,在请求体加 "mode": "async":先拿到 job_id,再轮询 GET https://api.everyinfra.com/api/v1/jobs/{job_id} 取结果。
- 返回 422 时,按错误信息里的候选参数和允许值修正;返回 429 或 503 时,按 Retry-After 等待后重试。
写代码前,先问清楚我要采哪些对象、一共多少个、需要哪些字段、结果存成什么格式,再把方案和大概花费讲给我确认。请求参数
#| 参数名 | 位置 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
Authorization | header | string | 是 | - | Bearer 加你的 API Key。在控制台创建;不要放进网址或代码仓库。 |
platform | body | string | 是 | threads | 平台标识,固定值。 |
action | body | string | 是 | user_posts | 能力标识,固定值。 |
username | body.params | string | 是 | - | profile / user_posts / followers 的 Threads 用户短名,可带 @;profile 与 user_posts 不解析完整主页 URL。followers 返回粉丝数量,不是粉丝名单。 |
limit | body.params | integer (1–50) | 否 | 10 | 这次调用最多返回的条数,整数,1–50;不传按默认值,实际返回可能少于这个数。超过上限会在扣费前返回 422。 |
代码示例
#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"
}
}'OpenAPI 定义 (JSON)示例从环境变量 EVERYINFRA_API_KEY 读取 Key,复制出去的代码不含你的 Key。
响应示例
#{ "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": { … }}
返回字段
#业务数据在 results 里;下表是每条记录可能包含的字段,平台没有提供的值不会被编造。
| 字段 | 含义 |
|---|---|
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 | 保留平台原语义 |
hashtags | 正文里的话题标签数组,按出现顺序;没有时不出现这个字段。 |
mentions | 正文里 @ 到的用户名。 |
常见问题
#手里只有 Threads 主页链接,能直接传给 username 吗?
#不能。用户内容、主页和粉丝数量接口都按用户短名取,username 可以带 @,不解析完整主页 URL。读单条帖子则相反,要传帖子的完整链接。短名不是昵称,昵称在 author_name 里。
mentions 能用来做什么?
#mentions 是正文里 @ 到的用户名,可以统计一个账号常提到哪些账号。hashtags 同理,按出现顺序给出话题标签。这两个字段都只来自正文,不含评论区。
拿到帖子后,想看图片和评论怎么办?
#把结果行里的 url 交给内容详情,读图片地址、张数和付费合作标注;交给评论接口,读帖子下面的评论。这里的结果没有图片字段,也没有付费合作标识。view_count 和 share_count 为 null 表示不公开,不等于 0。
错误与计费
#- 401
- 缺少 Key 或 Key 无效。
- 402
- 余额不足,先充值。
- 422
- 参数名或取值不对,按错误信息给的候选改;不扣费。
- 429
- 超过每分钟请求上限,按 Retry-After 等待后再试。
- 503
- 暂时无法完成,预扣的费用退回;结果未知时先核对,不要直接重发。
- 200 空结果
- 没有数据,不扣费。