POST

接口健康状态

24h 健康值
正常
  • 健康 / 正常
  • 可用
正常

24 小时趋势

30 天趋势

用户主页精选:返回列表;主要字段 type、id、mblogid、url、text、posted_at。

请求发到 POST https://api.everyinfra.com/api/v1/social,platform 填 weibo,action 填 profile_feed。 单价 $0.79 / 千次(每次 $0.000792),失败和空结果都不收费。 同步返回;慢任务可在请求体加 "mode": "async",先拿 job_id 再轮询。

AI 提示词

#
请帮我用 EveryInfra 的「微博用户主页精选」接口(weibo/profile_feed)写一个数据采集脚本。

接口约定:
- 请求:POST https://api.everyinfra.com/api/v1/social,请求头 Authorization: Bearer <API Key>;Key 从环境变量 EVERYINFRA_API_KEY 读取,不要写进代码。
- 请求体里 platform 填 weibo,action 填 profile_feed,参数放在 params 里。
- 必填参数:
  - user_id:微博数字 UID,也可传含 /u/数字UID 的主页链接;不收昵称(先用 user_search 按昵称找到 user_id),在扣费前拒绝(422)。
- 可选参数:
  - limit:这次调用最多返回的条数,整数,至少为 1;不传按默认值,实际返回可能少于这个数。
