# 搜索版块

按关键词搜索 Reddit 版块，按游标翻页。

ID: native-http:social.reddit.community.search · Region: cn · Status: available

catalog_version: 5c920c774a55e44d7e8c709143b88a18b8b2afcef91a5d19a8c9ae5d565d9077
updated_at: 2026-10-21T12:06:16.523771+00:00

按关键词搜索 Reddit 版块，按游标翻页。

历史数据以数据集发布版本定义覆盖周期；实时读取反映请求时资料，不保证覆盖全部记录。

Docs: https://docs.asklear.cn/capabilities/native-http%3Asocial.reddit.community.search

## POST /v1/native/social/reddit/communities/search

native · available · api_key

REST 需要客户 API Key；MCP 需要已开放的服务及现有授权；CLI 需要已发布且包含该命令的客户端。

按关键词搜索 Reddit 版块，按游标翻页。

按成功请求计费，每次请求计一次；max_credits 限制本次费用上限。

恢复同一次原生请求时复用原 Idempotency-Key。

等待态响应提供结果/状态引用。先读取原结果；超时或结果不明时禁止自动重新提交付费执行。401/403/422 应先修正鉴权、权限或输入。

### Input schema / 输入契约

```json
{
  "$defs": {
    "Schema1": {}
  },
  "additionalProperties": false,
  "properties": {
    "input": {
      "additionalProperties": false,
      "description": "community 与 people 类型不支持 sort 与 time_range（上游文档明示）。",
      "properties": {
        "allow_nsfw": {
          "default": "0",
          "description": "是否允许NSFW内容/Allow NSFW content: 0, 1",
          "enum": [
            "0",
            "1"
          ],
          "type": "string"
        },
        "cursor": {
          "default": "",
          "description": "分页游标；need_format=true时使用pageInfo.endCursor / Pagination cursor; use pageInfo.endCursor when need_format=true",
          "maxLength": 4096,
          "type": "string"
        },
        "keyword": {
          "description": "搜索关键词或搜索表达式；帖子搜索默认可匹配部分关键词，支持 AND、OR、NOT、括号分组、引号短语和字段限定 / Search keywords or expression; post searches may match only some keywords. Supports AND, OR, NOT, grouping, quoted phrases and field filters",
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "language": {
          "default": "en-US",
          "description": "返回内容使用的语言，采用 IETF 语言标签；默认 en-US / Preferred response language as an IETF language tag; default: en-US",
          "maxLength": 16,
          "minLength": 2,
          "pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$",
          "type": "string"
        },
        "need_format": {
          "default": false,
          "description": "true时data仅包含children和pageInfo，并精简每条结果的冗余字段；false时保留原始搜索结构 / When true, data contains only children and pageInfo with redundant result fields removed; false preserves the original search structure",
          "type": "boolean"
        },
        "safe_search": {
          "default": "unset",
          "description": "安全搜索设置/Safe search setting: unset, strict",
          "enum": [
            "unset",
            "strict"
          ],
          "type": "string"
        }
      },
      "required": [
        "keyword"
      ],
      "type": "object"
    },
    "max_credits": {
      "anyOf": [
        {
          "maximum": 1000000000,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "task_query": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional task attribution: when provided, write one concise, self-contained task_query in the user's language and reuse that exact value in every call for the task, including discovery, search, approval retry, results, export, and status checks. For MCP calls, when omitted, Asklear records a generic non-user-specific attribution so compatible clients can still call the tool. REST calls may omit it and remain unattributed. It is a task description, not a task identifier. Do not include hidden reasoning, credentials, or direct personal identifiers such as phone numbers, email addresses, identity numbers, or street addresses.",
          "maxLength": 300
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "input"
  ],
  "type": "object"
}
```

### Synthetic request / 合成请求

```json
{
  "input": {
    "keyword": "example"
  }
}
```

### Response schema / 响应契约

