Zhihu keyword search API

Based on the 2026-11-21 specification

Quick answer

POST /zhihu/search/task searches Zhihu answers and column articles by keyword and publish date range (YYYY-MM-DD, UTC+8, inclusive; default the last 7 days) using Zhihu's "latest" ordering; videos, ideas and other result types are not collected. max_pages runs from 0 to 50 (0 or omitted means 20) at about 20 items per page. Poll GET /zhihu/search/task/{task_id}; once DONE the response carries task, total_count and data, up to 100 items per page. Each item has its URL, title (an answer carries its question's title), full plain text, author, publish time, upvote and comment counts, 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

  • Follow how Zhihu users explain and debate a product category, brand or policy topic in long-form answers.
  • Collect dated answers and articles on a topic for research, with upvotes to rank them.
  • Pass answer URLs to the Zhihu answers and comments API to read the discussion beneath them.

Endpoints

Base URL: https://api.infominer.io/api/v2. Send your API key in the auth-header request header.

MethodPathWhat it does
POST /zhihu/search/task Create a keyword search task over answers and column articles, with an optional date range and page limit.
GET /zhihu/search/task/{task_id} Poll the search task; once DONE it returns the items and total_count, up to 100 per page.

Request parameters

POST /zhihu/search/task

ParameterInTypeRequiredDefault / allowedDescription
keyword body string Yes Search keyword, 1 to 100 characters.
end_date body string No End date, inclusive (YYYY-MM-DD, UTC+8). Defaults to today.
max_pages body integer No 20 (max 50) Maximum result pages; 0 or omitted uses the default. About 20 items per page.
rerun body boolean No Accepted for consistency with other platforms; every POST creates a new task.
start_date body string No Start date, inclusive (YYYY-MM-DD, UTC+8). Defaults to 7 days ago.

GET /zhihu/search/task/{task_id}

ParameterInTypeRequiredDefault / allowedDescription
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 100 Items per page, max 100.

Response fields

DataFieldsEndpoint
Answers and column articles (data) id, url, title, content, tm, datetime, tm_crawler, tm_update, author, author_id, type, ctype, source, sentiment, region, like_count, comment_count, metadata_img GET /zhihu/search/task/{task_id}
Search task (task) task: id, keyword, status, start_date, end_date, max_pages, created_at, total, completed, pages_crawled, partial, timed_out, failed_pages, failed_articles, failed_ranges GET /zhihu/search/task/{task_id}

Code examples

curl: create the task

curl -X POST https://api.infominer.io/api/v2/zhihu/search/task \
  -H "auth-header: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keyword": "空气炸锅", "start_date": "2026-06-01", "end_date": "2026-06-07", "max_pages": 3}'

curl: poll the task by ID

curl "https://api.infominer.io/api/v2/zhihu/search/task/$TASK_ID?page=1&pageSize=100" \
  -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/search/task",
    headers=HEADERS,
    json={
        "keyword": "空气炸锅",
        "start_date": "2026-06-01",
        "end_date": "2026-06-07",
        "max_pages": 3,
    },
    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/search/task/{task['id']}",
        headers=HEADERS,
        params={
            "page": 1,
            "pageSize": 100,
        },
        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("url"), (row.get("title") 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",
    "keyword": "空气炸锅",
    "status": "DONE",
    "start_date": "2026-06-01",
    "end_date": "2026-06-07",
    "max_pages": 3,
    "created_at": 1780880400,
    "total": 2,
    "completed": 2,
    "pages_crawled": 1,
    "timed_out": false,
    "partial": false,
    "failed_pages": 0,
    "failed_articles": 0,
    "failed_ranges": 0
  },
  "total_count": 2,
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000001",
      "url": "https://www.zhihu.com/question/100000001/answer/100000000001",
      "title": "空气炸锅值得买吗?",
      "content": "用了半年,说说真实感受。\n优点是做鸡翅和薯条确实方便,缺点是容量小,一家四口要分两次做。",
      "tm": 1780666200,
      "datetime": "2026-06-05 21:30:00",
      "tm_crawler": 1780880406,
      "tm_update": 1780880406,
      "author": "sample_user_1",
      "author_id": "0000000001",
      "type": [
        "sample_user_1"
      ],
      "ctype": [
        "sample_user_1"
      ],
      "source": "zhihu",
      "sentiment": "Positive",
      "region": "浙江",
      "like_count": 128,
      "comment_count": 2,
      "metadata_img": []
    },
    {
      "id": "00000000-0000-4000-8000-000000000002",
      "url": "https://zhuanlan.zhihu.com/p/100000000002",
      "title": "空气炸锅选购指南:容量、功率和清洗",
      "content": "这篇整理了选空气炸锅时最常被问到的三个问题。",
      "tm": 1780452000,
      "datetime": "2026-06-03 10:00:00",
      "tm_crawler": 1780880411,
      "tm_update": 1780880411,
      "author": "sample_user_2",
      "author_id": "0000000002",
      "type": [
        "sample_user_2"
      ],
      "ctype": [
        "sample_user_2"
      ],
      "source": "zhihu",
      "sentiment": "Neutral",
      "region": "",
      "like_count": 56,
      "comment_count": 4,
      "metadata_img": []
    }
  ],
  "page": 1,
  "pageSize": 100
}

Limits and notes

  • Search covers answers and column articles only.
  • Search is not exhaustive: Zhihu's "latest" ordering jumps between pages, so the task stops after 3 consecutive pages with nothing in range and may miss content that appears only deeper. The same query can return slightly different counts at different times.
  • Only a limited number of Zhihu tasks run at once; further tasks wait as INIT, which does not make them time 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 matches everything collected for the range, including earlier tasks' results, so total_count can exceed task.completed; task.completed is what this task collected.
  • Counts are as of collection and not refreshed automatically. How far back search can go is confirmed per project scope.
Collection: web crawlers collect content publicly published on each platform. Whether this suits your use depends on the purpose and jurisdiction and is for the buyer's legal team to assess; we can provide a description of sources and collection methods.

More Zhihu API pages

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 form

FAQ

Does Zhihu search return every matching answer?
Not always. The "latest" ordering is not a strict time order, and the task stops after 3 consecutive pages with nothing in the date range, so some content may be missed.
Does the search include Zhihu videos or ideas?
No. Only answers and column articles are collected.
What is the region field?
The author's IP location as Zhihu shows it, for example a province name; it is empty when unknown.
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.