微信视频号用户内容 API
POST
接口健康状态
- 24h 健康值
- 正常
- 24h 平均耗时
- —
- 健康 / 正常
- 可用
- 少量可用
- 基本不可用
正常
24 小时趋势
30 天趋势
用户内容:返回列表;主要字段 id、author_username、author_name、title、description、posted_at。
单价 $46 / 千次(每次 $0.046),失败与空结果不扣费。 同步返回;慢任务可在请求体加 "mode": "async",先拿 job_id 再轮询。
AI 提示词
复制下面这段给你常用的 AI 助手:里面写好了这个接口的参数、返回字段和示例请求,它会先问清你的需求,再帮你写采集脚本。
请帮我用 EveryInfra 的「微信视频号用户内容」接口(wechat_channels/user_posts)写一个数据采集脚本。
接口约定:
- 请求:POST https://api.everyinfra.com/api/v1/social,请求头 Authorization: Bearer <API Key>;Key 从环境变量 EVERYINFRA_API_KEY 读取,不要写进代码。
- 请求体里 platform 填 wechat_channels,action 填 user_posts,参数放在 params 里。
- 必填参数:
- username:账号 ID,形如 v2_…@finder,取自 user_posts 或 video 返回行的 author_username;不是昵称,搜索结果里没有。每次返回这个账号最新的 15 条视频。
- 可选参数:
- limit:这次调用最多返回的条数,整数,至少为 1;不传按默认值,实际返回可能少于这个数。
- 返回一组记录,每条记录的主要字段:id(视频 ID(user_posts…)、author_username(作者的视频号账号 ID)、author_name、title、description、posted_at、like_count、collect_count(收藏数(user_posts /…)、share_count、comment_count、duration_sec(视频时长(秒))、duration_seconds;一共 17 个字段,完整列表见 https://api.everyinfra.com/api/v1/social/catalog?platform=wechat_channels。
- 示例请求体:
{
"platform": "wechat_channels",
"action": "user_posts",
"params": {
"username": "v2_060000231003b20faec8c7ea8d11c3d4c907e83db0775f87c9449acd6a89298e462485cc23a8@finder"
}
}
- 计费:$46 / 千次;失败和空结果不扣费。
- 一次要采几十上百个时,在请求体加 "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 | 是 | wechat_channels | 平台标识,固定值。 |
action | body | string | 是 | user_posts | 能力标识,固定值。 |
username | body.params | string | 是 | - | 账号 ID,形如 v2_…@finder,取自 user_posts 或 video 返回行的 author_username;不是昵称,搜索结果里没有。每次返回这个账号最新的 15 条视频。 |
limit | body.params | integer (1–) | 否 | - | 这次调用最多返回的条数,整数,至少为 1;不传按默认值,实际返回可能少于这个数。 |
代码示例
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": "wechat_channels",
"action": "user_posts",
"params": {
"username": "v2_060000231003b20faec8c7ea8d11c3d4c907e83db0775f87c9449acd6a89298e462485cc23a8@finder"
}
}'OpenAPI 定义 (JSON)示例从环境变量 EVERYINFRA_API_KEY 读取 Key,复制出去的代码不含你的 Key。
响应示例
字段预览
这组示例参数还没有真实样例:这里只按接口定义列出响应结构和字段,值用 … 占位,不是一次真实调用的结果。
json
{
"id": "req_…",
"platform": "wechat_channels",
"action": "user_posts",
"results": [
{
"id": …,
"author_username": …,
"author_name": …,
"title": …,
"description": …,
"posted_at": …,
"like_count": …,
"collect_count": …,
"share_count": …,
"comment_count": …,
"duration_sec": …,
"duration_seconds": …,
"video_width": …,
"video_height": …,
"cover_url": …,
"video_url": …,
"video_decode_key": …,
"platform": …
}
],
"count": …,
"billing": {
"charged": …,
"charged_usd": …,
"balance_after_usd": …,
…
},
"quota": { … }
}返回字段
业务数据在 results 里;下表是每条记录可能包含的字段,平台没有提供的值不会被补造。
| 字段 | 含义 |
|---|---|
id | 视频 ID(user_posts / video),纯数字字符串;作为 video 的 object_id 传回可读这条视频。 |
author_username | 作者的视频号账号 ID,形如 v2_…@finder(user_posts / video);作为 user_posts 的 username 传回可读这个账号的视频。 |
author_name | 作者昵称(显示名)。 |
title | 标题。平台无标题概念时(如纯文本帖)为 null。 |
description | 简介或描述,通常比 text 短。 |
posted_at | 发布时间,ISO 8601 格式、UTC 时区(如 2026-08-07T12:34:56+00:00)。平台只给非标准字符串时原样透传,解析前建议做容错。null 表示平台未公开。 |
like_count | 点赞数。null 表示该平台或该接口不公开此数据,不等于 0。 |
collect_count | 收藏数(user_posts / video)。 |
share_count | 分享/转发数。null 表示不公开,不等于 0。 |
comment_count | 评论数。null 表示不公开,不等于 0。 |
duration_sec | 视频时长(秒)。 |
duration_seconds | 时长,单位秒。非视频/音频内容为 null。 |
video_width | 视频画面宽度(像素)。 |
video_height | 视频画面高度(像素)。 |
cover_url | 视频封面图链接(带签名,会过期)。 |
video_url | 视频文件地址(user_posts / video;带签名,约 24 小时内有效)。视频号对文件开头一段做了加密,直接下载的文件不能播放,要先用 video_decode_key 解密。 |
video_decode_key | 解密视频文件开头那段加密内容用的密钥(user_posts / video),和 video_url 配套。 |
platform | 数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。 |
错误与计费
- 401
- 缺少 Key 或 Key 无效。
- 402
- 余额不足,先充值。
- 422
- 参数名或取值不对,按错误信息给的候选改;不扣费。
- 429
- 超过每分钟请求上限,按 Retry-After 等待后再试。
- 503
- 暂时无法完成,预扣的费用退回;结果未知时先核对,不要直接重发。
- 200 空结果
- 没有数据,不扣费。