---
title: "获取Reddit APP动态搜索结果/Fetch Reddit APP Dynamic Search Results"
method: GET
path: "/api/v1/reddit/app/fetch_dynamic_search"
tags: ["Reddit-APP-API"]
---

# 获取Reddit APP动态搜索结果/Fetch Reddit APP Dynamic Search Results

`GET /api/v1/reddit/app/fetch_dynamic_search`

## Request

- Base URL: `https://api.tikhub.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.tikhub.io/api/v1/reddit/app/fetch_dynamic_search`
- Auth: HTTP bearer

# [中文]
### 用途:
- 执行Reddit APP动态搜索,支持搜索帖子、社区、评论、媒体和用户
### 参数:
- query: 搜索关键词或搜索表达式；帖子搜索默认可匹配标题或正文中的部分关键词，详细语法见下方说明
- search_type: 搜索类型,可选值:
  - post: 搜索帖子(默认)
  - community: 搜索社区/版块
  - comment: 搜索评论
  - media: 搜索媒体(图片/视频/GIF)
  - people: 搜索用户
- sort: 排序方式(仅适用于post/comment/media类型),可选值:
  - RELEVANCE: 相关性
  - HOT: 热门
  - TOP: 最受欢迎
  - NEW: 最新
  - COMMENTS: 评论数(仅适用于post类型)
- time_range: 时间范围(仅适用于post/media类型),可选值:
  - all: 所有时间
  - year: 去年
  - month: 上个月
  - week: 上周
  - day: 今天
  - hour: 过去1小时
- safe_search: 安全搜索设置,"unset"或"strict"
- allow_nsfw: 是否允许NSFW内容,"0"或"1"
- after: 分页游标；need_format=true时，将pageInfo.endCursor原样传入以获取下一页
- need_format: 默认false；true时将data精简为children和pageInfo，保留结果核心内容及翻页参数
### 返回:
- need_format=false: 返回原始嵌套搜索结果数据
- need_format=true: data仅包含:
  - children: 结果列表，按search_type包含post、comment、community或author等对应内容
  - pageInfo: 分页信息，保留endCursor、startCursor、hasNextPage和hasPreviousPage等可用字段
- children为空列表时表示没有结果；hasNextPage为true时，可继续使用endCursor翻页
- 精简结果保留ID、标题、正文、时间、统计、作者、社区和媒体等核心内容；正文优先保留markdown，移除重复正文表示和重复尺寸头像
### 注意:
- community和people类型不支持sort和time_range参数
- COMMENTS排序方式仅适用于post类型
- time_range参数仅适用于post和media类型
- 帖子搜索中，TOP和NEW分别按受欢迎程度和发布时间排序，不保证结果包含query的全部关键词；需要全部匹配时请使用AND
- time_range限制结果的时间范围，不改变关键词匹配条件
- need_format=true移除冗余字段、辅助展示信息、用户交互状态和空值，保留false和0等有效值，以及分页中的null结束游标
- 翻页时保持query、search_type、sort及其他筛选条件与上一页一致

### 精简结果示例:
```json
{
  "children": [{"post": {"id": "t3_abc123", "postTitle": "Rust borrow checker", "score": 0}}],
  "pageInfo": {"endCursor": "<cursor>", "hasNextPage": true, "hasPreviousPage": false}
}
```

### 帖子搜索语法:

| 语法 | query示例 | 含义 |
| --- | --- | --- |
| AND | `rust AND borrow AND checker` | 同时匹配所有指定词 |
| OR | `rust OR golang` | 匹配任意一个指定词 |
| NOT | `rust NOT game` | 排除指定词 |
| 括号 | `rust AND (ownership OR borrowing)` | 明确组合条件 |
| 引号 | `"borrow checker"` | 搜索短语 |
| title: | `title:"borrow checker"` | 在标题中搜索 |
| selftext: | `selftext:"borrow checker"` | 在帖子正文中搜索 |
| subreddit: | `subreddit:rust` | 限定社区 |
| author: | `author:reddit` | 限定作者 |
| flair: | `flair:discussion` | 搜索帖子标签 |
| site: | `site:github.com` | 限定链接域名 |
| url: | `url:github.com` | 搜索链接地址 |
| self: | `self:true` | 限定文字帖；false为非文字帖 |

