RedditapisRedditapis
Search by Type

Reddit Typeahead API for Subreddit and Post Autocomplete

Search-as-you-type for Reddit. Send the prefix a user has typed and get a short ranked list of subreddit suggestions, or of posts in one subreddit whose titles match.

GET/api/reddit/typeahead$0.0015 / call

Search-as-you-type suggestions for an autocomplete box. Send the prefix the user has typed so far and get back one short, ranked list.

  • Without sub: subreddit suggestions for the prefix (name, title, icon, subscriber count, NSFW flag).
  • With sub: posts inside that subreddit whose titles match the prefix.

No Reddit login is needed for either mode.

Query Parameters

ParameterTypeRequiredDescription
qstringYesThe prefix typed so far, 1-100 characters. Without sub, a leading r/ is ignored, so r/pyth and pyth give the same answer.
substringNoSubreddit name, no r/ prefix. Present: suggest posts in this subreddit by title. Absent: suggest subreddits.
limitnumberNoSuggestions to return, default 8. Values outside 1-20 are clamped to that range; a value that is not a whole number is a 400.
nsfwbooleanNotrue to include NSFW results

There is no after cursor: a typeahead returns one short list per keystroke. For deeper results use Search Communities or Search with subreddit.

How results are ranked

Reddit's own community search is not a prefix match: on 2026-10-19 the query pyth returned r/Python, r/pythontips and then r/GlobalOffensive. A typeahead should not suggest r/GlobalOffensive for "pyth", so every row is placed in one of three buckets and carries it in match:

matchSubreddits modePosts mode
prefixThe name starts with qA word in the title starts with q
containsThe name or title contains qThe title contains q
relatedReddit matched it on something else (often the description)Reddit matched it on something else

Within prefix and contains, subreddits are ordered by subscriber count, so the community a user most likely means comes first. Posts keep Reddit's relevance order inside each bucket. Rows are never dropped for being related; filter on match if your UI wants only strict matches.

Posts mode searches titles with Reddit's title: operator, which matches whole words. Expect the strongest results once the user has typed at least one full word.

Errors

StatusWhen
400q missing, empty or longer than 100 characters (field: "q")
400limit is not a whole number (field: "limit")
400sub is not a subreddit name: letters, digits or underscore, 1-21 characters (field: "sub")

Example

# subreddit suggestions
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.redditapis.com/api/reddit/typeahead?q=pyth&limit=5"

# post suggestions inside r/Python
curl -H "Authorization: Bearer $TOKEN" \
  "https://api.redditapis.com/api/reddit/typeahead?q=async&sub=Python"
const response = await fetch(
  "https://api.redditapis.com/api/reddit/typeahead?q=pyth&limit=5",
  { headers: { Authorization: "Bearer TOKEN" } }
);
const { subreddits } = await response.json();
import requests

response = requests.get(
    "https://api.redditapis.com/api/reddit/typeahead",
    params={"q": "async", "sub": "Python"},
    headers={"Authorization": "Bearer TOKEN"},
)
posts = response.json()["posts"]

Response Shape: subreddits

{
  "kind": "subreddits",
  "q": "pyth",
  "limit": 5,
  "subreddits": [
    {
      "name": "Python",
      "display_name_prefixed": "r/Python",
      "title": "Python",
      "icon_url": "https://styles.redditmedia.com/t5_2qh0y/styles/communityIcon_....png",
      "subscribers": 1518356,
      "over_18": false,
      "url": "https://www.reddit.com/r/Python/",
      "match": "prefix"
    }
  ]
}
FieldTypeNotes
namestringSubreddit name, no r/ prefix
display_name_prefixedstringe.g. r/Python
titlestring | nullThe community's display title
icon_urlstring | nullCommunity icon, or the legacy icon when no community icon is set
subscribersnumber | nullMember count
over_18booleanNSFW flag
urlstringFull reddit.com URL
matchstringprefix, contains or related (see ranking above)

Response Shape: posts

{
  "kind": "posts",
  "q": "async",
  "sub": "Python",
  "limit": 8,
  "posts": [
    {
      "id": "1uisy46",
      "fullname": "t3_1uisy46",
      "title": "Async/Await is a Plague: Part 1 Roots",
      "permalink": "/r/Python/comments/1uisy46/asyncawait_is_a_plague_part_1_roots/",
      "url": "https://www.reddit.com/r/Python/comments/1uisy46/asyncawait_is_a_plague_part_1_roots/",
      "subreddit": "Python",
      "score": 72,
      "num_comments": 71,
      "over_18": false,
      "created_utc": 1782740712,
      "created": "2026-06-29T13:45:12.000Z",
      "match": "prefix"
    }
  ]
}
FieldTypeNotes
idstringPost id without prefix
fullnamestringt3_ prefixed id
titlestringPost title
permalinkstring | nullPath on reddit.com
urlstring | nullFull reddit.com URL of the post
subredditstring | nullSubreddit the post lives in
scorenumber | nullNet score
num_commentsnumber | nullComment count
over_18booleanNSFW flag
created_utcnumber | nullUnix epoch seconds
createdstring | nullISO-8601 of created_utc
matchstringprefix, contains or related (see ranking above)

An empty list is a real answer: nothing on Reddit matched the prefix yet.

Independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by Reddit, Inc.

On this page