GET /comment/search

Comment Search

Search comments (site-wide or in one subreddit). Reddit Scraper API endpoint /comment/search: parameters, JSON response fields and code examples.

Comments matching q across Reddit or inside one subreddit: full text, author, score, created time and permalink, plus the post each belongs to and its subreddit. Up to 25 comments per page, paged with next_page_token; with_details=true adds author id, flair, edit time and score / collapse flags to the first 25 comments. Billed 1 request per page read (a date range reads up to max_pages pages), +1 per 100 comments detailed.

HTTP Request

GET /comment/search

Cost (in requests): 1 per page; +1 per 100 comments detailed. Every successful answer reports its cost in data.billed_requests.

Parameters

ParameterTypeRequiredDefaultDescription
qstringYes-Search text. Supported operators: author:spez (comments by one user), subreddit:python, and "exact phrase", for example "ball python" subreddit:snakes. Not supported on comments: -word exclusion and url:. These are ignored or treated as plain words.
subredditstringNo-Restrict to one community (verified scope, echoed in resolved_filters).
page_tokenstringNo-Opaque page token from a previous response’s next_page_token. Omit for the first page.
per_pageintegerNo25Results per page, 1–25 (default 25). One page is billed 1 request.
sortstringNorelevancerelevance (default, not stable between calls), hot, top, new, comments. Allowed: relevance, hot, top, new, comments.
timestringNodefaultNot available here: Reddit’s comment search does not apply a time window, so a window (hour…all) answers 400. For recent comments use sort=new (newest first), or posted_after / posted_before for a date range. default (the default) = no window, the only value accepted here. Allowed: default, hour, day, week, month, year, all.
posted_afterstringNo-Only items created at or after this time: an ISO 8601 date (2026-01-01, the start of that day, UTC), a datetime (2026-01-01T18:00:00Z) or epoch seconds. Reddit has no date filter: the comments are read newest first and filtered, so this reaches about the newest 1,000 comments of a search. With a date range the call reads up to max_pages search pages to find matching comments; every page read is billed; sort=new stops early once past posted_after. For relevant comments from the last week use sort=relevance with time=week (one page, 1 request).
posted_beforestringNo-Only items created at or before this time, same formats as posted_after (a bare date includes that whole day). Must not be earlier than posted_after. With a date range the call reads up to max_pages search pages to find matching comments; every page read is billed; sort=new stops early once past posted_after. For relevant comments from the last week use sort=relevance with time=week (one page, 1 request).
max_pagesintegerNo-Most search pages one call reads to find comments in the posted_after / posted_before range, 1–40 (default 8). With a date range the call reads up to max_pages search pages to find matching comments; every page read is billed; sort=new stops early once past posted_after. For relevant comments from the last week use sort=relevance with time=week (one page, 1 request).
include_nsfwbooleanNotrueDefault true: adult content included; pass false to exclude it (on searches the NSFW posts found are only those inside SFW communities: Reddit keeps its search SFW).
with_detailsbooleanNofalseAdds author_id, edited_at, author_flair (in the comment’s community), is_score_hidden and is_collapsed to the first 25 comments of the page (left out without it). Billed: +1 request per 100 comments detailed.
include_htmlbooleanNofalseAdds body_html (the rendered HTML body) to every post and comment. Default: left out; body_text carries the same text.
translate_tostringNononeReddit’s own machine translation of the returned titles, bodies and snippets into this language (default none: original language). Availability varies by post and page: check is_translated on each row. See the allowed values in the API overview .

Response

