# Zhihu Scraper (`scraper-fleet/zhihu-scraper`) Actor

Zhihu Scraper extracts Zhihu questions, answers, articles, user profiles, comments, followers, and engagement data automatically for research, marketing, and lead generation. 高效抓取知乎问题、回答、文章、用户资料、评论、粉丝及互动数据，助力数据分析与市场研究。

- **URL**: https://apify.com/scraper-fleet/zhihu-scraper.md
- **Developed by:** [Scraper Fleet](https://apify.com/scraper-fleet) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What is Zhihu Scraper? · 知乎采集器是什么？

![What is Zhihu Scraper? · 知乎采集器是什么？](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-d7b1880e835172ca.svg)
**Zhihu Scraper** collects Zhihu answers, articles, comments, creator profiles, and trending questions into **structured JSON, CSV, or Excel data**. Enter a keyword or Zhihu URL and your own logged-in session cookie, then use the results for China market research, content planning, or social listening. Run it in Apify Console without writing scraper code, or connect it to your application through the API.

这是一个支持知乎搜索、问题回答、文章、评论和用户资料的知乎爬虫。输入关键词或链接，使用你自己的登录 Cookie，即可把知乎内容整理成可下载、可分析的数据集。

Start with a small keyword search, check the results, and expand the workflow you need. Apify adds cloud storage, optional proxy configuration, scheduling, run monitoring, and integrations so collection can become a repeatable part of your research process.

### Why use Zhihu Scraper? · 功能与优势

![Why use Zhihu Scraper? · 功能与优势](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-162f744d064f6494.svg)

- **Collect several kinds of Zhihu data from one tool.** Choose search, question answers, content details, comments, comment replies, user profiles, creator articles, or the hot list.
- **Keep the information behind a discussion.** Available records combine text with source IDs, author data, engagement counts, and publication times, helping you investigate an answer rather than save an isolated quotation.
- **Control the size of your dataset.** Set a total result limit and a separate limit for each keyword or URL. Automated pagination retrieves available results within those limits.
- **Prepare content for your workflow.** Keep plain text for analysis, retain available HTML, or request a Markdown conversion for documents and research tools.
- **Remove duplicate records within a run.** Searches across multiple keywords share a dataset, making it easier to work with overlapping topics.
- **Use Apify's cloud tools.** Schedule collection, follow run status and logs, retrieve results through an API, and pass data to a spreadsheet or automation platform.

Choose a small first collection so you can inspect the fields before expanding the input. Runtime depends on the operation, target pages, replies, connection settings, and request retries. A target limit bounds saved records; it does not promise that every target will produce that many results.

#### What data can you extract from Zhihu? · 八种采集方式

| Operation | What you provide | What you collect |
| --- | --- | --- |
| `search` | One or more keywords | Available Zhihu search results |
| `question_answers` | Question URLs or IDs | Zhihu answers under those questions |
| `content_detail` | Answer, article, pin, or question URLs | Individual content details |
| `comments` | Answer, article, or pin URLs | Zhihu comments, optionally including replies |
| `comment_replies` | Root comment IDs | Replies linked to those comments |
| `user_profile` | Profile URLs or user slugs | Available information about Zhihu users |
| `user_content` | Profile URLs or user slugs | The creator's published articles |
| `hot_list` | No target URL needed | Current Zhihu hot list questions |

Choose the operation that matches your task. A keyword finds relevant discussions; a question URL focuses on its answers; a profile URL supports creator research. The creator-content operation supplies a 用户文章列表: it collects articles, not every answer or other activity from that account.

评论和评论回复是不同的数据层级。采集评论时可以选择包含回复；已有评论 ID 时，也可以只获取对应的回复线程。

### How to scrape Zhihu step by step · 快速开始

![How to scrape Zhihu step by step · 快速开始](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-3a32356135c56899.svg)
You can collect your first dataset from the input form. You need an Apify account, a Zhihu session you are authorized to use, and a clear keyword or target URL.

1. **Open the [Actor page](https://apify.com/scraper-fleet/zhihu-scraper).** Sign in to Apify and open the input form. Apify's [Free plan](https://apify.com/pricing) does not require a credit card to sign up.
2. **Get your own Zhihu cookie.** Log in at [zhihu.com](https://www.zhihu.com/) and copy the session cookie from your browser as described below.
3. **Choose an operation and a target.** Select `search` for a keyword, `question_answers` for a question, or the relevant mode for content, comments, profiles, and trends.
4. **Set a small result limit.** For a first test, use five results. Add content filters or change sorting only when they help your research.
5. **Click Start.** Follow the run status, then open its dataset to inspect the collected records.
6. **Download or connect the results.** Export JSON, CSV, or Excel, or use the API to send the dataset to another tool.

#### Check your first dataset · 检查首次结果

When the run finishes, open the dataset and compare `query_keyword` with the topic you entered. Check `record_type`, `content_type`, and a source reference before downloading the whole result. Open an available `question_url` to review the discussion behind an answer. This gives you a practical check that the selected operation produced the kind of material you need.

For a spreadsheet, select useful columns such as `title`, `content`, `author_name`, `upvote_count`, `comment_count`, and `question_url`. Export a small CSV first and confirm that Chinese text imports correctly. Keep a JSON copy when you need the complete record structure or want to preserve the difference between a missing value and zero.

#### Configure your connection · 代理设置

The optional `proxyOptions` field lets you configure an Apify proxy connection. Leave it unset for an initial test if your session works from the run's connection. If access fails, check the session and connection requirements before changing settings. Some sessions can depend on the IP context in which they were obtained.

Use the proxy form to select the configuration available to your account, then compare a small test with your previous run. Record the chosen settings in your saved task if you plan to repeat the collection. Proxy usage may add charges, and a working proxy connection still needs the required session cookie.

#### How to provide your Zhihu cookie · 登录 Cookie

In your browser, open developer tools and select **Network**. Inspect a request to `www.zhihu.com`, choose **Copy as cURL**, and copy the `-b` or `--cookie` value into the Actor's Cookie field. A trusted cookie-manager export can also be pasted as JSON text.

The cookie check looks for `z_c0`, `__zse_ck`, and `d_c0`. These identify your logged-in and browser-verified session. Keep the cookie private and refresh it when your session expires. A proxy changes the connection route; it does not supply a login.

#### Start with Zhihu content search · 内容搜索

Use the same topic throughout your first test so the input and output are easy to compare:

```json
{
  "operation": "search",
  "cookie": "YOUR_OWN_ZHIHU_COOKIE",
  "keywords": ["artificial intelligence"],
  "max_items": 5,
  "max_per_target": 5,
  "content_type": "all",
  "sort": "upvotes",
  "include_html": false,
  "include_markdown": false
}
```

Zhihu keyword search accepts several terms in `keywords`. Try the English phrase first, then a Chinese equivalent such as `人工智能` in a separate run if you want to compare the discussions each query returns. Keep the same limits when making that comparison.

#### Collect a question, article, or comment thread · 内容详情

For question answers, switch to `question_answers` and put the question URL in `urls`. For an individual answer or article, select `content_detail`. Recognized URLs include `www.zhihu.com/question/...`, answer URLs, `zhuanlan.zhihu.com/p/...`, and supported pins.

For comments and replies, choose `comments`, enter the content URL, and turn on `include_replies` when the conversation matters. Replies are separate records. For a targeted follow-up, use `comment_replies` with the root comment IDs returned by your earlier collection.

### Zhihu Scraper input parameters · 输入参数

![Zhihu Scraper input parameters · 输入参数](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-2f964765efcfda75.svg)

![Zhihu Scraper input parameters · 输入参数](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-cb8c70a05d69b8d2.svg)
The required fields are `operation` and `cookie`. Keywords, URLs, and comment IDs depend on the operation you choose. Use the [input form](https://console.apify.com/actors/OvbwgqMCYrXZzz0t1/input) for complete descriptions and current options.

| Parameter | Description | Required | Example |
| --- | --- | --- | --- |
| `operation` | Select the collection task | Yes | `search` |
| `cookie` | Your logged-in Zhihu session | Yes | Your own Cookie header |
| `keywords` | Terms for Zhihu keyword search | For `search` | `["artificial intelligence"]` |
| `urls` | Question, content, or profile targets | For URL-based modes | `["https://www.zhihu.com/question/123456789"]` |
| `comment_ids` | Root comments whose replies you need | For `comment_replies` | `["123456789"]` |
| `max_items` | Total result limit for this run | Optional | `5` |
| `max_per_target` | Result limit for one keyword or URL | Optional | `5` |
| `include_replies` | Include child replies in comment collection | Optional | `true` |
| `proxyOptions` | Optional Apify proxy configuration | Optional | Configure in the form |

#### Choose filters for the task · 筛选与排序

`content_type` controls supported search filtering or provides a type hint for a bare numeric content ID. `sort` selects relevance, upvotes, or newest for search. `publish_time_range` offers windows from one day to one year. `comment_sort` controls popular or newest comment ordering.

Search upvote sorting and publication-time filtering apply to the candidates already fetched. They help prioritize your dataset, but they are not an exhaustive ranking of every matching Zhihu post. An especially narrow filter can return fewer records.

#### Choose content and result limits · 内容格式与数量

![Choose content and result limits · 内容格式与数量](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-7d6e7f27e940bbd1.svg)
Use `include_html` to retain available HTML and `include_markdown` for a best-effort conversion. Plain text remains useful for spreadsheets and analysis. The form defaults to 20 requested results and 20 per target; set limits explicitly in API requests.

`max_items` is shared across all targets. If the first keyword uses the allowance, later keywords may have little room left. Separate runs are often clearer when you need the same sample size for every topic. Non-paying accounts currently have a 20-record cap per run.

关键词搜索、内容类型和发布时间应围绕你的研究问题设置。输入字段名称保持英文原样，方便在表单、JSON 与 API 之间对应。

### Zhihu Scraper output example · 输出数据

![Zhihu Scraper output example · 输出数据](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-7fe2f6f9a7a6720e.svg)

![Zhihu Scraper output example · 输出数据](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-bc831a28b5746307.svg)

![Zhihu Scraper output example · 输出数据](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-730cc48a9dfdbe59.svg)
Each result becomes one dataset record. Content records include available text, engagement, author information, and references to the underlying Zhihu questions or articles. Comment, reply, and profile records use the same shared structure with their relevant fields populated.

These two **illustrative, shortened examples** show the structure for the `artificial intelligence` input above. IDs, author names, counts, dates, and text are fictional values. Field names and types follow the maintained output schema and record-building logic; these examples are not captured search results.

```json
[
  {
    "record_type": "content",
    "operation": "search",
    "scraped_at": "2026-11-08T00:00:00Z",
    "query_keyword": "artificial intelligence",
    "content_id": "100000000000000001",
    "content_type": "answer",
    "title": "人工智能如何帮助研究？",
    "content": "An illustrative answer about organizing research questions.",
    "author_name": "Example author A",
    "question_id": "100000000000000011",
    "question_url": "https://www.zhihu.com/question/100000000000000011",
    "upvote_count": 120,
    "comment_count": 18,
    "content_html": null,
    "content_markdown": null
  },
  {
    "record_type": "content",
    "operation": "search",
    "scraped_at": "2026-11-08T00:00:00Z",
    "query_keyword": "artificial intelligence",
    "content_id": "100000000000000002",
    "content_type": "answer",
    "title": "学习人工智能应关注哪些问题？",
    "content": "An illustrative answer about choosing practical learning goals.",
    "author_name": "Example author B",
    "question_id": "100000000000000012",
    "question_url": "https://www.zhihu.com/question/100000000000000012",
    "upvote_count": 85,
    "comment_count": 9,
    "content_html": null,
    "content_markdown": null
  }
]
```

#### Answer text, author data, and engagement

Useful content fields include `content_id`, `content_type`, `content_url`, `title`, `summary`, `content`, `upvote_count`, `comment_count`, `publish_time`, and `update_time`. Author data can include a name, profile reference, bio, and available activity metrics.

Full answer text is available when Zhihu returns it. Some responses contain excerpts or omit details; use the content-detail operation when you need to investigate a particular source. An upstream `content_url` can be an API address, while `question_url` provides a question-page reference.

#### Comment threads and creator profiles

Comment and reply records add `comment_id`, `parent_comment_id`, `reply_to_comment_id`, `like_count`, and available reply counts. Those identifiers let you reconnect a conversation after export.

Creator profiles can include `user_id`, `profile_url`, `bio`, follower counts, article counts, and other available profile information. Fields that do not apply to a record remain `null`. Keep those missing values distinct from zero when analyzing engagement.

搜索结果、评论回复与用户资料可以共用数据集，但字段含义不同。分析时先按 `record_type` 和 `operation` 分组，再比较相同类型的记录。

### Zhihu Scraper use cases · 谁适合使用？

![Zhihu Scraper use cases · 谁适合使用？](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-6dd390555f697e12.svg)
Zhihu research helps teams understand detailed questions, explanations, and discussions from a Chinese Q\&A community. Match the operation to the decision you want the data to support.

#### China market research and consumer research

Market researchers use keyword Q\&A search to discover how people describe a product category, compare alternatives, or explain purchasing concerns. Collect relevant questions and answers, group recurring themes, and keep source links with each observation. Chinese and English queries can reveal different conversations around the same topic.

#### Brand monitoring and China social listening

Brand teams compare Zhihu answers and comments around product names, launches, and competitor topics. Root comments show responses to the original content; reply threads add context to disagreements and follow-up questions. Scheduling the same query helps you collect a series of snapshots for later comparison.

#### Zhihu articles, creator research, and editorial planning

Content teams use available creator profiles and published articles to identify relevant expertise, study recurring topics, and plan questions their own audience needs answered. Article URLs and timestamps help organize the research. Profile information supports discovery; it does not independently verify a creator's identity or qualifications.

#### Zhihu Hot List Scraper workflows for trends

Journalists and analysts select `hot_list` to collect trending questions with available rank and heat information. Save separate snapshots to see which topics enter, leave, or change position. Your saved runs create the comparison history; the operation itself returns the current list.

市场研究关注需求与问题，品牌监测关注相关讨论，内容团队关注主题与作者。保留关键词、采集时间和来源链接，方便回看与复核。

### How much does it cost to scrape Zhihu? · 价格与免费试用

![How much does it cost to scrape Zhihu? · 价格与免费试用](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-c8d8839192e4b171.svg)
The Actor uses pay-per-event pricing. Saved results incur result events, a start event applies to the run, and platform resource usage is paid separately. These USD rates were checked on November 8, 2026:

| Plan tier | Result event | 1,000 result events |
| --- | --- | --- |
| Free | $0.00199 | $1.99 |
| Bronze | $0.00180 | $1.80 |
| Silver | $0.00160 | $1.60 |
| Gold, Platinum, Diamond | $0.00120 | $1.20 |

The start event costs $0.00005 per GB of allocated memory, with a minimum of one event. At an illustrative 1 GB allocation, five saved records on the Free tier cost $0.00995 plus $0.00005 to start: **$0.01000 in Actor event charges**. Compute, proxy traffic, storage, and other platform usage are additional. Use the actual run allocation when estimating the start charge.

Each saved answer, article, root comment, reply, or profile is a result record. Enabling replies can therefore use the shared record allowance and increase result charges. More difficult targets and request retries can also increase infrastructure usage without producing more saved results.

The 1,000-result figures show unit-price arithmetic rather than a promise of a particular run size. Check this Actor's [Pricing tab](https://apify.com/scraper-fleet/zhihu-scraper/pricing) before a larger collection, and review the usage breakdown for your own small test.

#### Is scraping Zhihu free? · 可以免费开始吗？

Apify's [Free plan](https://apify.com/pricing) includes **$5 in monthly usage credit** and requires no credit card to sign up. This Actor still has paid events. Accounts without a paid plan are limited to 20 records per run; that quantity cap, available credit, and platform charges are separate constraints.

Begin with five results and keep replies disabled until you need them. Inspect the dataset and usage before requesting more. Do not estimate a monthly free-result total solely by dividing the credit by the result price, because start events and platform usage also contribute to the bill.

免费计划额度、每次结果上限、结果事件费用和代理费用需要分别确认。回复是独立结果，也会使用数量上限。先用小规模测试判断字段是否合适，再决定采集规模。

### Zhihu Scraper API and Python · 集成与自动化

![Zhihu Scraper API and Python · 集成与自动化](https://api.apify.com/v2/key-value-stores/rmS14dCchEoeGd0gO/records/readme-73451e84ad2ebc81.svg)
Use the [API tab](https://apify.com/scraper-fleet/zhihu-scraper/api) to run the Actor and retrieve its dataset from your application. API access is useful when Zhihu data needs to feed a spreadsheet, database, dashboard, or research service.

#### How to scrape Zhihu with Python

Install the [Apify Python client](https://docs.apify.com/api/client/python/docs/quick-start) and supply your Apify token and Zhihu cookie through environment variables:

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("scraper-fleet/zhihu-scraper").call(run_input={
    "operation": "search",
    "cookie": os.environ["ZHIHU_COOKIE"],
    "keywords": ["artificial intelligence"],
    "max_items": 5,
    "max_per_target": 5,
    "include_html": False
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["content_type"], item.get("question_url"))
```

This example starts a new run and uses the applicable credit or charges. Its input keys are the same ones you see in the form. An Apify token authorizes the platform; `ZHIHU_COOKIE` provides your authenticated Zhihu session.

#### Automate Zhihu API workflows

Create an Apify schedule for recurring keyword or hot-list collection. Keep the query and filters consistent when you want comparable snapshots. Use webhooks to trigger processing when a run finishes, and follow status or errors in Console.

With Make, Zapier, or n8n, a completed-run workflow can retrieve the dataset, select relevant fields, and append rows to Google Sheets or notify a team in Slack. Configure the integration for your destination; these are platform workflows, not additional collection operations.

Export JSON for structured processing or CSV and Excel for spreadsheets. Apify also supports JSONL, XML, and RSS dataset formats. There is no `outputFormat` input in this Actor; select the export after collection. See the [dataset guide](https://docs.apify.com/platform/storage/dataset) and [Apify Academy](https://docs.apify.com/academy) for workflow help.

#### Copy to your AI assistant · 复制给 AI 助手

Copy this prompt into an assistant that can read documentation or connect to your Apify account:

```text
Help me use scraper-fleet/zhihu-scraper on Apify. Read https://apify.com/scraper-fleet/zhihu-scraper and its input documentation. I want to collect Zhihu discussions about artificial intelligence. Help me choose the operation, explain the cookie requirement, and prepare a five-result test with JSON or CSV output. Ask before starting a paid run. Keep cookies and API tokens out of messages and public examples. If you cannot read the page, ask me to paste the README. 可以用中文解释步骤，JSON 字段名称保持不变。
```

#### Zhihu MCP server for AI assistants · MCP 连接

Connect an MCP-capable client to Apify with this Actor selected. The assistant can use its input schema and work with run results through your authorized account.

```text
https://mcp.apify.com?tools=scraper-fleet/zhihu-scraper
```

Complete the client's supported Apify authorization flow and follow the current [Apify MCP setup instructions](https://docs.apify.com/platform/integrations/mcp). Client interfaces and permissions differ. A compatible assistant can use the selected Actor's input schema; executing the tool starts a normal run with the same Zhihu cookie requirement and billing.

### More scrapers by Scraper Fleet · 更多数据工具

| Actor | Complementary task |
| --- | --- |
| [Bilibili Video Scraper](https://apify.com/scraper-fleet/bilibili-video-scraper) | Collect video statistics and optional top-level comments for Chinese video research |
| [Facebook Group Scraper](https://apify.com/scraper-fleet/facebook-group-scraper) | Collect accessible group posts, comments, group information, and exposed admin profiles |
| [TikTok Video Downloader](https://apify.com/scraper-fleet/tiktok-video-downloader) | Save authorized TikTok videos as MP4 files with metadata and download links |

Each tool serves a different source and has its own inputs, limits, and access requirements. Keep source identifiers and collection times when combining records in a wider research project.

### Zhihu Scraper FAQ · 常见问题

These answers cover common Zhihu scraping tasks, access requirements, exports, and troubleshooting.

#### Do I need a login or an API key?

You need your own logged-in Zhihu cookie for collection. Console users enter it in the Cookie field. Python, API, and MCP workflows also need authorized Apify access. This tool does not replace your Zhihu account with an official API key.

#### How does this compare with an official Zhihu API?

This is an Apify collection tool that uses your session for supported Zhihu requests. It provides a consistent input form, datasets, exports, and automation around those tasks. Official API availability and permissions are a separate matter; access to the Actor does not grant broader Zhihu permissions.

#### Can I work with the Zhihu API v4 through this tool?

The collector uses Zhihu endpoints, including v4 endpoints for supported tasks, while you interact through Apify's input form or API. Use the Actor's operation names and documented fields rather than constructing upstream calls yourself. It is not a general-purpose proxy for every Zhihu endpoint.

#### Can I run it on a schedule?

Yes. Apify schedules can repeat the configured collection. Check that your session remains valid and that your selected limits and credit support the frequency. Scheduling hot-list snapshots is useful when you want to compare trends over time.

#### Can I export a Zhihu hot-list RSS feed? · 知乎热榜RSS

Apify supports RSS export for datasets. Collect a current hot-list snapshot, then choose the supported export format. A recurring feed or historical comparison needs your own scheduling and storage workflow; the Actor does not retrieve past hot lists on demand.

#### Why did I receive fewer records than requested?

Available results, per-target limits, the run-wide allowance, account caps, filtering, and failed requests can reduce the count. The search loop also has a fixed 2,000-row scanning safeguard. Check the run status and returned records before increasing limits; the exposed `maxScanned` option does not override that safeguard.

#### What if my cookie expires or requests fail?

Refresh your own browser session and update the Cookie input. For 401, 403, or 429 responses, also check access and rate or IP restrictions. A proxy may help with a connection issue, but it does not repair an invalid login or guarantee access.

#### What happens when Zhihu changes its website?

Changes to responses or access checks can affect collection. Check the current input instructions and report the affected operation through Issues. Include a redacted error and expected behavior so the maintainer can investigate. No automatic repair or fixed update cadence is promised.

#### Can I use the data commercially?

Commercial use depends on the content, applicable licenses, platform terms, privacy requirements, and your intended reuse. Purchasing or running a scraper does not transfer rights to authors' writing or personal information. Assess those requirements for your project before republishing or selling results.

#### Which export format should I choose?

Use JSON for structured processing, arrays, and null values. CSV or Excel works well for selected fields in a spreadsheet. Check text encoding and import settings for Chinese content, and retain an original structured export if you flatten the data.

### Is it legal to scrape Zhihu? · 法律与数据使用

Legality depends on the data, access method, jurisdiction, and intended use. This Actor uses a session you provide to request accessible content; it does not establish permission for unrestricted collection or reuse.

Follow Zhihu's terms and applicable copyright, privacy, and data-protection requirements, including GDPR or CCPA where relevant. Collect only what you need, control access to datasets, and retain source references. This section provides general guidance rather than legal advice.

请使用你有权使用的账号，遵守平台条款、内容许可与适用法律。回答、文章、作者资料和评论的再利用权限需要按具体用途确认。

### Need help with Zhihu Scraper? · 支持与反馈

For help, a bug report, or a feature request, [contact our team through this Actor's Issues tab](https://apify.com/scraper-fleet/zhihu-scraper/issues). Share the operation, non-sensitive target, expected result, and a redacted error message. Never include a session cookie or API token in a public issue.

For a custom workflow, contact us through the same Issues tab. Describe the target data, required fields, result volume, and destination so our team can discuss your requirements with you.

需要帮助、功能改进或定制采集流程？请通过本 Actor 的 Issues 联系我们，说明目标数据、所需字段和预期结果。

# Actor input Schema

## `operation` (type: `string`):

What to scrape. 选择要执行的操作。 search/question_answers/content_detail/user_profile/user_content need Keywords or URLs below; comments/comment_replies need URLs or Comment IDs.

## `cookie` (type: `string`):

Paste a `Cookie:` header string (DevTools → Network → any www.zhihu.com request → Copy as cURL, take the -b/--cookie value) OR a Cookie-Editor/EditThisCookie JSON export. Only z_c0, \_\_zse_ck and d_c0 are required; extra cookies are harmless. These expire — re-harvest when runs start failing. 仅需 z_c0、\_\_zse_ck 、d_c0 三个 Cookie，过期后请重新获取。

## `keywords` (type: `array`):

search only. One search per keyword, results deduped globally. 仅用于 search 操作，每个关键词独立执行一次搜索。

## `urls` (type: `array`):

question_answers / content_detail / comments / user_profile / user_content: one or more Zhihu URLs (question/answer/article/pin/people) or bare numeric IDs. 适用于以上操作，填入知乎链接或纯ID。

## `comment_ids` (type: `array`):

comment_replies only: one or more root comment IDs to fetch replies for. 仅用于 comment_replies 操作。

## `max_items` (type: `integer`):

Run-wide cap across all keywords/targets combined. A per-run limit also applies on top of this (see Actor log if it is hit). 本次运行跨所有关键词/目标的总上限。

## `max_per_target` (type: `integer`):

Cap for a single keyword / URL / comment ID. 单个关键词或链接的最大采集条数。

## `maxRetries` (type: `integer`):

Retries for a single failed HTTP request before giving up on it. 单个请求失败后的重试次数。

## `maxScanned` (type: `integer`):

search only: rows examined before giving up on a client-side content-type filter. 仅用于 search，防止过滤条件过严导致无限扩展。

## `content_type` (type: `string`):

search: filter results by type. content_detail/comments bare-ID hint: tells the scraper what a bare numeric ID is. 用于 search 结果过滤，或给 content_detail/comments 的纯 ID 指定类型。

## `sort` (type: `string`):

search only. upvotes/newest are applied client-side after fetching. 仅用于 search，upvotes/newest 在客户端重新排序。

## `publish_time_range` (type: `string`):

search only, applied client-side. 仅用于 search，客户端过滤。

## `comment_sort` (type: `string`):

comments/comment_replies: popular is the server default; newest is re-sorted client-side. 用于 comments/comment_replies。

## `include_replies` (type: `boolean`):

comments only: also walk reply threads under each root comment. 仅用于 comments，是否采集每条评论的回复。

## `include_html` (type: `boolean`):

Keep the raw content_html field in the output. 输出保留 content_html 原始 HTML。

## `include_markdown` (type: `boolean`):

Add a best-effort Markdown conversion of the content. 输出添加 Markdown 转换内容。

## `proxyOptions` (type: `object`):

Apify Proxy configuration (or leave default to run without a proxy).

## Actor input object example

```json
{
  "operation": "search",
  "keywords": [
    "ai"
  ],
  "urls": [],
  "comment_ids": [],
  "max_items": 20,
  "max_per_target": 20,
  "maxRetries": 3,
  "maxScanned": 20000,
  "content_type": "all",
  "sort": "relevance",
  "publish_time_range": "all",
  "comment_sort": "popular",
  "include_replies": false,
  "include_html": true,
  "include_markdown": false
}
```

# Actor output Schema

## `mainDatasetId` (type: `string`):

No description

## `viewApiUrl` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "operation": "search",
    "keywords": [
        "ai"
    ],
    "max_items": 20,
    "max_per_target": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-fleet/zhihu-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "operation": "search",
    "keywords": ["ai"],
    "max_items": 20,
    "max_per_target": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("scraper-fleet/zhihu-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "operation": "search",
  "keywords": [
    "ai"
  ],
  "max_items": 20,
  "max_per_target": 20
}' |
apify call scraper-fleet/zhihu-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scraper-fleet/zhihu-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/OvbwgqMCYrXZzz0t1/builds/ejZEJzQDwJvxbGd4N/openapi.json
