Skip to content

知乎获取问题回答列表

POST🔗 /api/zhihu/question-answers-v1🔒 需开通
知乎回答
🔒
该接口需开通后调用暂未开放自助调用。联系销售为你的账号开通权限并发放调用 token。

根据问题 ID 分页获取该问题下的回答列表。

请求参数

参数名类型必填默认值说明
tokenstring-你的访问令牌(通过 query 传递)
question_idstring-问题 ID
pagenumber1页码

代码示例

环境地址:示例中的 https://<your_endpoint> 为占位符,请替换为客服为你分配的专属接入地址(详见快速开始)。

bash
curl -X POST 'https://<your_endpoint>/api/zhihu/question-answers-v1?token=YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"question_id":"1234567890","page":1}'
python
import requests

resp = requests.post(
    "https://<your_endpoint>/api/zhihu/question-answers-v1",
    params={"token": "YOUR_TOKEN"},
    json={
      "question_id": "1234567890",
      "page": 1
    },
    timeout=60,
)
print(resp.json())
javascript
const resp = await fetch('https://<your_endpoint>/api/zhihu/question-answers-v1?token=YOUR_TOKEN', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({"question_id":"1234567890","page":1}),
})
console.log(await resp.json())

响应结果示例

json
{
  "code": 0,
  "message": "ok",
  "data": {
    "question_id": "q_1",
    "title": "示例问题",
    "total": 3200,
    "list": [
      {
        "answer_id": "zh_1",
        "excerpt": "示例回答",
        "voteup_count": 12000
      }
    ]
  }
}
json
{
  "code": 303,
  "message": "采集失败,请稍后重试",
  "data": null
}