微博 / Weibo API - 热搜、搜索、评论、用户数据 avatar

微博 / Weibo API - 热搜、搜索、评论、用户数据

Pricing

from $4.99 / 1,000 dataset items

Go to Apify Store
微博 / Weibo API - 热搜、搜索、评论、用户数据

微博 / Weibo API - 热搜、搜索、评论、用户数据

社媒数据助手 SocialDataX 提供的只读微博 / Weibo data API,支持微博热搜 / Weibo hot search、微博搜索 / Weibo search、帖子详情 / post details、评论导出 / comments export、评论回复 / comment replies、点赞用户 / post likers、转发列表 / reposts、用户资料 / user profiles 和用户微博列表 / user posts。

Pricing

from $4.99 / 1,000 dataset items

Rating

0.0

(0)

Developer

SocialDataX

SocialDataX

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

7 days ago

Last modified

Share

这是社媒数据助手 SocialDataX 的 Apify Actor 适配层,提供只读微博 / Weibo data API。常见用法包括微博搜索 / Weibo search、微博热搜 / Weibo hot search、微博评论导出 / Weibo comments export、微博用户资料 / Weibo user profile 和微博用户帖子列表 / Weibo user posts。

Apify 用户无需配置 SocialDataX API Key;直接通过 Apify Console、Apify API、Dataset export 或自动化工作流运行即可。

支持能力:

  • 热搜 / hot list
  • 帖子搜索 / post search
  • 帖子详情 / post details
  • 评论列表 / comments
  • 评论回复 / comment replies
  • 点赞用户 / post likers
  • 转发列表 / reposts
  • 用户资料 / user profiles
  • 用户微博列表 / user posts

This Actor is a read-only, unofficial data API integration. It is not affiliated with Weibo.

Support / 联系我们

如果 run 失败、需要更高用量,或想接入批量数据工作流,请通过 SocialDataX support 联系我们:

If a run fails, you need higher limits, or you want to discuss a bulk data workflow, contact SocialDataX support:

选择字段

先选择 operation,再填写该 operation 需要的字段。Apify 表单里其它字段可以留空;即使误填了无关字段,Actor 也会忽略。

Operation必填字段可选字段说明
search_postskeywordpage_token, max_items, auto_paginate按关键词搜索微博帖子,默认会自动翻页直到达到 max_items
search_hot_listmax_items微博热搜榜,请求一次并按 max_items 限制写入 Dataset。
get_post_detailpost_idpost_url 至少填一个获取单条微博帖子详情;两者都填时优先使用 post_url
get_post_commentspost_idpost_url 至少填一个page_token, sort_type, max_items, auto_paginate获取一级评论列表;两者都填时优先使用 post_url
get_post_comment_repliespost_id, comment_idpage_token, max_items, auto_paginate获取某条一级评论下的回复。先运行 get_post_comments,从 Dataset 的 post_idcomment_id 字段复制真实 ID。
list_post_likerspost_idpost_url 至少填一个page_token, max_items, auto_paginate获取点赞用户列表;两者都填时优先使用 post_url
list_post_repostspost_idpost_url 至少填一个page_token, max_items, auto_paginate获取转发列表;两者都填时优先使用 post_url
get_user_infouser_idprofile_url 至少填一个获取用户资料;两者都填时优先使用 profile_url
list_user_postsuser_idprofile_url 至少填一个page_token, max_items, auto_paginate获取用户微博列表;两者都填时优先使用 profile_url

字段填写建议 / Input tips

  • keyword: 仅用于 search_posts。默认示例是 露营
  • post_url: 推荐直接粘贴微博帖子链接或分享文案,适用于 get_post_detailget_post_commentslist_post_likerslist_post_reposts
  • post_id: 只填真实帖子 ID。get_post_comment_replies 必须使用 Dataset 行里的真实 post_id,不要粘贴帖子链接或分享文案。
  • comment_id: 只填 get_post_comments Dataset row 里的 comment_id。建议选择 reply_count > 0has_replies = true 的一级评论行。
  • profile_url: 推荐直接粘贴微博主页链接或分享文案,适用于 get_user_infolist_user_posts
  • user_id: 只填真实 user_id / author_user_id。不要填昵称、主页名称或微博号;如果只有主页链接或分享文案,请填 profile_url
  • sort_type: 仅用于 get_post_commentshot 表示热门评论,time_descending 表示当前可返回范围内最新评论优先。

如果用户把帖子链接填到用户类 operation、把主页链接填到帖子类 operation,或在评论回复里粘贴帖子链接/分享文案,Actor 会跳过 SocialDataX API 请求并在 OUTPUT 写入中英文 warning 和支持链接,避免因为明显可修正的输入问题直接失败。