- 返回一组记录,每条记录的主要字段:type、id、mblogid(微博的 mblogid(user_…)、url、text、posted_at、edited_at(微博的编辑时间(user_arti…)、edit_count(微博的编辑次数(user_arti…)、device(发布设备(如「iPhone客户端」))、ip_location(发布时的 IP 属地(commen…)、like_count、like_count_label(点赞数的原文(user_artic…);一共 50 个字段,完整列表见 https://api.everyinfra.com/api/v1/social/catalog?platform=weibo。
- 示例请求体:
{
  "platform": "weibo",
  "action": "profile_feed",
  "params": {
    "user_id": "1195054531"
  }
}
- 计费:$0.79 / 千次;失败和空结果不扣费。
- 一次要采几十上百个时,在请求体加 "mode": "async":先拿到 job_id,再轮询 GET https://api.everyinfra.com/api/v1/jobs/{job_id} 取结果。
- 返回 422 时,按错误信息里的候选参数和允许值修正;返回 429 或 503 时,按 Retry-After 等待后重试。

写代码前,先问清楚我要采哪些对象、一共多少个、需要哪些字段、结果存成什么格式,再把方案和大概花费讲给我确认。

请求参数

#
参数名位置类型必填默认值说明
Authorizationheaderstring是-Bearer 加你的 API Key。在控制台创建;不要放进网址或代码仓库。
platformbodystring是weibo平台标识,固定值。
actionbodystring是profile_feed能力标识,固定值。
user_idbody.paramsstring是-微博数字 UID,也可传含 /u/数字UID 的主页链接;不收昵称(先用 user_search 按昵称找到 user_id),在扣费前拒绝(422)。返回这个用户主页「精选」栏里的微博(5~7 条),不翻页,不收 page_token 和 limit。
limitbody.paramsinteger (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": "weibo",
  "action": "profile_feed",
  "params": {
    "user_id": "1195054531"
  }
}'

OpenAPI 定义 (JSON)示例从环境变量 EVERYINFRA_API_KEY 读取 Key,复制出去的代码不含你的 Key。

user_id 填微博数字 UID;返回主页「精选」栏里的微博,不翻页。

响应示例

#
这组示例参数还没有真实样例:这里只按接口定义列出响应结构和字段,值用 … 占位,不是一次真实调用的结果。
json
{  "id": "req_…",  "platform": "weibo",  "action": "profile_feed",  "results": [    {      "type": …,      "id": …,      "mblogid": …,      "url": …,      "text": …,      "posted_at": …,      "edited_at": …,      "edit_count": …,      "device": …,      "ip_location": …,      "like_count": …,      "like_count_label": …,      "comment_count": …,      "comment_count_label": …,      "repost_count": …,      "repost_count_label": …,      "view_count": …,      "author_id": …,      "author_username": …,      "author_name": …,      "author_avatar_url": …,      "author_verified": …,      "author_verified_type": …,      "author_verified_reason": …,      "author_bio": …,      "author_follower_count": …,      "author_follower_count_label": …,      "author_following_count": …,      "author_following_count_label": …,      "image_urls": …,      "image_count": …,      "video_id": …,      "video_url": …,      "duration_sec": …,      "duration_seconds": …,      "cover_image_url": …,      "play_count": …,      "play_count_label": …,      "hashtags": …,      "mentions": …,      "links": …,      "links_detail": …,      "is_long_text": …,      "is_truncated": …,      "is_pinned": …,      "is_repost": …,      "is_paid": …,      "is_ad": …,      "original_post_id": …,      "reposted_post": …,      "platform": …    }  ],  "count": …,  "billing": {    "charged": …,    "charged_usd": …,    "balance_after_usd": …,    …  },  "quota": { … }}

返回字段

#

业务数据在 results 里;下表是每条记录可能包含的字段,平台没有提供的值不会被编造。

字段含义
type记录类型,取值随能力而定(如 video / image / text)。
id该记录在原平台上的唯一标识。仅在同一平台内唯一,跨平台可能重复。
mblogid微博的 mblogid(user_articles、profile_feed)。
url该记录在原平台上的可访问链接。
text正文内容,已去除 HTML 标签,全文返回、不截断(个别平台的列表结果本身只有摘要,以该平台的字段说明为准)。
posted_at发布时间,ISO 8601 格式、UTC 时区(如 2026-08-07T12:34:56+00:00)。平台只给非标准字符串时原样透传,解析前建议做容错。null 表示平台未公开。
edited_at微博的编辑时间(user_articles、profile_feed),ISO 8601、UTC。
edit_count微博的编辑次数(user_articles、profile_feed)。
device发布设备(如「iPhone客户端」)。
ip_location发布时的 IP 属地(comment_replies、user_articles、profile_feed),如「来自 广东」;微博没显示时没有。
like_count点赞数。null 表示该平台或该接口不公开此数据,不等于 0。
like_count_label点赞数的原文(user_articles、profile_feed):微博页面上写的,如「100万+」「2379.8万」。
comment_count评论数。null 表示不公开,不等于 0。
comment_count_label评论数的原文(user_articles、profile_feed):微博页面上写的,如「100万+」「2379.8万」。
repost_count转发数(区别于引用转发)。null 表示不公开。
repost_count_label转发数的原文(user_articles、profile_feed):微博页面上写的,如「100万+」「2379.8万」。
view_count阅读数(post_detail、user_articles、profile_feed):微博显示的这条微博被阅读的次数;多数微博不显示阅读数,这时没有这个字段;user_posts 的列表回包里没有。
author_id作者在原平台的唯一 ID。
author_username作者用户名(@handle),通常可用于拼 URL。
author_name作者昵称(显示名)。
author_avatar_url作者头像。search 部分请求不返回。
author_verified作者是否加 V。search 部分请求不返回。
author_verified_type作者的认证类型(user_articles、profile_feed)。
author_verified_reason认证说明(如「XX公司CEO」),判断大V身份靠它;没认证时没有。search、user_posts 部分请求不返回。
author_bio作者简介;作者没填时没有。search、user_posts 部分请求不返回。
author_follower_count作者粉丝数。search、user_posts 部分请求不返回。video 只在按视频链接或视频编号查时有,是约数。
author_follower_count_label作者粉丝数的原文(user_articles、profile_feed):微博页面上写的,如「100万+」「2379.8万」。
author_following_count作者关注数。search、user_posts 部分请求不返回。
author_following_count_label作者关注数的原文(user_articles、profile_feed):微博页面上写的,如「100万+」「2379.8万」。
image_urls图片列表;不带图的微博没有。
image_count微博里的图片张数(user_articles、profile_feed)。
video_id视频编号(video、collection_videos、video_feed)。
video_url视频链接;不是视频微博时没有。
duration_sec视频时长(秒;post_detail、user_posts、video、collection_videos、video_feed、user_articles、profile_feed 的视频微博)。
duration_seconds时长,单位秒。非视频/音频内容为 null。
cover_image_url封面图。
play_count视频播放数(video、collection_videos、video_feed、user_articles、profile_feed)。collection_videos 和按微博链接或微博 ID 查的 video 是准确数;video 按视频链接或视频编号查时、video_feed 里是约数(微博显示「13.8万」这类,换成了数字)。不是 view_count(微博阅读数)。
play_count_label视频播放数的原文(user_articles、profile_feed):微博页面上写的,如「100万+」「2379.8万」。
hashtags正文里的话题标签数组,按出现顺序;没有时不出现这个字段。
mentions微博里 @ 提到的账号(user_articles、profile_feed)。
links个人主页上的链接(user_about),数组;user_articles、profile_feed 里是微博里的链接。
links_detail微博里每个链接的详情(user_articles、profile_feed):[{url, short_url, title}]。
is_long_text是不是长微博(post_detail / user_posts / user_articles / profile_feed)。user_posts 上长微博的 text 只有开头一段(约 140 字)。
is_truncatedtext 是不是被截断的(user_articles、profile_feed):是 true 时,全文用 id 调 post_detail 取。
is_pinned是不是置顶微博(user_articles、profile_feed)。
is_repost是否为转发。
is_paid是不是付费微博(user_articles、profile_feed)。
is_ad是不是广告微博(user_articles、profile_feed)。
original_post_id转发微博时,被转发的原微博 ID(post_detail / user_posts / user_articles / profile_feed);可作为 post_detail 的 url 传入读原微博。不是转发时没有这个键。
reposted_post被转发的那条微博(user_articles、profile_feed):形状和一行相同,里面不再套被转发的微博。
platform数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。

错误与计费

#
401
缺少 Key 或 Key 无效。
402
余额不足,先充值。
422
参数名或取值不对,按错误信息给的候选改;不扣费。
429
超过每分钟请求上限,按 Retry-After 等待后再试。
503
暂时无法完成,预扣的费用退回;结果未知时先核对,不要直接重发。
200 空结果
没有数据,不扣费。

错误码

Google Analytics 同意才加载 隐私