Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Reddit App Search Typeahead

API 文档
https://api.sandbase.ai/v1/api/reddit/app/search-typeahead

Returns autocomplete suggestions for the Reddit search box based on typed input. Includes options to toggle adult content, apply safe search settings, and format response data.

价格
$0.001美元 / 次调用
方法
POST
响应
JSON
参数
1 个必填 · 3 个可选

Playground

输入
Search keyword, the search text being typed
Whether to allow NSFW (adult) content display, "0" means disallow, "1" means allow
Whether to clean and format the data
输出示例
响应outputs · 17.2 KB · 425 行
[
  {
    "data": {
      "search": {
        "dynamic": {
          "components": {
            "__typename": "TypeaheadLayout",
            "main": [
              {
                "__typename": "SearchTypeaheadList",
                "behaviors": {
                  "collapse": null,
                  "expand": null,
                  "expandCta": null
                },
                "children": [
                  {
                    "__typename": "QueryAutocomplete",
                    "behaviors": {
                      "default": {
                        "__typename": "SearchQueryReformulationBehavior",
                        "query": "openai",
                        "telemetry": {
                          "__typename": "SearchElementTelemetry",
                          "events": "… 1 items in the full response",
                          "trackingContext": "…"
                        }
                      }
                    },
                    "presentation": {
                      "__typename": "QueryAutocompleteDefaultPresentation",
                      "query": "openai",
                      "suggestion": "%query%"
                    },
                    "telemetry": {
                      "__typename": "SearchElementTelemetry",
                      "events": [
                        {
                          "action": "view",
                          "noun": "typeahead",
                          "source": "search",
                          "trigger": "VIEW",
                          "triggerConfiguration": null
                        }
                      ],
                      "trackingContext": {
                        "__typename": "SearchTelemetryTrackingContext",
                        "actionInfo": {
                          "paneName": null,
                          "position": 0,
                          "reason": null,
                          "relativePosition": 0,
                          "type": "query_suggestion"
                        },
                        "answers": null,
                        "metaSearch": {
                          "displayQuery": "openai",
                          "rawQuery": "openai"
                        },
                        "post": null,
                        "profile": null,
                        "search": {
                          "isNsfw": false,
                          "query": "OpenAI",
                          "queryID": "9ce648d0-8c03-4308-9c9f-e5ee884d8532",
                          "range": null,
                          "safeSearch": "UNAVAILABLE",
                          "scope": "…",
                          "snippet": null,
                          "snippetId": null,
                          "sort": null
                        },
                        "subreddit": null
                      }
                    }
                  },
                  {
                    "__typename": "QueryAutocomplete",
                    "behaviors": {
                      "default": {
                        "__typename": "SearchQueryReformulationBehavior",
                        "query": "openai australia",
                        "telemetry": {
                          "__typename": "SearchElementTelemetry",
                          "events": "… 1 items in the full response",
                          "trackingContext": "…"
                        }
                      }
                    },
                    "presentation": {
                      "__typename": "QueryAutocompleteDefaultPresentation",
                      "query": "openai",
                      "suggestion": "%query% australia"
                    },
                    "telemetry": {
                      "__typename": "SearchElementTelemetry",
                      "events": [
                        {
                          "action": "view",
                          "noun": "typeahead",
                          "source": "search",
                          "trigger": "VIEW",
                          "triggerConfiguration": null
                        }
                      ],
                      "trackingContext": {
                        "__typename": "SearchTelemetryTrackingContext",
                        "actionInfo": {
                          "paneName": null,
                          "position": 1,
                          "reason": null,
                          "relativePosition": 1,
                          "type": "query_suggestion"
                        },
                        "answers": null,
                        "metaSearch": {
                          "displayQuery": "openai australia",
                          "rawQuery": "openai australia"
                        },
                        "post": null,
                        "profile": null,
                        "search": {
                          "isNsfw": false,
                          "query": "OpenAI",
                          "queryID": "9ce648d0-8c03-4308-9c9f-e5ee884d8532",
                          "range": null,
                          "safeSearch": "UNAVAILABLE",
                          "scope": "…",
                          "snippet": null,
                          "snippetId": null,
                          "sort": null
                        },
                        "subreddit": null
                      }
                    }
                  },
                  {
                    "__typename": "QueryAutocomplete",
                    "behaviors": {
                      "default": {
                        "__typename": "SearchQueryReformulationBehavior",
                        "query": "openai math",
                        "telemetry": {
                          "__typename": "SearchElementTelemetry",
                          "events": "… 1 items in the full response",
                          "trackingContext": "…"
                        }
                      }
                    },
                    "presentation": {
                      "__typename": "QueryAutocompleteDefaultPresentation",
                      "query": "openai",
                      "suggestion": "%query% math"
                    },
                    "telemetry": {
                      "__typename": "SearchElementTelemetry",
                      "events": [
                        {
                          "action": "view",
                          "noun": "typeahead",
                          "source": "search",
                          "trigger": "VIEW",
                          "triggerConfiguration": null
                        }
                      ],
                      "trackingContext": {
                        "__typename": "SearchTelemetryTrackingContext",
                        "actionInfo": {
                          "paneName": null,
                          "position": 2,
                          "reason": null,
                          "relativePosition": 2,
                          "type": "query_suggestion"
                        },
                        "answers": null,
                        "metaSearch": {
                          "displayQuery": "openai math",
                          "rawQuery": "openai math"
                        },
                        "post": null,
                        "profile": null,
                        "search": {
                          "isNsfw": false,
                          "query": "OpenAI",
                          "queryID": "9ce648d0-8c03-4308-9c9f-e5ee884d8532",
                          "range": null,
                          "safeSearch": "UNAVAILABLE",
                          "scope": "…",
                          "snippet": null,
                          "snippetId": null,
                          "sort": null
                        },
                        "subreddit": null
                      }
                    }
                  },
                  "… 1 more items in the full response"
                ],
                "id": "section_0_pipeline_1_query_autocomplete",
                "presentation": {
                  "__typename": "SearchTypeaheadListDefaultPresentation",
                  "title": ""
                }
              },
              {
                "__typename": "SearchTypeaheadList",
                "behaviors": {
                  "collapse": null,
                  "expand": null,
                  "expandCta": null
                },
                "children": [
                  {
                    "__typename": "TypeaheadSuggestion",
                    "behaviors": {
                      "default": {
                        "__typename": "SearchCommunityNavigationBehavior",
                        "id": "t5_3b9u5",
                        "name": "OpenAI",
                        "telemetry": {
                          "__typename": "SearchElementTelemetry",
                          "events": "… 1 items in the full response",
                          "trackingContext": "…"
                        },
                        "url": "/r/OpenAI/"
                      }
                    },
                    "presentation": {
                      "__typename": "TypeaheadSuggestionDefaultPresentation",
                      "description": "890K weekly visitors",
                      "displayTags": [],
                      "icon": "https://styles.redditmedia.com/t5_3b9u5/styles/communityIcon_sls3rtre3qxg1.png",
                      "name": "r/OpenAI"
                    },
                    "telemetry": {
                      "__typename": "SearchElementTelemetry",
                      "events": [
                        {
                          "action": "view",
                          "noun": "typeahead",
                          "source": "search",
                          "trigger": "VIEW",
                          "triggerConfiguration": null
                        }
                      ],
                      "trackingContext": {
                        "__typename": "SearchTelemetryTrackingContext",
                        "actionInfo": {
                          "paneName": null,
                          "position": 0,
                          "reason": null,
                          "relativePosition": 4,
                          "type": "subreddit"
                        },
                        "answers": null,
                        "metaSearch": null,
                        "post": null,
                        "profile": null,
                        "search": {
                          "isNsfw": false,
                          "query": "OpenAI",
                          "queryID": "9ce648d0-8c03-4308-9c9f-e5ee884d8532",
                          "range": null,
                          "safeSearch": "UNAVAILABLE",
                          "scope": "…",
                          "snippet": null,
                          "snippetId": null,
                          "sort": null
                        },
                        "subreddit": {
                          "id": "t5_3b9u5",
                          "isNsfw": false,
                          "isQuarantined": false,
                          "name": "OpenAI"
                        }
                      }
                    }
                  },
                  {
                    "__typename": "TypeaheadSuggestion",
                    "behaviors": {
                      "default": {
                        "__typename": "SearchCommunityNavigationBehavior",
                        "id": "t5_3ufsix",
                        "name": "OpenSourceAI",
                        "telemetry": {
                          "__typename": "SearchElementTelemetry",
                          "events": "… 1 items in the full response",
                          "trackingContext": "…"
                        },
                        "url": "/r/OpenSourceAI/"
                      }
                    },
                    "presentation": {
                      "__typename": "TypeaheadSuggestionDefaultPresentation",
                      "description": "8.8K weekly visitors",
                      "displayTags": [],
                      "icon": "https://styles.redditmedia.com/t5_3ufsix/styles/communityIcon_9k59886hou5c1.png",
                      "name": "r/OpenSourceAI"
                    },

示例

选择一个示例,将其输入和结果加载到 playground 中。

API README

Reddit App Search Typeahead API

Returns Reddit search box autocomplete suggestions for a typed text. It needs one input, query, and returns suggested search phrases plus matching subreddits.

Use cases

  • Build a search box for a custom Reddit client that shows suggestions as the user types.
  • Find subreddits that match a brand or topic name, such as the communities that appear for OpenAI.
  • Collect the phrases Reddit suggests for a keyword to find related search terms.
  • Resolve a topic to a subreddit ID and URL path before calling a subreddit API.

Request

curl -X POST "https://api.sandbase.ai/v1/api/reddit/app/search-typeahead" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "OpenAI"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
querystringYesSearch keyword, the search text being typed
allow_nsfwstringNoWhether to allow NSFW (adult) content display, "0" means disallow, "1" means allow
need_formatbooleanNoWhether to clean and format the data
safe_searchstringNoSafe search setting, options are "unset" or "strict"

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "search": {
    "dynamic": {
      "components": {
        "__typename": "TypeaheadLayout",
        "main": [
          {
            "__typename": "SearchTypeaheadList",
            "behaviors": {
              "collapse": null,
              "expand": null,
              "expandCta": null
            },
            "children": [
              {
                "__typename": "QueryAutocomplete",
                "behaviors": {
                  "default": {
                    "__typename": "SearchQueryReformulationBehavior",
                    "query": "openai",
                    "telemetry": {
                      "__typename": "SearchElementTelemetry",
                      "events": [
                        {
                          "action": "click",
                          "noun": "typeahead",
                          "source": "search",
                          "trigger": "CLICK",
                          "triggerConfiguration": null
                        }
                      ],
                      "trackingContext": {
                        "__typename": "SearchTelemetryTrackingContext",
                        "actionInfo": {
                          "paneName": null,
                          "position": 0,
                          "reason": null,
                          "relativePosition": 0,
                          "type": "query_suggestion"
                        },
                        "answers": null,
                        "metaSearch": {
                          "displayQuery": "openai",
                          "rawQuery": "openai"
                        },
                        "post": null,
                        "profile": null,
                        "search": {
                          "isNsfw": false,
                          "query": "OpenAI",
                          "queryID": "f2458504-7cda-400f-abc7-324fd62e4f9f",
                          "range": null,
                          "safeSearch": "UNAVAILABLE",
                          "scope": {
                            "id": null,
                            "name": null,
                            "path": "/",
                            "type": "GLOBAL"
                          },
                          "snippet": null,
                          "snippetId": null
                        },
                        "subreddit": null
                      }
                    }
                  }
                },
                "presentation": {
                  "__typename": "QueryAutocompleteDefaultPresentation",
                  "query": "openai",
                  "suggestion": "%query%"
                },
                "telemetry": {
                  "__typename": "SearchElementTelemetry",
                  "events": [
                    {
                      "action": "view",
                      "noun": "typeahead",
                      "source": "search",
                      "trigger": "VIEW",
                      "triggerConfiguration": null
                    }
                  ],
                  "trackingContext": {
                    "__typename": "SearchTelemetryTrackingContext",
                    "actionInfo": {
                      "paneName": null,
                      "position": 0,
                      "reason": null,
                      "relativePosition": 0,
                      "type": "query_suggestion"
                    },
                    "answers": null,
                    "metaSearch": {
                      "displayQuery": "openai",
                      "rawQuery": "openai"
                    },
                    "post": null,
                    "profile": null,
                    "search": {
                      "isNsfw": false,
                      "query": "OpenAI",
                      "queryID": "f2458504-7cda-400f-abc7-324fd62e4f9f",
                      "range": null,
                      "safeSearch": "UNAVAILABLE",
                      "scope": {
                        "id": null,
                        "name": null,
                        "path": "/",
                        "type": "GLOBAL"
                      },
                      "snippet": null,
                      "snippetId": null
                    },
                    "subreddit": null
                  }
                }
              }
            ],
            "id": "section_0_pipeline_1_query_autocomplete",
            "presentation": {
              "__typename": "SearchTypeaheadListDefaultPresentation",
              "title": ""
            }
          }
        ]
      }
    }
  }
}

Response fields

FieldMeaning
search.dynamic.components.main[]Sections of the typeahead list. One section holds query suggestions (QueryAutocomplete) and another holds subreddit suggestions (TypeaheadSuggestion).
search.dynamic.components.main[].children[].__typenameType of each suggestion. QueryAutocomplete is a search phrase and TypeaheadSuggestion is a community result.
search.dynamic.components.main[].children[].behaviors.default.queryThe full search phrase to run if the user picks this suggestion. Present on query suggestions.
search.dynamic.components.main[].children[].presentation.suggestionDisplay template for a query suggestion. The %query% token stands for the typed text.
search.dynamic.components.main[].children[].behaviors.default.id / search.dynamic.components.main[].children[].behaviors.default.nameID and name of the suggested subreddit, for example t5_7hqomg and ChatGPT.
search.dynamic.components.main[].children[].behaviors.default.urlRelative path of the suggested subreddit, for example /r/ChatGPT/.
search.dynamic.components.main[].children[].presentation.nameDisplay name of the suggested subreddit, for example r/ChatGPT.
search.dynamic.components.main[].children[].presentation.description / search.dynamic.components.main[].children[].presentation.iconShort description text and icon image URL for a subreddit suggestion.
search.dynamic.components.main[].children[].telemetry.trackingContext.actionInfo.positionZero-based position of the suggestion in its list. type in the same object shows the kind, such as query_suggestion or subreddit.
search.dynamic.components.main[].children[].telemetry.trackingContext.search.queryIDUUID that identifies this typeahead request. All suggestions in one response share it.

Notes

  • Pass the text typed so far in query. The search query is echoed back inside the tracking context.
  • allow_nsfw takes "0" or "1", and safe_search takes "unset" or "strict".
  • Subreddit IDs use the t5_ prefix. Use them with Reddit App Subreddit Info or Reddit Community Highlights.
  • To run the full search for a chosen phrase, call Reddit Search.

Pricing

$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

探索更多

相关 APIs

全部 APIs
API价格响应
Reddit$0.001 每次调用JSON
Reddit$0.001 每次调用JSON
Reddit$0.001 每次调用JSON
Reddit$0.001 每次调用JSON
Reddit$0.001 每次调用JSON
Reddit$0.001 每次调用JSON

指南:Best Reddit API in 2026: Pricing Compared

问题

常见问题

如何使用 Reddit App Search Typeahead API?

向 https://api.sandbase.ai/v1/api/reddit/app/search-typeahead 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

Reddit App Search Typeahead API 的价格是多少?

每次调用 $0.001,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

Reddit App Search Typeahead API 接受哪些参数?

必填:query (string)。 可选:allow_nsfw (string), need_format (boolean) 和 safe_search (string)。 Parameters 表和本页的 Playground 列出了每个字段。

Reddit App Search Typeahead API 返回什么?

在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。

我需要 Reddit 开发者账户或 API key 吗?

不需要。Reddit App Search Typeahead 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Reddit API 访问权限。