点赞用户和转发列表支持 post_url。使用帖子链接时耗时可能略长;继续翻页请保持同一 post_url,并传入上一页返回的完整分页令牌。

输入示例

帖子搜索:

{
"operation": "search_posts",
"keyword": "露营",
"page_token": "",
"max_items": 50,
"auto_paginate": true
}

热搜:

{
"operation": "search_hot_list",
"max_items": 50
}

帖子详情:

{
"operation": "get_post_detail",
"post_url": "https://weibo.com/1682207150/R1tllDJRy"
}

评论列表:

{
"operation": "get_post_comments",
"post_url": "https://weibo.com/1682207150/R1tllDJRy",
"page_token": "",
"sort_type": "hot",
"max_items": 50,
"auto_paginate": true
}

评论回复:

{
"operation": "get_post_comment_replies",
"post_id": "5303511279471092",
"comment_id": "4611693340001972",
"page_token": "",
"max_items": 50,
"auto_paginate": true
}

点赞用户:

{
"operation": "list_post_likers",
"post_url": "https://weibo.com/1682207150/R1tllDJRy",
"page_token": "",
"max_items": 50,
"auto_paginate": true
}

转发列表:

{
"operation": "list_post_reposts",
"post_url": "https://weibo.com/1682207150/R1tllDJRy",
"page_token": "",
"max_items": 50,
"auto_paginate": true
}

用户资料:

{
"operation": "get_user_info",
"profile_url": "https://weibo.com/u/1682207150"
}

用户微博列表:

{
"operation": "list_user_posts",
"profile_url": "https://weibo.com/u/1682207150",
"page_token": "",
"max_items": 50,
"auto_paginate": true
}

max_items 默认 50,最大 1000auto_paginate=false 时只请求当前 page_token。热搜不需要分页参数,Actor 会请求一次,并按 max_items 限制写入 Dataset 的热搜条目数。

如果用户在 Apify run options 里设置了更低的 paid Dataset item 上限,Actor 会把列表类 max_items 自动裁剪到该上限,避免超预算请求过多页面。 如果该上限为 0,Actor 会直接结束并在 OUTPUT 写入 warning,不会请求 SocialDataX API。

Apify 计划要求

持续使用需要 Apify paid plan。Apify free plan 用户有 5 次 SocialDataX API request 试用额度;每次请求一个接口页面计 1 次,auto_paginate=true 时每翻一页都会计入一次。试用额度用完后,请升级 Apify 计划继续使用。

Ongoing use requires an Apify paid plan. Free-plan users get a 5-request SocialDataX API trial. Each requested page counts as one request, so auto_paginate=true can consume multiple requests in one run.

输出

Actor 会把结果写入 Apify Dataset,适合 JSON、CSV、Excel / XLSX、JSONL 等格式导出。

列表类接口会为 items[] 中的每个元素写入一条扁平 dataset row:

{
"operation": "get_post_comments",
"item_index": 1,
"query_post_id": "5303511279471092",
"query_page_token": "",
"query_sort_type": "hot",
"query_max_items": 50,
"query_auto_paginate": true,
"post_id": "5303511279471092",
"comment_id": "4611693340001972",
"content": "这场比赛太精彩了。",
"reply_count": 2,
"like_count": 9,
"author_user_id": "20001",
"author_name": "评论作者",
"page_request_index": 1,
"page_item_count": 20,
"page_next_page_token": "next-token",
"page_has_more": true
}

详情类接口会写入一条 dataset row。authoruservideo 等常见对象会展开为 author_*user_*video_* 字段;图片、话题和数组字段保留 JSON 值。

如果某一页 items 为空但仍有分页信息,Actor 会写入一条 empty_page=true 的 summary row,避免丢失 next_page_token。如果空页已经没有下一页,则不会写入 Dataset row。

如果 run 失败,OUTPUT 会保留一条轻量失败摘要,方便在 Apify 控制台里直接看到请求次数、状态码和简要错误信息。

Apify API 调用

同步运行并直接获取 Dataset items:

curl -X POST "https://api.apify.com/v2/acts/socialdatax~socialdatax-weibo-data-api/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operation": "search_posts",
"keyword": "露营",
"page_token": "",
"max_items": 50,
"auto_paginate": true
}'

Python client 示例:

from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("socialdatax/socialdatax-weibo-data-api").call(run_input={
"operation": "search_posts",
"keyword": "露营",
"page_token": "",
"max_items": 50,
"auto_paginate": True,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items

费用

Apify 用户按 Actor 页面展示的 Apify 价格和用量计费,不需要购买或配置 SocialDataX API Key。