Reddit search autocomplete API
Reddit’s search-as-you-type suggestions for a prefix: query completions and matching communities, or post titles inside one community.
GET /v1/reddit/search/typeahead1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/reddit/search/typeahead?q=pyth",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "queries": [ "python", "python crash course book review", "… 3 more" ], "subreddits": [ { "kind": "t5", "data": { "id": "2qh0y", "name": "t5_2qh0y", "display_name": "Python", "display_name_prefixed": "r/Python", "title": null, "public_description": "", "description": null, "subscribers": null, "active_user_count": null, "created_utc": null, "over18": false, "subreddit_type": null, "url": "/r/Python/", "icon_img": "https://styles.redditmedia.com/t5_2qh0y/styles/communityIcon_lctik80p96tg1.png", "banner_img": null } }, { "kind": "t5", "data": { "id": "2r8ot", "name": "t5_2r8ot", "display_name": "learnpython", "display_name_prefixed": "r/learnpython", "title": null, "public_description": "Beginner Python advice, pandas logic, and scraper design questions", "description": null, "subscribers": null, "active_user_count": null, "created_utc": null, "over18": false, "subreddit_type": null, "url": "/r/learnpython/", "icon_img": "https://styles.redditmedia.com/t5_2r8ot/styles/communityIcon_jwr5s7l5ici61.png", "banner_img": null } }, "… 3 more" ], "posts": []}Parameters
| Name | Type | Description |
|---|---|---|
qquery · required | string | Search query. Example: pyth. |
subredditquery | string | Only this subreddit. Example: typescript. |
limitquery | integer | Suggestions, 1 to 20. Default 8. |
Response fields
200 with a Typeahead, in Reddit’s own Things and Listings.
| Field | Type | Description |
|---|---|---|
queries | string[] | |
subreddits | Subreddit[] | |
posts | Link[] | With subreddit: posts whose titles match. |
Status codes
| Status | Meaning |
|---|---|
200 | The suggestions. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The subreddit, post or user does not exist. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Reddit is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Reddit is a trademark of Reddit, Inc. We are not affiliated with or endorsed by Reddit.