Real response to GET /comment/search?q=fastapi&per_page=5 (arrays trimmed to 2 items, long texts cut with …).

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
  "status": true,
  "request_id": "68b77cf0-c18b-881c-2553-eb665dec",
  "data": {
    "results": [
      {
        "comment_id": "t1_19t1yx97ejy3o",
        "parent_id": null,
        "permalink": "/r/cscareerquestions/comments/1y38nbe/did_i_fuck_up_by_wanting_to_be_average/19t1yx97ejy3o/",
        "post_url": "https://www.reddit.com/r/cscareerquestions/comments/1y38nbe/did_i_fuck_up_by_wanting_to_be_average/19t1yx97ejy3o/",
        "author": "joinsigma",
        "score": 22,
        "created_at": "2026-11-23T05:11:30.437000+00:00",
        "subreddit": "cscareerquestions",
        "subreddit_id": "t5_2sdpm",
        "is_subreddit_nsfw": false,
        "is_subreddit_quarantined": false,
        "post_id": "t3_1y38nbe",
        "post_title": "did i fuck up by wanting to be average",
        "is_post_nsfw": false,
        "is_post_spoiler": false,
        "post_permalink": "/r/cscareerquestions/comments/1y38nbe/did_i_fuck_up_by_wanting_to_be_average/",
        "post_score": 74,
        "post_comments_count": 25,
        "post_created_at": "2026-11-23T04:06:52.556000+00:00",
        "position": 1,
        "body_text": "Wanting an okay job and a normal 9 to 5 isn’t unrealistic at all, that’s what most people in tech actually have. You just graduated into one of the worst markets in years, that’s timing, not you.\n\nAnd upskilling doesn’t have to mean learnin…"
      },
      {
        "comment_id": "t1_19sdj1xyx7hqd",
        "parent_id": null,
        "permalink": "/r/learnpython/comments/1xrq7dv/is_python_a_good_choice_for_backend_development/19sdj1xyx7hqd/",
        "post_url": "https://www.reddit.com/r/learnpython/comments/1xrq7dv/is_python_a_good_choice_for_backend_development/19sdj1xyx7hqd/",
        "author": "patryk_builds",
        "score": 45,
        "created_at": "2026-11-09T12:24:40.782000+00:00",
        "subreddit": "learnpython",
        "subreddit_id": "t5_2r8ot",
        "is_subreddit_nsfw": false,
        "is_subreddit_quarantined": false,
        "post_id": "t3_1xrq7dv",
        "post_title": "Is Python a good choice for backend development?",
        "is_post_nsfw": false,
        "is_post_spoiler": false,
        "post_permalink": "/r/learnpython/comments/1xrq7dv/is_python_a_good_choice_for_backend_development/",
        "post_score": 36,
        "post_comments_count": 43,
        "post_created_at": "2026-11-09T12:17:56.794000+00:00",
        "position": 2,
        "body_text": "Yes, and for most backends the language won't be your bottleneck. the database and network calls usually are, long before python is.What i like about it for backend work: FastAPI or Django get you a working API really fast, the ecosystem fo…"
      }
    ],
    "has_next_page": true,
    "next_page_token": "eyJ2IjoxLCJraW5kIjoiY29tbWVudF9zZWFyY2giLCJmcCI6ImY4NjE5NWJiMGIiLCJ0cyI6MTc5NTU1Mzc3NywidSI6ImV5SmpZVzVrYVdSaGRHVnpYM0psZEhWeWJtVmtJam9pZTF3aWMyVmpkR2x2Ymw4eFgzQnBjR1ZzYVc1bFh6QmZaMnh2WW1Gc1gyMXZaR2xtYVdWeWMxd2lPbHdpTVZ3aUxGd2ljMlZqZEdsdmJs…",
    "resolved_filters": {
      "subreddit": null,
      "sort": {
        "input": null,
        "resolved": "relevance",
        "source": "default"
      },
      "time": null
    },
    "billed_requests": 1
  },
  "request_params": {
    "q": "fastapi",
    "per_page": "5"
  }
}

Response Fields

