> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keyapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Reddit APP Search Typeahead Suggestions

> Get search typeahead suggestions from the Reddit APP search box, including recommended subreddits, users, and search terms

<div className="inline-flex items-center gap-2 px-4 py-2 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg">
  <span className="text-base">🪙</span>
  <span className="text-sm font-medium text-yellow-900 dark:text-yellow-100"><span className="font-semibold">1 credit</span><span className="text-yellow-700 dark:text-yellow-300 ml-1">per request</span></span>
</div>

## Copy for AI

<div className="my-6 rounded-xl border border-gray-200 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-900/40">
  <div className="min-w-0">
    <p className="text-base font-semibold text-gray-900 dark:text-gray-100">🤖 Why Code When AI Can Do It For You?</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">Stop writing code like it's 1970! Let AI do the heavy lifting - click the sparkles to copy a perfectly formatted prompt for ChatGPT, Claude, or your favorite AI assistant.</p>
  </div>

  <div className="mt-4">
    <button
      type="button"
      className="inline-flex items-center gap-2 rounded-md border border-emerald-300 bg-emerald-50 px-3 py-2 text-sm font-medium text-emerald-800 hover:bg-emerald-100 dark:border-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-100 dark:hover:bg-emerald-900/50"
      onClick={() => navigator.clipboard.writeText(`I want to make an API call to https://api.keyapi.ai/v1/reddit/fetch_search_typeahead.

Please help me write code to make this API call and handle the response appropriately. Include error handling and best practices.

Here are the details:

Endpoint: GET https://api.keyapi.ai/v1/reddit/fetch_search_typeahead

Description: Get search typeahead suggestions from the Reddit APP search box, including recommended subreddits, users, and search terms

Required Headers:
--header 'Authorization: Bearer <YOUR_API_KEY>'

Parameters:
- query (Required): Search keyword. Example: programming
- safe_search (Optional): Safe search setting, default is unset
Options: unset, strict. Example: unset
- allow_nsfw (Optional): Whether to allow NSFW (adult) content, default is 0
Options: "0" = not allowed, "1" = allowed. Example: 0
- need_format (Optional): Whether to clean/sanitize the data. Example: false

Example Response:
{
"code": 0,
"message": "success",
"data": {
"search": {
  "dynamic": {
    "components": {
      "__typename": "TypeaheadLayout",
      "main": [
        {
          "__typename": "SearchTypeaheadList",
          "id": "section_0_pipeline_2_query_autocomplete",
          "presentation": {
            "__typename": "SearchTypeaheadListDefaultPresentation",
            "title": ""
          },
          "behaviors": {
            "collapse": null,
            "expand": null,
            "expandCta": null
          },
          "children": [
            {
              "__typename": "QueryAutocomplete",
              "behaviors": {
                "default": {
                  "__typename": "SearchQueryReformulationBehavior",
                  "query": "programming language",
                  "telemetry": {
                    "__typename": "SearchElementTelemetry",
                    "trackingContext": {
                      "__typename": "SearchTelemetryTrackingContext",
                      "search": {
                        "isNsfw": false,
                        "range": null,
                        "safeSearch": "UNAVAILABLE",
                        "scope": {
                          "id": null,
                          "name": null,
                          "path": "/",
                          "type": "GL
... (truncated)`)}
    >
      <span>✨</span>
      <span>Copy for AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml en/reddit.openapi.json GET /v1/reddit/fetch_search_typeahead
openapi: 3.0.1
info:
  title: Reddit API english documentation
  description: >-
    The english reference documentation of the Reddit API includes the
    interface's purpose, parameter description, response status, and sample
    structure.
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production
security:
  - JWT Bearer: []