- AND、OR、NOT必须大写；字段冒号后不要加空格，例如`subreddit:rust`
- 字段中的多词短语需要引号，例如`title:"borrow checker"`
- 可组合字段，例如`title:"borrow checker" subreddit:rust`，再配合`sort=TOP`或`sort=NEW`
- 使用HTTP客户端的查询参数编码功能传递query，保留空格、引号和括号
- [Reddit官方搜索语法说明](https://support.reddithelp.com/hc/en-us/articles/19696541895316-Available-search-features)
- [Reddit官方排序说明](https://support.reddithelp.com/hc/en-us/articles/19695706914196-What-filters-and-sorts-are-available)

# [English]
### Purpose:
- Perform Reddit APP dynamic search, supporting posts, communities, comments, media, and users
### Parameters:
- query: Search keywords or expression; post searches may match only some terms in titles or post bodies. See the syntax reference below
- search_type: Search type, options:
  - post: Search posts (default)
  - community: Search communities/subreddits
  - comment: Search comments
  - media: Search media (images/videos/GIFs)
  - people: Search users
- sort: Sort method (only for post/comment/media types), options:
  - RELEVANCE: By relevance
  - HOT: Hot/trending
  - TOP: Most popular
  - NEW: Newest
  - COMMENTS: By comment count (only for post type)
- time_range: Time range (only for post/media types), options:
  - all: All time
  - year: Past year
  - month: Past month
  - week: Past week
  - day: Today
  - hour: Past hour
- safe_search: Safe search setting, "unset" or "strict"
- allow_nsfw: Allow NSFW content, "0" or "1"
- after: Pagination cursor; when need_format=true, pass pageInfo.endCursor unchanged to fetch the next page
- need_format: Defaults to false; true reduces data to children and pageInfo, retaining core result content and pagination
### Returns:
- need_format=false: Original nested search result data
- need_format=true: data contains only:
  - children: Results containing the corresponding post, comment, community or author content for search_type
  - pageInfo: Available pagination fields, including endCursor, startCursor, hasNextPage and hasPreviousPage
- An empty children list means no results; when hasNextPage is true, continue using endCursor
- Compact results retain IDs, titles, content, timestamps, statistics, authors, communities and media. Markdown is preferred for bodies; duplicate body representations and avatar sizes are removed
### Notes:
- community and people types do not support sort and time_range parameters
- COMMENTS sort option only applies to post type
- time_range parameter only applies to post and media types
- For post searches, TOP and NEW sort by popularity and publication time respectively; results may match only some query terms. Use AND when all terms are required
- time_range limits the age of results without changing keyword matching conditions
- need_format=true removes redundant fields, auxiliary presentation details, user interaction state and empty values; valid false and 0 values and null terminal pagination cursors are retained
- Keep query, search_type, sort and other filters unchanged when fetching subsequent pages

### Compact result example:
```json
{
  "children": [{"post": {"id": "t3_abc123", "postTitle": "Rust borrow checker", "score": 0}}],
  "pageInfo": {"endCursor": "<cursor>", "hasNextPage": true, "hasPreviousPage": false}
}
```

### Post search syntax:

| Syntax | query example | Meaning |
| --- | --- | --- |
| AND | `rust AND borrow AND checker` | Require all specified terms |
| OR | `rust OR golang` | Match any specified term |
| NOT | `rust NOT game` | Exclude a specified term |
| Parentheses | `rust AND (ownership OR borrowing)` | Group conditions |
| Quotes | `"borrow checker"` | Search for a phrase |
| title: | `title:"borrow checker"` | Search in titles |
| selftext: | `selftext:"borrow checker"` | Search in post bodies |
| subreddit: | `subreddit:rust` | Limit to a community |
| author: | `author:reddit` | Limit to an author |
| flair: | `flair:discussion` | Search post flair text |
| site: | `site:github.com` | Limit linked domains |
| url: | `url:github.com` | Search link addresses |
| self: | `self:true` | Limit to text posts; false selects non-text posts |

- AND, OR and NOT must be uppercase. Do not add spaces after field colons, e.g. `subreddit:rust`
- Quote multi-word field values, e.g. `title:"borrow checker"`
- Combine fields, e.g. `title:"borrow checker" subreddit:rust`, with `sort=TOP` or `sort=NEW`
- Use your HTTP client's query parameter encoding to preserve spaces, quotes and parentheses in query
- [Official Reddit search syntax](https://support.reddithelp.com/hc/en-us/articles/19696541895316-Available-search-features)
- [Official Reddit sorting reference](https://support.reddithelp.com/hc/en-us/articles/19695706914196-What-filters-and-sorts-are-available)

# [示例/Example]
query="python programming"
search_type="post"
sort="RELEVANCE"
time_range="all"
safe_search="unset"
allow_nsfw="0"
after=""
need_format=false

## Query parameters

- `language` string: 返回内容使用的语言，采用 IETF 语言标签；默认 en-US / Preferred response language as an IETF language tag; default: en-US
- `query` string, required: 搜索关键词或搜索表达式；帖子搜索默认可匹配部分关键词，支持 AND、OR、NOT、括号分组、引号短语和字段限定 / Search keywords or expression; post searches may match only some keywords. Supports AND, OR, NOT, grouping, quoted phrases and field filters
- `search_type` 'post' | 'community' | 'comment' | 'media' | 'people': 搜索类型/Search type: post(帖子), community(社区), comment(评论), media(媒体), people(用户)
- `sort` 'RELEVANCE' | 'HOT' | 'TOP' | 'NEW' | 'COMMENTS', nullable: 排序方式(仅适用于post/comment/media)/Sort method (only for post/comment/media): RELEVANCE(相关性), HOT(热门), TOP(最受欢迎), NEW(最新), COMMENTS(评论数,仅post)
- `time_range` 'all' | 'year' | 'month' | 'week' | 'day' | 'hour', nullable: 时间范围(仅适用于post/media)/Time range (only for post/media): all(所有时间), year(去年), month(上月), week(上周), day(今天), hour(过去1小时)
- `safe_search` 'unset' | 'strict': 安全搜索设置/Safe search setting: unset, strict
- `allow_nsfw` '0' | '1': 是否允许NSFW内容/Allow NSFW content: 0, 1
- `after` string: 分页游标；need_format=true时使用pageInfo.endCursor / Pagination cursor; use pageInfo.endCursor when need_format=true
- `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

## Response `200`

Successful Response

- ResponseModel
  - `code` integer: HTTP status code | HTTP状态码
  - `request_id` string, nullable: Unique request identifier | 唯一请求标识符
  - `message` string: Response message (EN-US) | 响应消息 (English)
  - `message_zh` string: Response message (ZH-CN) | 响应消息 (中文)
  - `support` string: Support message | 支持消息
  - `time` string: The time the response was generated | 生成响应的时间
  - `time_stamp` integer: The timestamp the response was generated | 生成响应的时间戳
  - `time_zone` string: The timezone of the response time | 响应时间的时区
  - `docs` string, nullable: Link to the API Swagger documentation for this endpoint | 此端点的 API Swagger 文档链接
  - `cache_message` string, nullable: Cache message (EN-US) | 缓存消息 (English)
  - `cache_message_zh` string, nullable: Cache message (ZH-CN) | 缓存消息 (中文)
  - `cache_url` string, nullable: The URL to access the cached result | 访问缓存结果的 URL
  - `router` string: The endpoint that generated this response | 生成此响应的端点
  - `params` unknown
  - `data` unknown

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-08** `96a122a5f220`: 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2026-09-05** `eab99e8bfe5b`: 4 breaking, 2 warning, 14 info
  - the `query` request parameter `allow_nsfw` was restricted to a list of enum values
  - the `query` request parameter `safe_search` was restricted to a list of enum values
  - the `query` request parameter `search_type` was restricted to a list of enum values
  - for the `query` request parameter `query`, the minLength was increased from `0` to `1`
  - …16 more
- **2026-09-01** `50f9ec6e1cd3`: 2 info
  - the `cache_message` 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 `200`
  - the `cache_message_zh` response's property default value changed from `本次请求将被缓存，你可以使用下面的 URL 直接访问缓存结果，有效期为 24 小时，访问缓存不会产生额外费用。` to `本次响应已缓存，可通过下方 URL 直接查看，有效期 24 小时，访问缓存链接无额外费用。缓存仅用于请求溯源，不影响接口数据的时效性，也不会再次通过接口返回。` for the status `200`
- **2026-04-14** `ee5b7c9c88f5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/tikhub/apis/tikhub-douyin-tiktok-xiaohongshu-lemon8-bilibili-kuaishou-pi/changes/api/v1/reddit/app/fetch_dynamic_search/get.md)

---

[API](https://skmtc.dev/tikhub/apis/tikhub-douyin-tiktok-xiaohongshu-lemon8-bilibili-kuaishou-pi.md) - [All operations](https://skmtc.dev/tikhub/apis/tikhub-douyin-tiktok-xiaohongshu-lemon8-bilibili-kuaishou-pi/llms.txt) - [OpenAPI document](https://skmtc.dev/tikhub/apis/tikhub-douyin-tiktok-xiaohongshu-lemon8-bilibili-kuaishou-pi/revisions/86a3483c705a?raw)
