微信视频号主页或对象详情 API
POST
接口健康状态
- 24h 健康值
- 正常
- 24h 平均耗时
- —
- 健康 / 正常
- 可用
- 少量可用
- 基本不可用
正常
24 小时趋势
30 天趋势
主页或对象详情:返回单个对象;主要字段 username、display_name、bio、avatar_url、region、follower_count。
单价 $8 / 千次(每次 $0.008),失败与空结果不扣费。 同步返回;慢任务可在请求体加 "mode": "async",先拿 job_id 再轮询。
AI 提示词
请帮我用 EveryInfra 的「微信视频号主页或对象详情」接口(wechat_channels/profile)写一个数据采集脚本。
接口约定:
- 请求:POST https://api.everyinfra.com/api/v1/social,请求头 Authorization: Bearer <API Key>;Key 从环境变量 EVERYINFRA_API_KEY 读取,不要写进代码。
- 请求体里 platform 填 wechat_channels,action 填 profile,参数放在 params 里。
- 必填参数:
- username:账号 ID,形如 v2_…@finder,取自 user_posts 或 video 返回行的 author_username;也可以传视频号主页上 sph 开头的视频号 ID(例如 sphi9BjV8GK0Zsl)。
- 返回一个对象,主要字段:username(视频号账号 ID)、display_name、bio、avatar_url、region(账号资料上显示的地区(profil…)、follower_count(粉丝数(profile))、post_count(账号发布的作品数(profile))、collection_count(账号建的合集数(profile))、live_duration_hours(账号资料里的直播时长)、verified_reason(认证说明(profile))、linked_accounts(和这个视频号关联的其他微信账号(p…)。
- 示例请求体:
{
"platform": "wechat_channels",
"action": "profile",
"params": {
"username": "v2_060000231003b20faec8c7ea8d11c3d4c907e83db0775f87c9449acd6a89298e462485cc23a8@finder"
}
}
- 计费:$8 / 千次;失败和空结果不扣费。
- 一次要采几十上百个时,在请求体加 "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 | 是 | profile | 能力标识,固定值。 |
username | body.params | string | 是 | - | 账号 ID,形如 v2_…@finder,取自 user_posts 或 video 返回行的 author_username;也可以传视频号主页上 sph 开头的视频号 ID(例如 sphi9BjV8GK0Zsl);不是昵称,搜索结果里没有。 |
代码示例
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": "profile",
"params": {
"username": "v2_060000231003b20faec8c7ea8d11c3d4c907e83db0775f87c9449acd6a89298e462485cc23a8@finder"
}
}'OpenAPI 定义 (JSON)示例从环境变量 EVERYINFRA_API_KEY 读取 Key,复制出去的代码不含你的 Key。
响应示例
字段预览
这组示例参数还没有真实样例:这里只按接口定义列出响应结构和字段,值用 … 占位,不是一次真实调用的结果。
json
{
"id": "req_…",
"platform": "wechat_channels",
"action": "profile",
"results": {
"username": …,
"display_name": …,
"bio": …,
"avatar_url": …,
"region": …,
"follower_count": …,
"post_count": …,
"collection_count": …,
"live_duration_hours": …,
"verified_reason": …,
"linked_accounts": …,
"platform": …
},
"billing": {
"charged": …,
"charged_usd": …,
"balance_after_usd": …,
…
},
"quota": { … }
}返回字段
业务数据在 results 里;下表是每条记录可能包含的字段,平台没有提供的值不会被补造。
| 字段 | 含义 |
|---|---|
username | 视频号账号 ID,形如 v2_…@finder(profile),和请求的一致;可作为 user_posts 的 username。 |
display_name | 显示名,可能与 username 不同。 |
bio | 个人简介,账号自己填写的文本。可能含换行和 emoji。 |
avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接,可能有时效。 |
region | 账号资料上显示的地区(profile),按平台原文(如 Beijing)。 |
follower_count | 粉丝数(profile)。视频号主页一般不公开粉丝数,拿不到时没有这个字段(不是 0)。 |
post_count | 账号发布的作品数(profile)。 |
collection_count | 账号建的合集数(profile);没建合集时没有。 |
live_duration_hours | 账号资料里的直播时长,单位小时(profile),按平台给的原值。 |
verified_reason | 认证说明(profile);没认证时没有这个字段。 |
linked_accounts | 和这个视频号关联的其他微信账号(profile),每项 name 名称、type 类型(如 公众号);没有关联账号时没有。 |
platform | 数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。 |
错误与计费
- 401
- 缺少 Key 或 Key 无效。
- 402
- 余额不足,先充值。
- 422
- 参数名或取值不对,按错误信息给的候选改;不扣费。
- 429
- 超过每分钟请求上限,按 Retry-After 等待后再试。
- 503
- 暂时无法完成,预扣的费用退回;结果未知时先核对,不要直接重发。
- 200 空结果
- 没有数据,不扣费。