tags: []
paths:
  /v1/reddit/fetch_search_typeahead:
    get:
      tags: []
      summary: Fetch Reddit APP Search Typeahead Suggestions
      description: >-
        Get search typeahead suggestions from the Reddit APP search box,
        including recommended subreddits, users, and search terms
      parameters:
        - name: query
          in: query
          description: Search keyword
          required: true
          example: programming
          schema:
            type: string
        - name: safe_search
          in: query
          description: |-
            Safe search setting, default is unset
            Options: unset, strict
          required: false
          example: unset
          schema:
            type: string
            default: unset
        - name: allow_nsfw
          in: query
          description: |-
            Whether to allow NSFW (adult) content, default is 0
            Options: "0" = not allowed, "1" = allowed
          required: false
          example: '0'
          schema:
            type: string
            default: '0'
        - name: need_format
          in: query
          description: Whether to clean/sanitize the data
          required: false
          example: 'false'
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  search:
                    dynamic:
                      components:
                        __typename: TypeaheadLayout
                        main:
                          - __typename: SearchTypeaheadList
                            id: section_0_pipeline_2_query_autocomplete
                            presentation:
                              __typename: SearchTypeaheadListDefaultPresentation
                              title: ''
                            behaviors:
                              collapse: null
                              expand: null
                              expandCta: null
                            children:
                              - __typename: QueryAutocomplete
                                behaviors:
                                  default:
                                    __typename: SearchQueryReformulationBehavior
                                    query: programming language
                                    telemetry:
                                      __typename: SearchElementTelemetry
                                      trackingContext:
                                        __typename: SearchTelemetryTrackingContext
                                        search:
                                          isNsfw: false
                                          range: null
                                          safeSearch: UNAVAILABLE
                                          scope:
                                            id: null
                                            name: null
                                            path: /
                                            type: GLOBAL
                                          snippet: null
                                          snippetId: null
                                          sort: null
                                          query: programming
                                          queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                        actionInfo:
                                          paneName: null
                                          position: 0
                                          reason: null
                                          type: query_suggestion
                                          relativePosition: 0
                                        post: null
                                        subreddit: null
                                        metaSearch:
                                          displayQuery: programming language
                                          rawQuery: programming language
                                        profile: null
                                        answers: null
                                      events:
                                        - source: search
                                          action: click
                                          noun: typeahead
                                          trigger: CLICK
                                          triggerConfiguration: null
                                presentation:
                                  __typename: QueryAutocompleteDefaultPresentation
                                  query: programming
                                  suggestion: '%query% language'
                                telemetry:
                                  __typename: SearchElementTelemetry
                                  trackingContext:
                                    __typename: SearchTelemetryTrackingContext
                                    search:
                                      isNsfw: false
                                      range: null
                                      safeSearch: UNAVAILABLE
                                      scope:
                                        id: null
                                        name: null
                                        path: /
                                        type: GLOBAL
                                      snippet: null
                                      snippetId: null
                                      sort: null
                                      query: programming
                                      queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                    actionInfo:
                                      paneName: null
                                      position: 0
                                      reason: null
                                      type: query_suggestion
                                      relativePosition: 0
                                    post: null
                                    subreddit: null
                                    metaSearch:
                                      displayQuery: programming language
                                      rawQuery: programming language
                                    profile: null
                                    answers: null
                                  events:
                                    - source: search
                                      action: view
                                      noun: typeahead
                                      trigger: VIEW
                                      triggerConfiguration: null
                              - __typename: QueryAutocomplete
                                behaviors:
                                  default:
                                    __typename: SearchQueryReformulationBehavior
                                    query: programminghumor
                                    telemetry:
                                      __typename: SearchElementTelemetry
                                      trackingContext:
                                        __typename: SearchTelemetryTrackingContext
                                        search:
                                          isNsfw: false
                                          range: null
                                          safeSearch: UNAVAILABLE
                                          scope:
                                            id: null
                                            name: null
                                            path: /
                                            type: GLOBAL
                                          snippet: null
                                          snippetId: null
                                          sort: null
                                          query: programming
                                          queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                        actionInfo:
                                          paneName: null
                                          position: 1
                                          reason: null
                                          type: query_suggestion
                                          relativePosition: 1
                                        post: null
                                        subreddit: null
                                        metaSearch:
                                          displayQuery: programminghumor
                                          rawQuery: programminghumor
                                        profile: null
                                        answers: null
                                      events:
                                        - source: search
                                          action: click
                                          noun: typeahead
                                          trigger: CLICK
                                          triggerConfiguration: null
                                presentation:
                                  __typename: QueryAutocompleteDefaultPresentation
                                  query: programming
                                  suggestion: '%query%humor'
                                telemetry:
                                  __typename: SearchElementTelemetry
                                  trackingContext:
                                    __typename: SearchTelemetryTrackingContext
                                    search:
                                      isNsfw: false
                                      range: null
                                      safeSearch: UNAVAILABLE
                                      scope:
                                        id: null
                                        name: null
                                        path: /
                                        type: GLOBAL
                                      snippet: null
                                      snippetId: null
                                      sort: null
                                      query: programming
                                      queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                    actionInfo:
                                      paneName: null
                                      position: 1
                                      reason: null
                                      type: query_suggestion
                                      relativePosition: 1
                                    post: null
                                    subreddit: null
                                    metaSearch:
                                      displayQuery: programminghumor
                                      rawQuery: programminghumor
                                    profile: null
                                    answers: null
                                  events:
                                    - source: search
                                      action: view
                                      noun: typeahead
                                      trigger: VIEW
                                      triggerConfiguration: null
                              - __typename: QueryAutocomplete
                                behaviors:
                                  default:
                                    __typename: SearchQueryReformulationBehavior
                                    query: programming jobs
                                    telemetry:
                                      __typename: SearchElementTelemetry
                                      trackingContext:
                                        __typename: SearchTelemetryTrackingContext
                                        search:
                                          isNsfw: false
                                          range: null
                                          safeSearch: UNAVAILABLE
                                          scope:
                                            id: null
                                            name: null
                                            path: /
                                            type: GLOBAL
                                          snippet: null
                                          snippetId: null
                                          sort: null
                                          query: programming
                                          queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                        actionInfo:
                                          paneName: null
                                          position: 2
                                          reason: null
                                          type: query_suggestion
                                          relativePosition: 2
                                        post: null
                                        subreddit: null
                                        metaSearch:
                                          displayQuery: programming jobs
                                          rawQuery: programming jobs
                                        profile: null
                                        answers: null
                                      events:
                                        - source: search
                                          action: click
                                          noun: typeahead
                                          trigger: CLICK
                                          triggerConfiguration: null
                                presentation:
                                  __typename: QueryAutocompleteDefaultPresentation
                                  query: programming
                                  suggestion: '%query% jobs'
                                telemetry:
                                  __typename: SearchElementTelemetry
                                  trackingContext:
                                    __typename: SearchTelemetryTrackingContext
                                    search:
                                      isNsfw: false
                                      range: null
                                      safeSearch: UNAVAILABLE
                                      scope:
                                        id: null
                                        name: null
                                        path: /
                                        type: GLOBAL
                                      snippet: null
                                      snippetId: null
                                      sort: null
                                      query: programming
                                      queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                    actionInfo:
                                      paneName: null
                                      position: 2
                                      reason: null
                                      type: query_suggestion
                                      relativePosition: 2
                                    post: null
                                    subreddit: null
                                    metaSearch:
                                      displayQuery: programming jobs
                                      rawQuery: programming jobs
                                    profile: null
                                    answers: null
                                  events:
                                    - source: search
                                      action: view
                                      noun: typeahead
                                      trigger: VIEW
                                      triggerConfiguration: null
                              - __typename: QueryAutocomplete
                                behaviors:
                                  default:
                                    __typename: SearchQueryReformulationBehavior
                                    query: programming hungary
                                    telemetry:
                                      __typename: SearchElementTelemetry
                                      trackingContext:
                                        __typename: SearchTelemetryTrackingContext
                                        search:
                                          isNsfw: false
                                          range: null
                                          safeSearch: UNAVAILABLE
                                          scope:
                                            id: null
                                            name: null
                                            path: /
                                            type: GLOBAL
                                          snippet: null
                                          snippetId: null
                                          sort: null
                                          query: programming
                                          queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                        actionInfo:
                                          paneName: null
                                          position: 3
                                          reason: null
                                          type: query_suggestion
                                          relativePosition: 3
                                        post: null
                                        subreddit: null
                                        metaSearch:
                                          displayQuery: programming hungary
                                          rawQuery: programming hungary
                                        profile: null
                                        answers: null
                                      events:
                                        - source: search
                                          action: click
                                          noun: typeahead
                                          trigger: CLICK
                                          triggerConfiguration: null
                                presentation:
                                  __typename: QueryAutocompleteDefaultPresentation
                                  query: programming
                                  suggestion: '%query% hungary'
                                telemetry:
                                  __typename: SearchElementTelemetry
                                  trackingContext:
                                    __typename: SearchTelemetryTrackingContext
                                    search:
                                      isNsfw: false
                                      range: null
                                      safeSearch: UNAVAILABLE
                                      scope:
                                        id: null
                                        name: null
                                        path: /
                                        type: GLOBAL
                                      snippet: null
                                      snippetId: null
                                      sort: null
                                      query: programming
                                      queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                    actionInfo:
                                      paneName: null
                                      position: 3
                                      reason: null
                                      type: query_suggestion
                                      relativePosition: 3
                                    post: null
                                    subreddit: null
                                    metaSearch:
                                      displayQuery: programming hungary
                                      rawQuery: programming hungary
                                    profile: null
                                    answers: null
                                  events:
                                    - source: search
                                      action: view
                                      noun: typeahead
                                      trigger: VIEW
                                      triggerConfiguration: null
                          - __typename: SearchTypeaheadList
                            id: subreddit_typeahead_section
                            presentation:
                              __typename: SearchTypeaheadListDefaultPresentation
                              title: 社区
                            behaviors:
                              collapse: null
                              expand: null
                              expandCta: null
                            children:
                              - __typename: TypeaheadSuggestion
                                behaviors:
                                  default:
                                    __typename: SearchCommunityNavigationBehavior
                                    id: t5_2fwo
                                    name: programming
                                    url: /r/programming/
                                    telemetry:
                                      __typename: SearchElementTelemetry
                                      trackingContext:
                                        __typename: SearchTelemetryTrackingContext
                                        search:
                                          isNsfw: false
                                          range: null
                                          safeSearch: UNAVAILABLE
                                          scope:
                                            id: null
                                            name: null
                                            path: /
                                            type: GLOBAL
                                          snippet: null
                                          snippetId: null
                                          sort: null
                                          query: programming
                                          queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                        actionInfo:
                                          paneName: null
                                          position: 0
                                          reason: null
                                          type: subreddit
                                          relativePosition: 4
                                        post: null
                                        subreddit:
                                          id: t5_2fwo
                                          isNsfw: false
                                          isQuarantined: false
                                          name: programming
                                        metaSearch: null
                                        profile: null
                                        answers: null
                                      events:
                                        - source: search
                                          action: click
                                          noun: typeahead
                                          trigger: CLICK
                                          triggerConfiguration: null
                                presentation:
                                  __typename: TypeaheadSuggestionDefaultPresentation
                                  description: 每周 397K 个访客
                                  displayTags: []
                                  icon: >-
                                    https://styles.redditmedia.com/t5_2fwo/styles/communityIcon_1bqa1ibfp8q11.png
                                  name: r/programming
                                telemetry:
                                  __typename: SearchElementTelemetry
                                  trackingContext:
                                    __typename: SearchTelemetryTrackingContext
                                    search:
                                      isNsfw: false
                                      range: null
                                      safeSearch: UNAVAILABLE
                                      scope:
                                        id: null
                                        name: null
                                        path: /
                                        type: GLOBAL
                                      snippet: null
                                      snippetId: null
                                      sort: null
                                      query: programming
                                      queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                    actionInfo:
                                      paneName: null
                                      position: 0
                                      reason: null
                                      type: subreddit
                                      relativePosition: 4
                                    post: null
                                    subreddit:
                                      id: t5_2fwo
                                      isNsfw: false
                                      isQuarantined: false
                                      name: programming
                                    metaSearch: null
                                    profile: null
                                    answers: null
                                  events:
                                    - source: search
                                      action: view
                                      noun: typeahead
                                      trigger: VIEW
                                      triggerConfiguration: null
                              - __typename: TypeaheadSuggestion
                                behaviors:
                                  default:
                                    __typename: SearchCommunityNavigationBehavior
                                    id: t5_2r7yd
                                    name: learnprogramming
                                    url: /r/learnprogramming/
                                    telemetry:
                                      __typename: SearchElementTelemetry
                                      trackingContext:
                                        __typename: SearchTelemetryTrackingContext
                                        search:
                                          isNsfw: false
                                          range: null
                                          safeSearch: UNAVAILABLE
                                          scope:
                                            id: null
                                            name: null
                                            path: /
                                            type: GLOBAL
                                          snippet: null
                                          snippetId: null
                                          sort: null
                                          query: programming
                                          queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                        actionInfo:
                                          paneName: null
                                          position: 1
                                          reason: null
                                          type: subreddit
                                          relativePosition: 5
                                        post: null
                                        subreddit:
                                          id: t5_2r7yd
                                          isNsfw: false
                                          isQuarantined: false
                                          name: learnprogramming
                                        metaSearch: null
                                        profile: null
                                        answers: null
                                      events:
                                        - source: search
                                          action: click
                                          noun: typeahead
                                          trigger: CLICK
                                          triggerConfiguration: null
                                presentation:
                                  __typename: TypeaheadSuggestionDefaultPresentation
                                  description: 每周 664K 个访客
                                  displayTags: []
                                  icon: ''
                                  name: r/learnprogramming
                                telemetry:
                                  __typename: SearchElementTelemetry
                                  trackingContext:
                                    __typename: SearchTelemetryTrackingContext
                                    search:
                                      isNsfw: false
                                      range: null
                                      safeSearch: UNAVAILABLE
                                      scope:
                                        id: null
                                        name: null
                                        path: /
                                        type: GLOBAL
                                      snippet: null
                                      snippetId: null
                                      sort: null
                                      query: programming
                                      queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                    actionInfo:
                                      paneName: null
                                      position: 1
                                      reason: null
                                      type: subreddit
                                      relativePosition: 5
                                    post: null
                                    subreddit:
                                      id: t5_2r7yd
                                      isNsfw: false
                                      isQuarantined: false
                                      name: learnprogramming
                                    metaSearch: null
                                    profile: null
                                    answers: null
                                  events:
                                    - source: search
                                      action: view
                                      noun: typeahead
                                      trigger: VIEW
                                      triggerConfiguration: null
                              - __typename: TypeaheadSuggestion
                                behaviors:
                                  default:
                                    __typename: SearchCommunityNavigationBehavior
                                    id: t5_2seko
                                    name: AskProgramming
                                    url: /r/AskProgramming/
                                    telemetry:
                                      __typename: SearchElementTelemetry
                                      trackingContext:
                                        __typename: SearchTelemetryTrackingContext
                                        search:
                                          isNsfw: false
                                          range: null
                                          safeSearch: UNAVAILABLE
                                          scope:
                                            id: null
                                            name: null
                                            path: /
                                            type: GLOBAL
                                          snippet: null
                                          snippetId: null
                                          sort: null
                                          query: programming
                                          queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                        actionInfo:
                                          paneName: null
                                          position: 2
                                          reason: null
                                          type: subreddit
                                          relativePosition: 6
                                        post: null
                                        subreddit:
                                          id: t5_2seko
                                          isNsfw: false
                                          isQuarantined: false
                                          name: AskProgramming
                                        metaSearch: null
                                        profile: null
                                        answers: null
                                      events:
                                        - source: search
                                          action: click
                                          noun: typeahead
                                          trigger: CLICK
                                          triggerConfiguration: null
                                presentation:
                                  __typename: TypeaheadSuggestionDefaultPresentation
                                  description: 每周 124K 个访客
                                  displayTags: []
                                  icon: >-
                                    https://b.thumbs.redditmedia.com/IMuq3QpuUwXjEjXcDgIGgqOJz2j5ft1g9gEnFTFQPgQ.png
                                  name: r/AskProgramming
                                telemetry:
                                  __typename: SearchElementTelemetry
                                  trackingContext:
                                    __typename: SearchTelemetryTrackingContext
                                    search:
                                      isNsfw: false
                                      range: null
                                      safeSearch: UNAVAILABLE
                                      scope:
                                        id: null
                                        name: null
                                        path: /
                                        type: GLOBAL
                                      snippet: null
                                      snippetId: null
                                      sort: null
                                      query: programming
                                      queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                    actionInfo:
                                      paneName: null
                                      position: 2
                                      reason: null
                                      type: subreddit
                                      relativePosition: 6
                                    post: null
                                    subreddit:
                                      id: t5_2seko
                                      isNsfw: false
                                      isQuarantined: false
                                      name: AskProgramming
                                    metaSearch: null
                                    profile: null
                                    answers: null
                                  events:
                                    - source: search
                                      action: view
                                      noun: typeahead
                                      trigger: VIEW
                                      triggerConfiguration: null
                              - __typename: TypeaheadSuggestion
                                behaviors:
                                  default:
                                    __typename: SearchCommunityNavigationBehavior
                                    id: t5_2qi8m
                                    name: ProgrammingLanguages
                                    url: /r/ProgrammingLanguages/
                                    telemetry:
                                      __typename: SearchElementTelemetry
                                      trackingContext:
                                        __typename: SearchTelemetryTrackingContext
                                        search:
                                          isNsfw: false
                                          range: null
                                          safeSearch: UNAVAILABLE
                                          scope:
                                            id: null
                                            name: null
                                            path: /
                                            type: GLOBAL
                                          snippet: null
                                          snippetId: null
                                          sort: null
                                          query: programming
                                          queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                        actionInfo:
                                          paneName: null
                                          position: 3
                                          reason: null
                                          type: subreddit
                                          relativePosition: 7
                                        post: null
                                        subreddit:
                                          id: t5_2qi8m
                                          isNsfw: false
                                          isQuarantined: false
                                          name: ProgrammingLanguages
                                        metaSearch: null
                                        profile: null
                                        answers: null
                                      events:
                                        - source: search
                                          action: click
                                          noun: typeahead
                                          trigger: CLICK
                                          triggerConfiguration: null
                                presentation:
                                  __typename: TypeaheadSuggestionDefaultPresentation
                                  description: 每周 29K 个访客
                                  displayTags: []
                                  icon: >-
                                    https://b.thumbs.redditmedia.com/kdpwcOKjcwwPBGcNxl3B7b2Ta6_DMnmYeoo8qpvRL4U.png
                                  name: r/ProgrammingLanguages
                                telemetry:
                                  __typename: SearchElementTelemetry
                                  trackingContext:
                                    __typename: SearchTelemetryTrackingContext
                                    search:
                                      isNsfw: false
                                      range: null
                                      safeSearch: UNAVAILABLE
                                      scope:
                                        id: null
                                        name: null
                                        path: /
                                        type: GLOBAL
                                      snippet: null
                                      snippetId: null
                                      sort: null
                                      query: programming
                                      queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                    actionInfo:
                                      paneName: null
                                      position: 3
                                      reason: null
                                      type: subreddit
                                      relativePosition: 7
                                    post: null
                                    subreddit:
                                      id: t5_2qi8m
                                      isNsfw: false
                                      isQuarantined: false
                                      name: ProgrammingLanguages
                                    metaSearch: null
                                    profile: null
                                    answers: null
                                  events:
                                    - source: search
                                      action: view
                                      noun: typeahead
                                      trigger: VIEW
                                      triggerConfiguration: null
                              - __typename: TypeaheadSuggestion
                                behaviors:
                                  default:
                                    __typename: SearchCommunityNavigationBehavior
                                    id: t5_2tj0l
                                    name: programmingmemes
                                    url: /r/programmingmemes/
                                    telemetry:
                                      __typename: SearchElementTelemetry
                                      trackingContext:
                                        __typename: SearchTelemetryTrackingContext
                                        search:
                                          isNsfw: false
                                          range: null
                                          safeSearch: UNAVAILABLE
                                          scope:
                                            id: null
                                            name: null
                                            path: /
                                            type: GLOBAL
                                          snippet: null
                                          snippetId: null
                                          sort: null
                                          query: programming
                                          queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                        actionInfo:
                                          paneName: null
                                          position: 4
                                          reason: null
                                          type: subreddit
                                          relativePosition: 8
                                        post: null
                                        subreddit:
                                          id: t5_2tj0l
                                          isNsfw: false
                                          isQuarantined: false
                                          name: programmingmemes
                                        metaSearch: null
                                        profile: null
                                        answers: null
                                      events:
                                        - source: search
                                          action: click
                                          noun: typeahead
                                          trigger: CLICK
                                          triggerConfiguration: null
                                presentation:
                                  __typename: TypeaheadSuggestionDefaultPresentation
                                  description: 每周 105K 个访客
                                  displayTags: []
                                  icon: >-
                                    https://styles.redditmedia.com/t5_2tj0l/styles/communityIcon_oo7drylo66351.png
                                  name: r/programmingmemes
                                telemetry:
                                  __typename: SearchElementTelemetry
                                  trackingContext:
                                    __typename: SearchTelemetryTrackingContext
                                    search:
                                      isNsfw: false
                                      range: null
                                      safeSearch: UNAVAILABLE
                                      scope:
                                        id: null
                                        name: null
                                        path: /
                                        type: GLOBAL
                                      snippet: null
                                      snippetId: null
                                      sort: null
                                      query: programming
                                      queryID: 61573d51-cf44-4d4f-8113-73513216a6cc
                                    actionInfo:
                                      paneName: null
                                      position: 4
                                      reason: null
                                      type: subreddit
                                      relativePosition: 8
                                    post: null
                                    subreddit:
                                      id: t5_2tj0l
                                      isNsfw: false
                                      isQuarantined: false
                                      name: programmingmemes
                                    metaSearch: null
                                    profile: null
                                    answers: null
                                  events:
                                    - source: search
                                      action: view
                                      noun: typeahead
                                      trigger: VIEW
                                      triggerConfiguration: null
                requestId: d8dfc01f-41df-4ffd-bae1-e86ce5114544
          headers: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 400
                  data: null
                  message: 'Missing required parameter: handle'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  data: null
                  message: apiKey is null
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 402
                  data: null
                  message: apiKey quota is not enough
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 429
                  data: null
                  message: qps limit exceeded
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 500
                  data: null
                  message: Internal server error
      deprecated: false
      security:
        - JWT Bearer: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.keyapi.ai/v1/reddit/fetch_search_typeahead?query=programming&safe_search=unset&allow_nsfw=0&need_format=false' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/reddit/fetch_search_typeahead',
                params={"query": "programming", "safe_search": "unset", "allow_nsfw": "0", "need_format": "false"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"query": "programming",
            "safe_search": "unset", "allow_nsfw": "0", "need_format": "false"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/reddit/fetch_search_typeahead?${params}`,
            {
              method: 'GET',
              headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
            });

            const data = await response.json();

            console.log(data);
components:
  securitySchemes:
    JWT Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        API key for authentication. Format: `sk_live_xxxxxxxxxxxxx`
        Get your API key from the [Dashboard](http://keyapi.ai/app/dashboard).

````