FieldTypeDescription
statusbooleantrue when the request succeeded
request_idstringUnique request identifier
dataobjectSearch page.
data.resultsarray of objectsMatching comments.
data.results[].comment_idstringComment fullname.
data.results[].parent_idstring / nullParent comment fullname (t1_…) when the comment is a reply; null for a top-level comment.
data.results[].permalinkstringComment path.
data.results[].post_urlstringAbsolute link of the comment on Reddit (https://www.reddit.com + permalink), ready to open.
data.results[].authorstringUsername.
data.results[].scoreintegerNet upvotes.
data.results[].created_atstringISO-8601 UTC creation time.
data.results[].subredditstringSubreddit name.
data.results[].subreddit_idstringSubreddit id.
data.results[].is_subreddit_nsfwbooleanThe community is 18+.
data.results[].is_subreddit_quarantinedbooleanThe community is quarantined.
data.results[].post_idstringPost fullname.
data.results[].post_titlestringTitle of the post.
data.results[].is_post_nsfwbooleanThe post is marked NSFW.
data.results[].is_post_spoilerbooleanThe post is marked spoiler.
data.results[].post_permalinkstringPath of the post.
data.results[].post_scoreintegerScore of the post.
data.results[].post_comments_countintegerComment count of the post.
data.results[].post_created_atstringCreation time of the post.
data.results[].positionintegerRank in the search results, 1-based and counted across pages.
data.results[].body_textstringPlain text.
data.has_next_pagebooleanMore results available.
data.next_page_tokenstringToken for the next page; null at the end.
data.resolved_filtersobjectScope and sort as applied.
data.resolved_filters.subredditobject / nullSubreddit scope as applied; source: not_found when the community does not exist.
data.resolved_filters.sortobjectSort as applied.
data.resolved_filters.sort.inputstring / nullWhat the caller sent.
data.resolved_filters.sort.resolvedstringWhat was applied on Reddit (null when not applied).
data.resolved_filters.sort.sourcestringparam (applied as given), default, not_found (the value does not exist on Reddit), private / banned / quarantined (a community in the scope that cannot be read: skipped), or not_available (translate_to only: Reddit had no translated listing, the rows are served in their original language).
data.resolved_filters.timeobject / nullTime window as applied.
data.billed_requestsintegerRequests billed for this call (also sent as Requests in the X-RapidAPI-Billing header when it is not RapidAPI’s default of 1).
request_paramsobjectEcho of the parameters you sent

Error Responses

Invalid input returns HTTP 400, not billed. error is a plain string that names the parameter:

1
{ "status": false, "request_id": "99a1e6cd-2e57-9e8f-4e44-2dea7f6d", "error": "Invalid parameter 'post_id': must be a post id such as z1c9z or t3_z1c9z", "request_params": { "post_id": "!!" } }
Status CodeCauseDescription
400Invalid or missing parameterPlain-English message per field. Not billed
200 with status: falseItem not availableerror.code is not_found, deleted. data is null. Billed 1 request
503Reddit temporarily unreachable"error": "Service temporarily unavailable". Not billed, retry later
200 with status: falseBad page tokenerror.code is invalid_page_token: pass next_page_token from the previous answer unchanged

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
import requests

url = "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/comment/search"

params = {
    "q": "fastapi",
    "per_page": "5",
}

headers = {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com"
}

response = requests.get(url, headers=headers, params=params)
data = response.json()["data"]

for item in data["results"]:
    print(item["subreddit"], item["body_text"])
print("Billed requests:", data["billed_requests"])
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
const url = "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/comment/search";

const params = new URLSearchParams({
  q: "fastapi",
  per_page: "5",
});

const response = await fetch(`${url}?${params}`, {
  headers: {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com"
  }
});

const { data } = await response.json();
data.results.forEach((item) => console.log(item.subreddit, item.body_text));
1
2
3
4
5
curl -G "https://reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com/comment/search" \
  --data-urlencode "q=fastapi" \
  --data-urlencode "per_page=5" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: reddit-scraper-api-extractor-ai-the-most-complete.p.rapidapi.com"
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI