知乎 / Zhihu API - 搜索、回答文章、评论、用户数据 avatar

知乎 / Zhihu API - 搜索、回答文章、评论、用户数据

Pricing

from $3.99 / 1,000 dataset items

Go to Apify Store
知乎 / Zhihu API - 搜索、回答文章、评论、用户数据

知乎 / Zhihu API - 搜索、回答文章、评论、用户数据

社媒数据助手 SocialDataX 提供的只读知乎 / Zhihu data API,支持知乎搜索 / Zhihu content search、回答和文章详情、评论 / comments、评论回复 / comment replies、用户资料 / creator profile 和用户文章列表,结果可导出 CSV、Excel、JSON 或通过 Apify API 使用。

Pricing

from $3.99 / 1,000 dataset items

Rating

0.0

(0)

Developer

SocialDataX

SocialDataX

Maintained by Community

Actor stats

0

Bookmarked

8K

Total users

171

Monthly active users

2 days ago

Last modified

Features

Limited permissions

Share

SocialDataX provides a read-only Zhihu / 知乎 data API on Apify. Use it to export structured Zhihu search results, answer/article/video details, comments, comment replies, creator profiles, and creator article lists into an Apify Dataset.

Apify users do not need to configure a SocialDataX API Key. The Actor owner configures SOCIALDATAX_API_KEY as an Apify secret.

用户搜索 search_users:必填 keyword,可选 page_token、max_items、auto_paginate。返回用户信息,支持自动分页;续页保持关键词不变并原样使用 next_page_token。 搜索建议 search_suggestions:必填 keyword,可选 max_items。只请求一次,不支持分页,每条建议作为一行 Dataset 输出,text 可用于后续搜索。

{"operation": "search_users", "keyword": "美食", "max_items": 20, "auto_paginate": true}
{"operation": "search_suggestions", "keyword": "美食", "max_items": 10}

知乎用户搜索结果的 user_id 仅用于识别;查询用户资料或文章列表请使用同项 profile_url。建议的 label、icon_url 可能为 null。

What It Supports

  • search_users: 用户搜索 / user search by keyword, with pagination.
  • search_suggestions: 搜索词建议 / search suggestions by keyword; one request, no pagination.
  • get_hot_list: 知乎热榜 / current hot list; no keyword or pagination required.
  • search_contents: 知乎内容搜索 / Zhihu content search by keyword.
  • get_content_detail: 回答、专栏文章、视频详情 / answer, article, or video details.
  • get_content_comments: 一级评论 / top-level comments.
  • get_comment_replies: 评论回复 / comment replies.
  • get_user_info: 用户资料 / creator profile.
  • list_user_articles: 用户发布文章列表 / creator articles.

Use Cases

  • Export Zhihu search results for a given keyword or topic.
  • Retrieve detailed content for Zhihu answers, articles, and videos.
  • Export top-level comments and comment replies for analysis.
  • Gather creator profile information and creator article lists.
  • Use automatic pagination export with configurable maximum items.

Input Example

{
"operation": "search_contents",
"keyword": "露营",
"content_type": "all",
"sort_type": "general",
"publish_time_range": "all",
"page_token": "",
"max_items": 20,
"auto_paginate": false
}

max_items defaults to 50 and can be set up to 1000. When auto_paginate is enabled, the Actor keeps requesting the next page until it reaches max_items, there is no next page, or a safety limit is reached. Each page request counts as one SocialDataX API request.

每个免费 Apify 账号在此 Actor 有 5 次试用额度,每次成功的 SocialDataX API 请求消耗 1 次。上面的示例只取一页,适合首次试用。收到试用额度用尽的响应后,Actor 停止请求,保留已取到的结果,并在 OUTPUT.warnings 提示升级 Apify 套餐后再运行。

Output

Results are written to the default Apify Dataset as flat rows. This makes the output easy to export as JSON, CSV, Excel / XLSX, JSONL, or consume from the Apify API.

Common fields include:

  • Query fields: query_keyword, query_content_url, query_profile_url, query_page_token.
  • Page fields: page_request_index, page_item_count, page_next_page_token, page_has_more.
  • Content fields: content_id, content_type, title, summary, content_url, upvote_count, comment_count, publish_time.
  • Author fields: author_user_id, author_name, author_profile_url, author_follower_count.
  • Zhihu-specific objects flattened as question_*, answer_*, and video_*.

The OUTPUT key-value store record keeps a lightweight run summary with operation, request count, page summaries, warnings, and failure details. Full result rows are in the Dataset.

API Usage

Run and get Dataset items synchronously:

curl "https://api.apify.com/v2/acts/socialdatax~socialdatax-zhihu-data-api/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operation": "search_contents",
"keyword": "露营",
"content_type": "all",
"sort_type": "general",
"publish_time_range": "all",
"max_items": 20,
"auto_paginate": false
}'

For detail and comment operations, use content_url returned by search/detail rows. Supported content URL examples:

  • https://www.zhihu.com/question/{question_id}/answer/{answer_id}
  • https://zhuanlan.zhihu.com/p/{article_id}
  • https://www.zhihu.com/zvideo/{video_id}

For user operations, use a Zhihu profile URL like:

  • https://www.zhihu.com/people/{url_token}

Pricing

Recommended Apify Pay per event setup:

  • apify-default-dataset-item: $0.00399 / Dataset item
  • apify-actor-start: $0.00005 / run

Operator Setup

Set these environment variables in Apify Console for the Actor owner:

  • SOCIALDATAX_API_KEY: required, stored as an Apify secret.
  • SOCIALDATAX_API_BASE_URL: optional, defaults to https://mcp.socialdatax.com.

For help, visit socialdatax.com.

知乎热榜 / Hot list

operation: "get_hot_list";必填字段:无。获取当前热榜,无需关键词,不翻页。question_url 是问题链接,不能直接用于回答或文章详情接口。

使用 max_items 限制输出条数,沿用现有 Dataset 条目计费规则。不使用 page_token 或自动翻页。