```json
{
  "$defs": {
    "Schema1": {},
    "Schema2": {
      "properties": {
        "api_name": {
          "type": "string"
        },
        "credits_charged": {
          "minimum": 0,
          "type": "integer"
        },
        "latency_ms": {
          "minimum": 0,
          "type": "integer"
        },
        "next_input": {
          "anyOf": [
            {
              "additionalProperties": false,
              "description": "community 与 people 类型不支持 sort 与 time_range（上游文档明示）。",
              "properties": {
                "allow_nsfw": {
                  "default": "0",
                  "description": "是否允许NSFW内容/Allow NSFW content: 0, 1",
                  "enum": [
                    "0",
                    "1"
                  ],
                  "type": "string"
                },
                "cursor": {
                  "default": "",
                  "maxLength": 4096,
                  "type": "string"
                },
                "keyword": {
                  "maxLength": 512,
                  "minLength": 1,
                  "type": "string"
                },
                "language": {
                  "default": "en-US",
                  "description": "返回内容使用的语言，采用 IETF 语言标签；默认 en-US / Preferred response language as an IETF language tag; default: en-US",
                  "maxLength": 16,
                  "minLength": 2,
                  "pattern": "^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$",
                  "type": "string"
                },
                "need_format": {
                  "default": false,
                  "description": "true时data仅包含children和pageInfo，并精简每条结果的冗余字段；false时保留原始搜索结构 / When true, data contains only children and pageInfo with redundant result fields removed; false preserves the original search structure",
                  "type": "boolean"
                },
                "safe_search": {
                  "default": "unset",
                  "description": "安全搜索设置/Safe search setting: unset, strict",
                  "enum": [
                    "unset",
                    "strict"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "keyword"
              ],
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        },
        "request_id": {
          "type": "string"
        }
      },
      "required": [
        "api_name",
        "request_id",
        "latency_ms",
        "credits_charged",
        "next_input"
      ],
      "type": "object"
    }
  },
  "properties": {
    "data": {
      "additionalProperties": true,
      "description": "Known optional fields from sanitized offline fixtures; conditional fields may be null. Additional business fields are retained.",
      "properties": {
        "code": {
          "type": [
            "integer",
            "null"
          ]
        },
        "data": {
          "additionalProperties": true,
          "properties": {
            "search": {
              "additionalProperties": true,
              "properties": {
                "dynamic": {
                  "additionalProperties": true,
                  "properties": {
                    "components": {
                      "additionalProperties": true,
                      "properties": {
                        "main": {
                          "additionalProperties": true,
                          "properties": {
                            "edges": {
                              "items": {
                                "additionalProperties": true,
                                "properties": {
                                  "cursor": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "node": {
                                    "additionalProperties": true,
                                    "properties": {
                                      "children": {
                                        "items": {
                                          "additionalProperties": true,
                                          "properties": {
                                            "community": {
                                              "additionalProperties": true,
                                              "properties": {
                                                "__typename": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "id": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "isNsfw": {
                                                  "type": [
                                                    "boolean",
                                                    "null"
                                                  ]
                                                },
                                                "isQuarantined": {
                                                  "type": [
                                                    "boolean",
                                                    "null"
                                                  ]
                                                },
                                                "isSubscribed": {
                                                  "type": [
                                                    "boolean",
                                                    "null"
                                                  ]
                                                },
                                                "name": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "prefixedName": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "publicDescriptionText": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "styles": {
                                                  "additionalProperties": true,
                                                  "properties": {
                                                    "icon": {
                                                      "type": [
                                                        "string",
                                                        "null"
                                                      ]
                                                    },
                                                    "legacyIcon": {
                                                      "description": "Observed as null; the non-null type is not established."
                                                    }
                                                  },
                                                  "type": [
                                                    "object",
                                                    "null"
                                                  ]
                                                },
                                                "subscribersCount": {
                                                  "type": [
                                                    "integer",
                                                    "null"
                                                  ]
                                                }
                                              },
                                              "type": [
                                                "object",
                                                "null"
                                              ]
                                            }
                                          },
                                          "type": [
                                            "object",
                                            "null"
                                          ]
                                        },
                                        "type": [
                                          "array",
                                          "null"
                                        ]
                                      }
                                    },
                                    "type": [
                                      "object",
                                      "null"
                                    ]
                                  }
                                },
                                "type": [
                                  "object",
                                  "null"
                                ]
                              },
                              "type": [
                                "array",
                                "null"
                              ]
                            },
                            "pageInfo": {
                              "additionalProperties": true,
                              "properties": {
                                "endCursor": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "hasNextPage": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "hasPreviousPage": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                }
                              },
                              "type": [
                                "object",
                                "null"
                              ]
                            }
                          },
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      },
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "meta": {
      "$ref": "#/$defs/Schema2"
    }
  },
  "required": [
    "data",
    "meta"
  ],
  "type": "object"
}
```

### Synthetic response / 合成响应

