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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
q | string | Yes | - | 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. |
subreddit | string | No | - | Restrict to one community (verified scope, echoed in resolved_filters). |
page_token | string | No | - | Opaque page token from a previous response’s next_page_token. Omit for the first page. |
per_page | integer | No | 25 | Results per page, 1–25 (default 25). One page is billed 1 request. |
sort | string | No | relevance | relevance (default, not stable between calls), hot, top, new, comments. Allowed: relevance, hot, top, new, comments. |
time | string | No | default | Not 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_after | string | No | - | 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_before | string | No | - | 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_pages | integer | No | - | 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_nsfw | boolean | No | true | Default 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_details | boolean | No | false | Adds 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_html | boolean | No | false | Adds body_html (the rendered HTML body) to every post and comment. Default: left out; body_text carries the same text. |
translate_to | string | No | none | Reddit’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 …).
| |
Response Fields
| Field | Type | Description |
|---|---|---|
status | boolean | true when the request succeeded |
request_id | string | Unique request identifier |
data | object | Search page. |
data.results | array of objects | Matching comments. |
data.results[].comment_id | string | Comment fullname. |
data.results[].parent_id | string / null | Parent comment fullname (t1_…) when the comment is a reply; null for a top-level comment. |
data.results[].permalink | string | Comment path. |
data.results[].post_url | string | Absolute link of the comment on Reddit (https://www.reddit.com + permalink), ready to open. |
data.results[].author | string | Username. |
data.results[].score | integer | Net upvotes. |
data.results[].created_at | string | ISO-8601 UTC creation time. |
data.results[].subreddit | string | Subreddit name. |
data.results[].subreddit_id | string | Subreddit id. |
data.results[].is_subreddit_nsfw | boolean | The community is 18+. |
data.results[].is_subreddit_quarantined | boolean | The community is quarantined. |
data.results[].post_id | string | Post fullname. |
data.results[].post_title | string | Title of the post. |
data.results[].is_post_nsfw | boolean | The post is marked NSFW. |
data.results[].is_post_spoiler | boolean | The post is marked spoiler. |
data.results[].post_permalink | string | Path of the post. |
data.results[].post_score | integer | Score of the post. |
data.results[].post_comments_count | integer | Comment count of the post. |
data.results[].post_created_at | string | Creation time of the post. |
data.results[].position | integer | Rank in the search results, 1-based and counted across pages. |
data.results[].body_text | string | Plain text. |
data.has_next_page | boolean | More results available. |
data.next_page_token | string | Token for the next page; null at the end. |
data.resolved_filters | object | Scope and sort as applied. |
data.resolved_filters.subreddit | object / null | Subreddit scope as applied; source: not_found when the community does not exist. |
data.resolved_filters.sort | object | Sort as applied. |
data.resolved_filters.sort.input | string / null | What the caller sent. |
data.resolved_filters.sort.resolved | string | What was applied on Reddit (null when not applied). |
data.resolved_filters.sort.source | string | param (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.time | object / null | Time window as applied. |
data.billed_requests | integer | Requests billed for this call (also sent as Requests in the X-RapidAPI-Billing header when it is not RapidAPI’s default of 1). |
request_params | object | Echo of the parameters you sent |
Error Responses
Invalid input returns HTTP 400, not billed. error is a plain string that names the parameter:
| |
| Status Code | Cause | Description |
|---|---|---|
| 400 | Invalid or missing parameter | Plain-English message per field. Not billed |
200 with status: false | Item not available | error.code is not_found, deleted. data is null. Billed 1 request |
| 503 | Reddit temporarily unreachable | "error": "Service temporarily unavailable". Not billed, retry later |
200 with status: false | Bad page token | error.code is invalid_page_token: pass next_page_token from the previous answer unchanged |
Code Examples
| |
| |
| |
Related Endpoints
- Comment Details : Comment details by id or URL
- Comment Replies : Replies under one comment