# Reddit App Search Typeahead API

> 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.

Source: https://www.sandbase.ai/apis/reddit/app/search-typeahead
API reference: https://www.sandbase.ai/apis/reddit/app/search-typeahead/docs

## Facts

- Provider: Reddit
- Type: Data API
- Endpoint: `POST https://api.sandbase.ai/v1/api/reddit/app/search-typeahead`
- Price: $0.0015 per call
- Free allowance: 100 calls per organization per UTC day, shared across eligible APIs
- Capabilities: api, reddit
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

`POST https://api.sandbase.ai/v1/api/reddit/app/search-typeahead` with `Authorization: Bearer $SANDBASE_API_KEY` and the parameters as a JSON body.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `query` | string | yes |  |
| `allow_nsfw` | string | no |  |
| `need_format` | boolean | no |  |
| `safe_search` | string | no |  |

## FAQ

### How do I use the Reddit App Search Typeahead API?

Send a POST request to https://api.sandbase.ai/v1/api/reddit/app/search-typeahead with your SandBase API key in the Authorization header (Bearer) and the parameters as a JSON body. You can also try it in the Playground on this page without writing code.

### How much does the Reddit App Search Typeahead API cost?

$0.0015 per call. Every organization gets 100 free calls per UTC day, shared across eligible SandBase APIs including this one; after that each call is billed at this price from your SandBase balance. There is no subscription.

### What parameters does the Reddit App Search Typeahead API accept?

Required: query (string). Optional: allow_nsfw (string), need_format (boolean) and safe_search (string). The Parameters table and the Playground on this page list every field.

### What does the Reddit App Search Typeahead API return?

A JSON response returned in the same HTTP request (synchronous). The README on this page includes a sample response.

### Do I need a Reddit developer account or API key?

No. Reddit App Search Typeahead runs through SandBase, so one SandBase API key covers this endpoint and every other API and model in the catalog. You do not need to apply for Reddit API access separately.

## README

### Reddit App Search Typeahead API

Query autocomplete suggestions for search terms using the `query` parameter. You can also configure adult content visibility and safe search behavior.

#### Use cases

- Display real-time search suggestions in custom Reddit clients.
- Help users discover relevant subreddits and search terms as they type.
- Filter autocomplete suggestions according to safe search requirements.

#### Request

```bash
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"}'
```

#### Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `query` | string | Yes | Search keyword, the search text being typed |
| `allow_nsfw` | string | No | Whether to allow NSFW (adult) content display, "0" means disallow, "1" means allow |
| `need_format` | boolean | No | Whether to clean and format the data |
| `safe_search` | string | No | Safe search setting, options are "unset" or "strict" |

#### Example response

Real response for the request above, trimmed to the main fields. User names and long IDs are masked.

```json
{
  "search": {
    "dynamic": {
      "components": {
        "main": [
          {
            "children": [
              {
                "__typename": "QueryAutocomplete",
                "presentation": {
                  "__typename": "QueryAutocompleteDefaultPresentation",
                  "query": "openai"
                },
                "telemetry": {
                  "__typename": "SearchElementTelemetry"
                }
              }
            ]
          }
        ]
      }
    }
  }
}
```

#### Notes

- Set `allow_nsfw` to "1" to include adult content or "0" to exclude it.
- The `safe_search` parameter accepts "unset" or "strict".

#### Related APIs

- [Reddit Subreddit Mute Status](/model/reddit/app/check-subreddit-muted): Checks whether a specified Reddit subreddit is muted by the current account using its ID.
- [Reddit App Comment Replies](/model/reddit/app/comment-replies): Returns replies and nested sub-comments under a Reddit post comment using a continuation cursor.
- [Reddit Community Highlights](/model/reddit/app/community-highlights): Returns featured highlight content for a designated Reddit community, such as popular posts and announcements, by subreddit ID.