```json
{
  "data": {
    "code": 200,
    "data": {
      "search": {
        "dynamic": {
          "components": {
            "main": {
              "edges": [
                {
                  "cursor": "",
                  "node": {
                    "children": [
                      {
                        "community": {
                          "__typename": "Subreddit",
                          "id": "t5_fixture1",
                          "isNsfw": false,
                          "isQuarantined": false,
                          "isSubscribed": false,
                          "name": "fixture_robotvacuums",
                          "prefixedName": "fixture_r/robotvacuums",
                          "publicDescriptionText": "合成正文 <em>highlight</em> fixture body 用于覆盖 _strip_markup",
                          "styles": {
                            "icon": "https://fixture.invalid/media/1",
                            "legacyIcon": null
                          },
                          "subscribersCount": 82548
                        }
                      }
                    ]
                  }
                }
              ],
              "pageInfo": {
                "endCursor": "FIXTURE_CURSOR_TOKEN_0123456789abcdef",
                "hasNextPage": true,
                "hasPreviousPage": false
              }
            }
          }
        }
      }
    }
  },
  "meta": {
    "api_name": "social.reddit.community.search",
    "credits_charged": 2,
    "latency_ms": 12,
    "next_input": {
      "cursor": "{\"after\":\"FIXTURE_CURSOR_TOKEN_0123456789abcdef\",\"k\":\"robot vacuum\",\"r\":\"\",\"s\":\"\",\"t\":\"community\"}",
      "keyword": "robot vacuum"
    },
    "request_id": "asklear-example"
  }
}
```

- data (object): Known optional fields from sanitized offline fixtures; conditional fields may be null. Additional business fields are retained.
- data.code (integer|null): 暂无字段说明
- data.data (object|null): 暂无字段说明
- data.data.search (object|null): 暂无字段说明
- data.data.search.dynamic (object|null): 暂无字段说明
- data.data.search.dynamic.components (object|null): 暂无字段说明
- data.data.search.dynamic.components.main (object|null): 暂无字段说明
- meta (object): 暂无字段说明
- meta.api_name (string): 暂无字段说明
- meta.request_id (string): 暂无字段说明
- meta.latency_ms (integer): 暂无字段说明
- meta.credits_charged (integer): 暂无字段说明
- meta.next_input (scalar): 暂无字段说明
- data.data.search.dynamic.components.main.edges (array|null): 暂无字段说明
- data.data.search.dynamic.components.main.edges[].cursor (string|null): 暂无字段说明
- data.data.search.dynamic.components.main.edges[].node (object|null): 暂无字段说明
- data.data.search.dynamic.components.main.edges[].node.children (array|null): 暂无字段说明
- data.data.search.dynamic.components.main.edges[].node.children[].community (object|null): 暂无字段说明
- data.data.search.dynamic.components.main.edges[].node.children[].community.__typename (string|null): 暂无字段说明
- data.data.search.dynamic.components.main.edges[].node.children[].community.id (string|null): 版块 ID（如有）。
- data.data.search.dynamic.components.main.edges[].node.children[].community.isNsfw (boolean|null): 成人内容标记（如有）。
- data.data.search.dynamic.components.main.edges[].node.children[].community.isQuarantined (boolean|null): 是否受限（如有）。
- data.data.search.dynamic.components.main.edges[].node.children[].community.isSubscribed (boolean|null): 是否已订阅（如有）。
- data.data.search.dynamic.components.main.edges[].node.children[].community.name (string|null): 版块名称（如有）。
- data.data.search.dynamic.components.main.edges[].node.children[].community.prefixedName (string|null): 账号名（如有）。
- data.data.search.dynamic.components.main.edges[].node.children[].community.publicDescriptionText (string|null): 描述（如有）。
- data.data.search.dynamic.components.main.edges[].node.children[].community.styles (object|null): 暂无字段说明
- data.data.search.dynamic.components.main.edges[].node.children[].community.styles.icon (string|null): 图标（如有）。
- data.data.search.dynamic.components.main.edges[].node.children[].community.styles.legacyIcon (scalar): Observed as null; the non-null type is not established.
- data.data.search.dynamic.components.main.edges[].node.children[].community.subscribersCount (integer|null): 成员数（如有）。
- data.data.search.dynamic.components.main.pageInfo (object|null): 暂无字段说明
- data.data.search.dynamic.components.main.pageInfo.endCursor (string|null): 暂无字段说明
- data.data.search.dynamic.components.main.pageInfo.hasNextPage (boolean|null): 暂无字段说明
- data.data.search.dynamic.components.main.pageInfo.hasPreviousPage (boolean|null): 暂无字段说明
- meta.next_input.allow_nsfw (string): 是否允许NSFW内容/Allow NSFW content: 0, 1
- meta.next_input.cursor (string): 暂无字段说明
- meta.next_input.keyword (string): 暂无字段说明
- meta.next_input.language (string): 返回内容使用的语言，采用 IETF 语言标签；默认 en-US / Preferred response language as an IETF language tag; default: en-US
- meta.next_input.need_format (boolean): true时data仅包含children和pageInfo，并精简每条结果的冗余字段；false时保留原始搜索结构 / When true, data contains only children and pageInfo with redundant result fields removed; false preserves the original search structure
- meta.next_input.safe_search (string): 安全搜索设置/Safe search setting: unset, strict

Follow up: GET /v1/native/results/{query_id}
读取已保存结果，不重复查询数据或收费。

