Zhihu-Web-API

获取知乎问题回答列表/Get Zhihu Question Answers

Changed on

[中文]

用途:

  • 获取知乎问题的回答列表

参数:

  • question_id: 问题ID
  • cursor: 分页游标,从 data.paging.next URL 的查询参数提取
  • limit: 每页回答数量,默认5
  • offset: 偏移量,默认0
  • order: 排序方式,default=默认排序,updated=按时间排序
  • session_id: 会话ID,从同一个 data.paging.next URL 提取

返回:

  • 知乎问题回答列表数据。分页会话绑定首次成功请求的账号,由服务自动保持;机构号可用性取决于当前权限和限频状态。
  • data.paging.is_end=true 或 next 缺失时停止。解析 next 的 cursor、offset、session_id、limit、order 原样传回;offset 不要自行加 limit。切换问题或排序时从首页重新开始。分页状态在成功获取后续游标时续期 15 分钟;会话过期或账号不可用需重新请求首页,暂时繁忙可使用相同游标重试。

[English]

Purpose:

  • Get Zhihu Question Answers List

Parameters:

  • question_id: Question ID
  • cursor: Pagination cursor from the query parameters in data.paging.next
  • limit: Number of answers per page, default 5
  • offset: Offset, default 0
  • order: Sort order, default=default sort, updated=sort by time
  • session_id: Session ID from the same data.paging.next URL

Returns:

  • Question answers. The service keeps subsequent pages on the account that opened the session; organization-account availability depends on current permissions and rate limits.
  • Stop when data.paging.is_end=true or next is missing. Reuse cursor, offset, session_id, limit and order from the next URL unchanged; never increment offset by limit. Restart pagination when changing the question or order. Session state expires 15 minutes after the latest successful next-cursor response. Restart from page one if the session expires or its account becomes unavailable; retry the same cursor for temporary busy errors.

[示例/Example]

question_id = "37811449" cursor = "" limit = 5 offset = 0 order = "default" # 或 "updated" 按时间排序 session_id = ""

获取下一页 (Get next page):

从本次响应 data.paging.next URL 提取参数,不复用文档中的固定游标

Extract the next URL parameters from this response; never reuse a static cursor.

按时间排序 (Sort by time):

order = "updated"

get/api/v1/zhihu/web/fetch_question_answers

Request

  • Base URL
    https://api.tikhub.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Query parameters

question_idstring required

问题ID/Question ID

cursorstring

从 data.paging.next URL 提取/Pagination cursor from data.paging.next URL

limitinteger

每页回答数量/Number of answers per page

offsetinteger

从 data.paging.next 原样提取,勿自行加 limit/Use next URL offset unchanged

orderstring

排序方式:default=默认排序,updated=按时间排序/Sort order: default=default sort, updated=sort by time

session_idstring

从 data.paging.next URL 提取/Session ID from data.paging.next URL

Response

Successful Response

codeinteger

HTTP status code | HTTP状态码

request_idstring nullable

Unique request identifier | 唯一请求标识符

messagestring

Response message (EN-US) | 响应消息 (English)

message_zhstring

Response message (ZH-CN) | 响应消息 (中文)

supportstring

Support message | 支持消息

timestring

The time the response was generated | 生成响应的时间

time_stampinteger

The timestamp the response was generated | 生成响应的时间戳

time_zonestring

The timezone of the response time | 响应时间的时区

docsstring nullable

Link to the API Swagger documentation for this endpoint | 此端点的 API Swagger 文档链接

cache_messagestring nullable

Cache message (EN-US) | 缓存消息 (English)

cache_message_zhstring nullable

Cache message (ZH-CN) | 缓存消息 (中文)

cache_urlstring nullable

The URL to access the cached result | 访问缓存结果的 URL

routerstring

The endpoint that generated this response | 生成此响应的端点

paramsunknown
dataunknown

Changes

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      the response's property default value changed from This request will be cached. You can access the cached result directly using the URL below valid for 24 hours. Accessing the cache will not incur additional charges. to This response is cached and accessible via the URL below for 24 hours at no extra cost. The cache is for request tracing only — it doesn't affect the API's data freshness and won't be returned through the API again. for the status

    • info

      the response's property default value changed from 本次请求将被缓存,你可以使用下面的 URL 直接访问缓存结果,有效期为 24 小时,访问缓存不会产生额外费用。 to 本次响应已缓存,可通过下方 URL 直接查看,有效期 24 小时,访问缓存链接无额外费用。缓存仅用于请求溯源,不影响接口数据的时效性,也不会再次通过接口返回。 for the status