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.
/api/reddit/typeahead$0.0015 / callSearch-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
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | The prefix typed so far, 1-100 characters. Without sub, a leading r/ is ignored, so r/pyth and pyth give the same answer. |
sub | string | No | Subreddit name, no r/ prefix. Present: suggest posts in this subreddit by title. Absent: suggest subreddits. |
limit | number | No | Suggestions to return, default 8. Values outside 1-20 are clamped to that range; a value that is not a whole number is a 400. |
nsfw | boolean | No | true 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:
match | Subreddits mode | Posts mode |
|---|---|---|
prefix | The name starts with q | A word in the title starts with q |
contains | The name or title contains q | The title contains q |
related | Reddit 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
| Status | When |
|---|---|
400 | q missing, empty or longer than 100 characters (field: "q") |
400 | limit is not a whole number (field: "limit") |
400 | sub 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"
}
]
}| Field | Type | Notes |
|---|---|---|
name | string | Subreddit name, no r/ prefix |
display_name_prefixed | string | e.g. r/Python |
title | string | null | The community's display title |
icon_url | string | null | Community icon, or the legacy icon when no community icon is set |
subscribers | number | null | Member count |
over_18 | boolean | NSFW flag |
url | string | Full reddit.com URL |
match | string | prefix, 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"
}
]
}| Field | Type | Notes |
|---|---|---|
id | string | Post id without prefix |
fullname | string | t3_ prefixed id |
title | string | Post title |
permalink | string | null | Path on reddit.com |
url | string | null | Full reddit.com URL of the post |
subreddit | string | null | Subreddit the post lives in |
score | number | null | Net score |
num_comments | number | null | Comment count |
over_18 | boolean | NSFW flag |
created_utc | number | null | Unix epoch seconds |
created | string | null | ISO-8601 of created_utc |
match | string | prefix, 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.
Search Users
Search Reddit accounts by username, the People tab on reddit.com search. Returns karma totals, avatar, account age, and profile blurb, with pagination.
Reddit API LoginNew
Authenticate to Reddit with username and password (plus optional 2FA TOTP) and get the session cookies for comment, vote, and DM calls.
