Reddit App Fetch Dynamic Search
## Search Reddit Search posts, communities/subreddits, comments, media (images, videos and GIFs), or users by keywords or a search expression. ### Inputs - **query** — Required, 1–512 characters. For post searches, ordinary keywords may match only some terms in titles or bodies. Use `rust AND borrow AND checker` when every term is required. - **search_type** — `post` (default), `community`, `comment`, `media`, or `people`. - **sort** — Optional: `RELEVANCE`, `HOT`, `TOP`, `NEW`, or `COMMENTS`. Only supported for post, comment and media searches; `COMMENTS` is post-only. Omit for community and people searches. - **time_range** — Optional: `all`, `year`, `month`, `week`, `day`, or `hour`. Only supported for post and media searches; omit for comment, community and people searches. These represent all time, past year, past month, past week, today and past hour, respectively. - **safe_search** — `unset` (default) or `strict`. - **allow_nsfw** — String `"0"` (default, disallow) or `"1"` (allow). - **language** — Preferred response language as an IETF language tag, such as `en-US` (default); 2–16 characters. - **after** — Pagination cursor, at most 4096 characters; defaults to an empty string for the first page. - **need_format** — Boolean, default `false`. Set to `true` for compact results and pagination information. ### Results and pagination Results are returned in `data`. With `need_format=false`, the original nested search structure is preserved. With `need_format=true`, `data` contains only: - **children** — A result list containing the corresponding post, comment, community or author content for the chosen search type. An empty list means no results. - **pageInfo** — Available pagination fields, including `endCursor`, `startCursor`, `hasNextPage` and `hasPreviousPage`. When `hasNextPage` is true, pass `pageInfo.endCursor` unchanged as `after`. Keep `query`, `search_type`, `sort` and other filters unchanged between pages. A null terminal cursor may be retained in pagination information. Compact results retain available IDs, titles, bodies, timestamps, statistics, authors, communities and media. Markdown is preferred for bodies. Redundant body representations, duplicate avatar sizes, presentation details, user interaction state and empty values are removed; meaningful `false` and `0` values are preserved. Fields vary by result type and availability. ### Post search expressions Use uppercase `AND`, `OR` and `NOT`, parentheses for grouping, and quotes for phrases. Supported field filters include `title:`, `selftext:`, `subreddit:`, `author:`, `flair:`, `site:`, `url:` and `self:` (`true` for text posts, `false` for non-text posts). Do not add spaces after field colons, and quote multi-word field values. Example: `title:"borrow checker" subreddit:rust`, optionally with `sort=TOP` or `sort=NEW`. `TOP` sorts by popularity and `NEW` by publication time; neither ensures that all query terms match. `time_range` limits result age without changing keyword matching. Minimal input: `{"query":"rust AND borrow","need_format":true}`.
Pricing
| Condition | Charge |
|---|---|
| Each call | 2.07 credits/call |
2.07 credits/call Charges are per query. A successful query is billed even if it returns no results.
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
sort | string | null | No | 排序方式(仅适用于post/comment/media)/Sort method (only for post/comment/media): RELEVANCE(相关性), HOT(热门), TOP(最受欢迎), NEW(最新), COMMENTS(评论数,仅post) | — |
after | string | No | 分页游标;need_format=true时使用pageInfo.endCursor / Pagination cursor; use pageInfo.endCursor when need_format=true | "" |
query | string | Yes | 搜索关键词或搜索表达式;帖子搜索默认可匹配部分关键词,支持 AND、OR、NOT、括号分组、引号短语和字段限定 / Search keywords or expression; post searches may match only some keywords. Supports AND, OR, NOT, grouping, quoted phrases and field filters | — |
language | string | No | 返回内容使用的语言,采用 IETF 语言标签;默认 en-US / Preferred response language as an IETF language tag; default: en-US | en-US |
allow_nsfw | enum (0 | 1) | No | 是否允许NSFW内容/Allow NSFW content: 0, 1 | 0 |
time_range | string | null | No | 时间范围(仅适用于post/media)/Time range (only for post/media): all(所有时间), year(去年), month(上月), week(上周), day(今天), hour(过去1小时) | — |
need_format | boolean | No | true时data仅包含children和pageInfo,并精简每条结果的冗余字段;false时保留原始搜索结构 / When true, data contains only children and pageInfo with redundant result fields removed; false preserves the original search structure | false |
safe_search | enum (unset | strict) | No | 安全搜索设置/Safe search setting: unset, strict | unset |
search_type | enum (post | community | comment | media | people) | No | 搜索类型/Search type: post(帖子), community(社区), comment(评论), media(媒体), people(用户) | post |
Invocation example
Copy the request and explore its response example.
/agent-api/v1/tool/executeX-Api-Keycurl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_reddit_app_fetch_dynamic_search' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"language": "en-US",
"need_format": true,
"query": "1xogi2c OR 1xthjda OR 1xpa5hw OR 1xohadx OR 1xp7am1 OR 1xrrd0m OR 1xpxh98 OR 1xommv8",
"search_type": "comment",
"sort": "TOP",
"time_range": "week"
}
}'{
"code": 200,
"data": {
"children": [],
"pageInfo": {
"endCursor": "eyJjYW5kaWRhdGVzX3JldHVybmVkIjoie1wic2VjdGlvbl8xX3BpcGVsaW5lXzBfZ2xvYmFsX21vZGlmaWVyc1wiOlwiMVwiLFwic2VjdGlvbl8xX3BpcGVsaW5lXzFfbG9jYWxfbW9kaWZpZXJzXCI6XCIxXCIsXCJzZWN0aW9uXzJfcGlwZWxpbmVfMV9jb21tZW50X3NlYXJjaFwiOlwiMFwiLFwic2VjdGlvbl8yX3BpcGVsaW5lXzJfbm9f",
"hasNextPage": false,
"hasPreviousPage": false,
"startCursor": ""
}
},
"docs": "https://api.tikhub.io/#/Reddit-APP-API/fetch_dynamic_search_api_v1_reddit_app_fetch_dynamic_search_get",
"message": "Request successful. This request will incur a charge.",
"message_zh": "请求成功,本次请求将被计费。",
"params": {
"after": "",
"allow_nsfw": "0",
"language": "en-US",
"need_format": "true",
"query": "1xogi2c OR 1xthjda OR 1xpa5hw OR 1xohadx OR 1xp7am1 OR 1xrrd0m OR 1xpxh98 OR 1xommv8",
"safe_search": "unset"
}
}This example shows part of the response. Copied content is valid JSON.

