Zhihu

Zhihu hot list and content search: the hot list returns current trending questions by rank; the comprehensive search returns results by keyword (each result carries the full body and images); the question / column-article detail returns the body with images, comments, related questions and "others are searching".

/api/zhihu/

Service Description

The Zhihu hot-list API returns the current rank, title, direct link, excerpt, heat and answer count for each trending item — handy for trending aggregation, topic research and content dashboards.

Comprehensive search /api/zhihu/search: search Zhihu content by keyword; each result comes with the full body and images (not an excerpt), plus author, upvotes and comment count, along with "others are searching"; use offset to page through results.

Two ways to supply the login credential: pass cookie in the request (your own Zhihu login cookie — used for this call only, never stored by us); omit it and the endpoint falls back to the platform-hosted account — the platform keeps Zhihu accounts and login cookies under "Accounts" in the console and automatically picks an available credential. Paste it into the "Local credentials" card in the right sidebar of the docs page and click "Save to this browser" so the debugger sends it automatically. If the platform-hosted credential expires, the endpoint explicitly reports that a fresh login is required and marks that account as "Expired".

Question detail /api/zhihu/question: pass a question ID (or the question page URL) to get the question body with its images, the answer list (with images and each answer's top comments), the question's own comments, related questions and "others are searching"; the number of answers and comments can be tuned with parameters.

Column article detail /api/zhihu/article: pass an article ID (or the article page URL) to get the full article body with its images, comments and "others are searching". An article page has only these three modules — there is no "answer list" and no "related questions" (those are question-page only).

/api/zhihu/check verifies whether a Zhihu credential is still valid: pass cookie to check your own (the platform account is never touched), or omit it to check the platform-hosted account and write the result back to its status.

Response Format

Every endpoint returns the same JSON envelope; the payload is always inside data:

{
  "code": 10000,
  "msg": "成功",
  "data": { ... }
}
  • code: business status code. 10000 means success; anything else is an error — see the Error Codes page for the full list.
  • msg: a human-readable message you can show to end users, but never use it for program logic.
  • data: the payload; usually null on error. Each endpoint's Response section lists its data fields.

Judge success by code, not by the HTTP status code. View all error codes

Zhihu

Zhihu (zhihu.com) Signature Required

Data comes from Zhihu's official web endpoints; callers may supply their own login cookie, otherwise the platform-hosted account is used.

POST /api/zhihu/hot Total calls: 1

Hot list

Get the Zhihu hot list (50 items by default, 50 max).

Optional, 1–50, default 50. Out-of-range values return an invalid-parameter error.

  • Heat is kept as Zhihu's original wording (e.g. "13.7M heat") without numeric conversion, to avoid misreading the metric.
  • url is a web address you can open directly in a browser; question_id is the Zhihu question ID.
  • GET is also accepted (parameters go in the query string); because a Zhihu cookie is long, POST with the cookie in the form body is recommended.
Response Common envelope
Field Type Description
count int Number of items returned
list[].rank int Rank, starting from 1
list[].title string Title
list[].url string Web address (openable directly)
list[].excerpt string Excerpt (may be empty)
list[].hot string Heat text, e.g. "13.7M heat"
list[].answer_count int Answer count (may be 0)
list[].question_id int Zhihu question ID
list[].cover string Cover image URL (may be empty)
POST /api/zhihu/question Total calls: 0

Question detail

Question detail: the question body with images, answers (with images and comments), question comments, related questions and "others are searching".

Required. The Zhihu question ID (plain digits), or the question page URL (e.g. https://www.zhihu.com/question/2089437755591713926).

Optional, 1–20, default 5. How many answers to return.

Optional, 0–20, default 3. How many top comments to return per answer (0 = none).

Optional, 0–20, default 10. How many of the question's own comments to return (0 = none).

  • Images: both the question body and each answer body come with the raw HTML (detail / content, ready to render) and a pre-extracted images array of image URLs (original resolution preferred, de-duplicated).
  • Comments: the question's comments are in question.comments, and each answer's comments are in that answer's comments; every comment inlines up to 3 child comments (replies).
  • answer_count / comment_count are totals, not the number returned in this call — the returned counts are controlled by answer_limit / comment_limit.
  • "Related questions" are supplied dynamically by Zhihu, so the count varies (5 max); "others are searching" always returns 10 items, each with a ready-to-open Zhihu search URL.
  • The question itself (title / body / topics / counters) is parsed from data embedded in the question page (Zhihu's own endpoint is signature-gated and cannot be called directly); if parsing fails, the endpoint reports it explicitly.
  • GET is also accepted (parameters go in the query string); because a Zhihu cookie is long, POST with the cookie in the form body is recommended.
Response Common envelope
Field Type Description
question.id string Question ID
question.title string Title
question.url string Question page URL
question.detail string Question body HTML (kept verbatim)
question.images array Image URLs in the question body
question.excerpt string Body excerpt
question.topics[].name string Topic name
question.topics[].url string Topic page URL
question.answer_count int Total answers
question.follower_count int Followers
question.comment_count int Total comments
question.visit_count int View count
question.created_time int Created time (Unix seconds)
question.updated_time int Updated time (Unix seconds)
question.comments[] array Question comments (shape listed below)
comments[].id string Comment ID
comments[].content string Comment body (plain text)
comments[].author.name string Commenter name
comments[].like_count int Like count
comments[].child_comment_count int Total child comments
comments[].reply_to_author string Reply target (child comments only)
comments[].child_comments[] array Inlined child comments (up to 3, same shape as the parent)
answers[].id string Answer ID
answers[].url string Answer page URL
answers[].content string Answer body HTML
answers[].images array Image URLs in the answer body
answers[].excerpt string Answer excerpt
answers[].author.name string Author name
answers[].author.url string Author profile URL
answers[].voteup_count int Upvotes
answers[].comment_count int Total comments on this answer
answers[].comments[] array This answer's comments (same shape as question.comments[])
related_questions[].title string Related question title
related_questions[].url string Related question page URL
related_questions[].answer_count int Answer count
related_questions[].follower_count int Followers
hot_searches[].query string Search term
hot_searches[].hot int Heat value
hot_searches[].hot_show string Heat text (e.g. "6.48M")
hot_searches[].url string Zhihu search page URL
POST /api/zhihu/article Total calls: 0

Column article detail

Zhihu column article detail: the full article body with images, comments and "others are searching".

Required. The Zhihu article ID (plain digits), or the article page URL (e.g. https://zhuanlan.zhihu.com/p/608180793).

Optional, 0–20, default 10. How many top comments to return (0 = none).

  • The body is the full text: it is the complete article body embedded in the page, not an excerpt; content_truncated is true only when Zhihu itself truncated a very long article (rare).
  • Images: content is the raw HTML (ready to render) and images is a pre-extracted array of image URLs (original resolution preferred, de-duplicated).
  • An article page has only three modules: body, comments and "others are searching" — there is no "answer list" and no "related questions" (those are question-page only).
  • comment_count is the total number of comments, not the number returned in this call (that is controlled by comment_limit).
  • GET is also accepted (parameters go in the query string); because a Zhihu cookie is long, POST with the cookie in the form body is recommended.
Response Common envelope
Field Type Description
article.id string Article ID
article.title string Title
article.url string Article page URL
article.content string Article body HTML (kept verbatim; may contain images / code blocks / quotes)
article.images array Image URLs in the body
article.excerpt string Excerpt
article.topics[].name string Topic name
article.topics[].url string Topic page URL
article.author.name string Author nickname
article.author.url string Author profile URL
article.voteup_count int Upvotes
article.comment_count int Total comments
article.liked_count int "Like" count
article.favlists_count int Favorite count
article.content_truncated bool Whether Zhihu truncated the body (true means this is not the full text)
article.created_time int Published time (Unix seconds)
article.updated_time int Updated time (Unix seconds)
article.comments[] array Comments (same shape as question.comments[])
hot_searches[].query string Search term
hot_searches[].url string Zhihu search page URL
POST /api/zhihu/check Total calls: 0

Verify login credentials

Verify whether a Zhihu login credential is valid (pass `cookie` to check your own, otherwise the platform-hosted account is checked).

  • An invalid credential does not count as an API failure: the endpoint still returns a success code, with valid=false and the reason in data, letting the caller decide whether to prompt the user to sign in again.
  • Checking the platform-hosted account updates its "credential status" and "last check result", visible directly on the console's "Accounts" page; checking your own cookie does not touch the platform account.
  • GET is also accepted (parameters go in the query string); because a Zhihu cookie is long, POST with the cookie in the form body is recommended.
Response Common envelope
Field Type Description
valid bool Whether the credential is valid
account string The account identifier that was checked (empty when checking your own cookie)
message string Check message (includes the signed-in username when valid)
XiaoYingAPI · Unified API Aggregation Service