Zhihu answers and comments API
Based on the 2026-11-21 specification
Quick answer
POST /zhihu/pushs/task takes a Zhihu question, answer or column-article URL. For a question, data holds only its answers (push_type answer, 20 per page); for an answer or article it collects the top-level comments (comment, 10 per page) and, with crawl_second_layer (default true), the replies under them (reply). Poll GET /zhihu/pushs/task/{task_id}; once DONE it returns task, total_count and data, up to 1000 records per page. Each record has post_id, the author, text, posting time, a sentiment label and the author's IP location when known. Data is collected by web crawlers from content publicly published on Zhihu.
What teams use it for
- Collect every answer to a question about your product category or market.
- Read the full comment thread under an influential answer or column article.
- Compare the sentiment of answers to the same question over time.
Endpoints
Base URL: https://api.infominer.io/api/v2. Send your API key in the auth-header request header.
| Method | Path | What it does |
|---|---|---|
| POST | /zhihu/pushs/task |
Create a task from a question, answer or column-article URL: answers for a question, comments for an answer or article. |
| GET | /zhihu/pushs/task/{task_id} |
Poll the task; once DONE it returns the answers or comments, up to 1000 per page. |
Request parameters
POST /zhihu/pushs/task
| Parameter | In | Type | Required | Default / allowed | Description |
|---|---|---|---|---|---|
post_url |
body | string | Yes | Zhihu question URL https://www.zhihu.com/question/{id}, answer URL .../question/{id}/answer/{id}, or column-article URL https://zhuanlan.zhihu.com/p/{id}. The query string is removed. | |
crawl_second_layer |
body | boolean | No | true |
Second layer: for an answer or article, the replies under each comment. For a question, the first comment page of each answer is collected but belongs to that answer, so it is not in the question task's data. |
max_pages |
body | integer | No | 20 (max 200) |
Maximum first-layer pages (answers for a question, 20 per page; top-level comments for an answer or article, 10 per page); 0 or omitted uses the default. |
rerun |
body | boolean | No | Accepted for consistency with other platforms; every POST creates a new task. |
GET /zhihu/pushs/task/{task_id}
| Parameter | In | Type | Required | Default / allowed | Description |
|---|---|---|---|---|---|
task_id |
path | string | Yes | Task ID returned when the task was created. | |
page |
query | integer | No | 1 |
Page number, starting at 1. |
pageSize |
query | integer | No | 1000 |
Answers or comments per page, max 1000. |
Response fields
| Data | Fields | Endpoint |
|---|---|---|
| Answers, comments and replies (data) | id, post_id, author_id, author, push_type, region, content, tm, tm_crawler, sentiment | GET /zhihu/pushs/task/{task_id} |
| Task (task) | task: id, post_url, status, crawl_second_layer, created_at, total, completed, pages_crawled, reported_total, partial, timed_out, failed_pages, failed_batches, zhihu_type, title | GET /zhihu/pushs/task/{task_id} |
Code examples
curl: create the task
curl -X POST https://api.infominer.io/api/v2/zhihu/pushs/task \
-H "auth-header: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"post_url": "https://www.zhihu.com/question/100000001/answer/100000000001", "crawl_second_layer": true, "max_pages": 2}'
curl: poll the task by ID
curl "https://api.infominer.io/api/v2/zhihu/pushs/task/$TASK_ID?page=1&pageSize=1000" \
-H "auth-header: YOUR_API_KEY"
Python (requests): create, poll, read
import time
import requests
BASE_URL = "https://api.infominer.io/api/v2"
HEADERS = {"auth-header": "YOUR_API_KEY"}
# 1. Create the task
resp = requests.post(
f"{BASE_URL}/zhihu/pushs/task",
headers=HEADERS,
json={
"post_url": "https://www.zhihu.com/question/100000001/answer/100000000001",
"crawl_second_layer": True,
"max_pages": 2,
},
timeout=30,
)
resp.raise_for_status()
task = resp.json()
# 2. Poll until the task leaves INIT / RUNNING
for _ in range(120):
resp = requests.get(
f"{BASE_URL}/zhihu/pushs/task/{task['id']}",
headers=HEADERS,
params={
"page": 1,
"pageSize": 1000,
},
timeout=30,
)
resp.raise_for_status()
result = resp.json()
status = result.get("status") or result.get("task", {}).get("status")
if status not in ("INIT", "RUNNING"):
break
time.sleep(15)
else:
raise SystemExit("task still running; poll it again later")
task = result.get("task", result)
if status != "DONE" or task.get("partial") or task.get("timed_out"):
raise SystemExit(f"task ended with status {status}; no complete result")
# 3. Read the records (use page / pageSize to fetch further pages)
for row in result.get("data", []):
print(row.get("push_type"), row.get("author"), (row.get("content") or "")[:60])
Sample response
Illustrative data written by hand: accounts are sample_user_n and IDs are obviously fake. Fields follow the 2026-11-21 specification; the sample shows a subset of the fields.
Poll response once the task is DONE (illustrative data)
{
"task": {
"id": "00000000-0000-4000-8000-000000000001",
"post_url": "https://www.zhihu.com/question/100000001/answer/100000000001",
"status": "DONE",
"crawl_second_layer": true,
"created_at": 1780880400,
"total": 2,
"completed": 2,
"pages_crawled": 1,
"reported_total": 2,
"timed_out": false,
"partial": false,
"failed_pages": 0,
"failed_batches": 0,
"zhihu_type": "answer",
"title": "空气炸锅值得买吗?"
},
"total_count": 2,
"data": [
{
"id": "00000000-0000-4000-8000-000000000003",
"post_id": "00000000-0000-4000-8000-000000000001",
"author_id": "0000000003",
"author": "sample_user_3",
"tm": 1780745400,
"tm_crawler": 1780880403,
"push_type": "comment",
"region": "浙江",
"content": "同感,容量确实是最大的问题",
"sentiment": "Neutral"
},
{
"id": "00000000-0000-4000-8000-000000000004",
"post_id": "00000000-0000-4000-8000-000000000001",
"author_id": "0000000004",
"author": "sample_user_4",
"tm": 1780743600,
"tm_crawler": 1780880406,
"push_type": "reply",
"region": "江苏",
"content": "可以考虑大一号的,做两人份刚好",
"sentiment": "Positive"
}
],
"page": 1,
"pageSize": 1000
}
Limits and notes
- A task on a question returns only answers in data; the comments under an answer belong to that answer. For an answer's full comments, create the task on the answer URL.
- With crawl_second_layer, a question task also collects the first comment page (at most 10) of each answer; those comments belong to the answer and are read with a task on the answer URL.
- Zhihu serves 10 top-level comments per page regardless of settings.
- Only a limited number of Zhihu tasks run at once, and many requests in a short time can make Zhihu restrict access for a while; spread tasks out.
- Only a DONE poll carries data; PARTIAL, TIMED_OUT and FAILED return the task object alone. Treat a task as fully successful when status is DONE and partial and timed_out are both false.
- data holds every collected answer or comment of the item, including earlier tasks' data, so total_count can differ from task.completed. Counts are as of collection.
More Zhihu API pages
- Keyword search
- Answers and comments
Request a trial
In the form below, mention Zhihu and tell us the keywords or questions you want to follow, whether you need answers and comments, and the expected volume. We will confirm the scope and arrange a trial and an API key.
Fill in the form to request a trial. We confirm the scope and reply with trial and integration arrangements.
Fill in the request formFAQ
- How do I get the comments under a Zhihu answer?
- Create the task with the answer URL, https://www.zhihu.com/question/{question id}/answer/{answer id}. A task on the question URL returns only the answers in data.
- What does zhihu_type mean?
- The kind of URL the task was created from: question, answer or article. It decides whether the first layer is answers or comments.
- How long does a Zhihu answers task take?
- After about 5 to 10 seconds of setup, two comment pages of an answer take about 20 seconds and one page of a question's answers about a minute. Tasks beyond the concurrency limit wait as INIT first.
- How is the data collected? Is this the official Zhihu API?
- By web crawlers, from content publicly published on Zhihu. LargitData is not affiliated with Zhihu and this is not Zhihu's own API. Whether this suits your use depends on the purpose and jurisdiction and is for your legal team to assess; we can provide a description of sources and collection methods.