100 free credits. No credit card required. Get a key

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 failure
import 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

NameTypeDescription
qquery · requiredstringSearch query. Example: pyth.
subredditquerystringOnly this subreddit. Example: typescript.
limitqueryintegerSuggestions, 1 to 20. Default 8.
Response fields

200 with a Typeahead, in Reddit’s own Things and Listings.

FieldTypeDescription
queriesstring[]
subredditsSubreddit[]
postsLink[]With subreddit: posts whose titles match.
Status codes
StatusMeaning
200The suggestions.
400Invalid input. Nothing was charged.
401Missing or invalid API key.
402Not enough credits, a spend cap was reached, or payment is required.
403The target is private, or the account is suspended.
404The subreddit, post or user does not exist.
429Too many requests. Wait for Retry-After seconds.
503Reddit 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.