RedditapisRedditapis
Search by Type

Search Reddit by Comment Text

Search Reddit by comment text. Reddit matches your keyword against comments and returns the parent posts, surfacing threads plain title search misses.

GET/api/reddit/search/comments$0.002 / call

Search Reddit by comment text. This surfaces threads where your keyword appears in the replies, which a plain post-title search would miss.

How it works (read this first)

Reddit's comment search is a search mode, not a result type. It matches your query against comment bodies but returns the parent posts (the threads), not the individual comment objects. Reddit does not tell us which comment matched or expose its text.

So each result is a post whose discussion mentions your query, carrying the post's title, selftext, score, and comment count. A result may not contain the query in the post itself when the match is inside one of its comments, which is the point of this endpoint.

To get the matching comments themselves (body, score, author) in one call, use GET /api/reddit/search/comments/deep, which does the thread-fetch and comment-filtering for you. Or to read one specific thread, take a result's url and fetch it with GET /api/reddit/comments.

Query Parameters

ParameterTypeRequiredDescription
qstringYesSearch query. Supports Reddit search syntax.
sortstringNorelevance (default), hot, top, new, comments
tstringNoTime window: hour, day, week, month, year, all. Applies to relevance and top; defaults to all when omitted, so a broad relevance query can surface old high-upvote threads.
nsfwbooleanNotrue to include NSFW results
limitnumberNoNumber of results to return, 1-100 (default 25)
afterstringNoPagination cursor. Pass back the after value from the previous response exactly as issued; it is opaque and carries your paging depth. See Pagination depth.

Example

curl -H "Authorization: Bearer $TOKEN" \
  "https://api.redditapis.com/api/reddit/search/comments?q=best%20mechanical%20keyboard&sort=top&t=year"
const response = await fetch(
  "https://api.redditapis.com/api/reddit/search/comments?q=best%20mechanical%20keyboard&sort=top",
  { headers: { Authorization: "Bearer TOKEN" } }
);
import requests

response = requests.get(
    "https://api.redditapis.com/api/reddit/search/comments",
    params={"q": "best mechanical keyboard", "sort": "top"},
    headers={"Authorization": "Bearer TOKEN"},
)

Response Shape

{
  "comments": [
    {
      "id": "1qtho3t",
      "title": "New to mechanical keyboards - what's the best one to get?",
      "author": "Small-Ad-2708",
      "subreddit": "MechKeyboards",
      "upvotes": 6,
      "num_comments": 74,
      "selftext": "Hey all, I'm pretty new to mechanical keyboards...",
      "url": "https://reddit.com/r/MechKeyboards/comments/1qtho3t/new_to_mechanical_keyboards/",
      "link_url": "https://www.reddit.com/r/MechKeyboards/comments/1qtho3t/new_to_mechanical_keyboards/",
      "created": "2026-02-02T01:47:30.000Z"
    }
  ],
  "after": "t3_1qtho3t"
}

The comments key is kept for backwards compatibility with existing integrations. Its value has always been posts; the field names above reflect that.

Response Fields

FieldTypeNotes
idstringPost id (without the t3_ prefix)
titlestringPost title
authorstringPost author (no u/ prefix)
subredditstringSubreddit name (no r/ prefix)
upvotesnumberPost score
num_commentsnumberNumber of comments on the post
selftextstring | nullPost body text, or null for link posts
urlstringFull reddit.com URL of the thread
link_urlstring | nullThe post's outbound link, or the thread URL for self posts
createdstringISO-8601 timestamp of the post
afterstring | nullCursor for the next page, or null when there is no next page to request. An empty cursor does not always mean you have every item, so read listing_status (below) to find out which. See Pagination depth.

When after comes back empty

An empty cursor means there is no next page to ask for. It does not always mean you have every post: Reddit often stops serving a busy listing long before it runs out. Paging r/all on 2026-08-14 stopped after 400 posts covering about a minute of a feed that plainly holds more.

The response tells you which happened. When after is null it also carries listing_status, which reads complete, truncated or unknown. Only complete means you have everything; treat the other two as a partial answer and widen your search rather than stopping. The full field list and what to do about each answer is in Pagination depth.

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

On this page