# Quora 关键词搜索 API (quora.search)

- Canonical page: https://everyinfra.com/quora-api/search
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "quora", "action": "search", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 200 per call
- Mode: sync; add "mode": "async" for slow tasks

Quora 关键词搜索按 `keyword` 混合检索问题、回答、Space 帖子、用户、Space 和主题，`type` 标明每条结果属于哪一类；回答带赞同数 `upvote_count` 和作者资历，帖子带所属 Space。它回答「这个话题在 Quora 上有什么」，适合在不确定该看问题还是回答时先摸底，或者一次把一个话题的问题、专家和社区都找出来。

用 `content_type` 只看一类结果，比如 `answer_answer_records` 只看回答；`date_range` 限定从最近一小时到最近一年。`keyword` 填问题主题，例如 how to learn Python，不能传链接去取单个对象。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=quora&action=search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | Quora 检索词；搜索可混合返回问题、回答、Space 动态、用户、Space 和主题，不是按 URL 取单个对象。 |
| content_type | enum: all_types_mixed_results / answer_answer_records / post_space_posts / profile_user_profiles / question_question_pages / space_quora_spaces / topic_topic_pages | no | not declared | 混合搜索的结果类别：all_types_mixed_results、question_question_pages、answer_answer_records、post_space_posts、profile_user_profiles、space_quora_spaces 或 topic_topic_pages。 |
| date_range | enum: all_time_broadest_discovery / past_day_last_24_hours / past_hour_very_recent_results / past_month_last_30_days / past_week_last_7_days / past_year_last_12_months | no | not declared | Quora 关键词搜索的新鲜度窗口：all_time_broadest_discovery 不限，past_hour_very_recent_results 最近一小时，past_day_last_24_hours 最近一天，past_week_last_7_days 最近一周，past_month_last_30_days 最近一月，past_year_last_12_months 最近一年。 |
| limit | integer (1–200) | no | 20 | 这次调用最多返回的条数，整数，1–200；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| type | 记录类型，取值随能力而定（如 video / image / text）。 |
| url | 该记录在原平台上的可访问链接。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| answer_count | 回答数。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| follower_count | 粉丝数。null 表示不公开，不等于 0。 |
| is_locked | 是否锁定。 |
| is_sensitive | 是否为敏感内容。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_name | 作者昵称（显示名）。 |
| author_url | 作者在原平台的主页链接。 |
| author_credential | 作者资历标注（Quora 要求回答者标明相关背景）。 |
| upvote_count | 赞同数。 |
| share_count | 分享/转发数。null 表示不公开，不等于 0。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| question_id | 问题 ID。 |
| question_url | 问题链接。 |
| space_name | 所属 Space（Quora 的社区单元）。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| user_id | 用户在原平台的唯一 ID。 |
| credential | 资历说明。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| topic_id | 话题 ID。 |
| photo_url | 图片链接。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "quora",
  "action": "search",
  "params": {
    "keyword": "how to learn Python"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "quora",
        "action": "search",
        "params": {
            "keyword": "how to learn Python",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "quora",
  "action": "search",
  "results": [
    {
      "type": "question",
      "url": "https://www.quora.com/How-should-I-start-learning-Python-1",
      "platform": "quora",
      "title": "How should I start learning Python?",
      "posted_at": "2013-04-10T23:58:33.824000+00:00",
      "answer_count": 916,
      "comment_count": 59,
      "follower_count": 7252,
      "is_locked": true,
      "is_sensitive": false
    },
    {
      "type": "question",
      "url": "https://www.quora.com/How-do-I-learn-Python-3",
      "platform": "quora",
      "title": "How do I learn Python?",
      "posted_at": "2009-10-08T21:08:11.612000+00:00",
      "answer_count": 200,
      "comment_count": 27,
      "follower_count": 3069,
      "is_locked": true,
      "is_sensitive": false
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 关键词搜索和问题列表、帖子列表有什么区别？

关键词搜索能混合返回各种类型，用 `content_type` 再收窄；问题列表、帖子列表、用户资料列表各自只返回一类。只关心一类时用专项能力，想先看全貌再决定方向时用关键词搜索。`content_type` 有可能覆盖接口本身的选择，用之前先核对对应能力的说明。`all_types_mixed_results` 是混合，`post_space_posts` 只要 Space 帖子，`topic_topic_pages` 只要话题页。

### 怎么只看回答？

`content_type` 传 `answer_answer_records`。回答结果带 `upvote_count` 和 `author_credential`，按赞同数排序再看作者资历，就能挑出这个话题下最受认可、也最有专业背景的回答。回答行还带 `question_id`，同一个问题下的几条回答可以按它归在一起比较；要转引的回答，先去掉 `is_locked` 或 `is_sensitive` 为真的行。

### 结果里的 `type` 有什么用？

混合搜索时，`type` 告诉你每一行是问题、回答、帖子、用户、Space 还是主题。先按 `type` 分组再分别处理：问题看 `answer_count`，用户看 `credential`，帖子看 `space_name`。`follower_count` 为 null 表示不公开，不等于 0，分组统计关注人数时别把 null 当成 0。用户行的 `user_id` 是 Quora 上的唯一 ID，话题行看 `topic_id`，问题和回答行看 `question_id`，分组以后各用各的 ID 去重。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=quora
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
