Reddit Search Comments API - Find Matching Comments
FetchLayer fetchlayer.dev Sign in

Comments matching a keyword — globally or within a subreddit

Search Reddit comments by keyword. Optionally narrow to a specific subreddit. Results include comment body, score, author, subreddit, and permalink.

POST /search-comments Search
https://api.fetchlayer.dev/reddit/search-comments
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

query string required

Search keyword or phrase.

subreddit string | null optional

Limit search to a specific subreddit.

sort string optional

Sort order: relevance, new, comments, top. (default: relevance)

time string | null optional

Time filter: hour, day, week, month, year, or all.

limit number optional

Maximum number of results to return. (default: 25)

pages number optional

Maximum number of result pages to scrape. (default: 1)

Response Fields

search-comments

Comments matching a keyword — globally or within a subreddit

blocked boolean

Whether Reddit returned a block or verification page.

blockReason string | null

Machine-readable block reason when blocked is true; otherwise omitted.

blockedBodyText string | null

Diagnostic block-page text when blocked is true; otherwise omitted.

pageTitle string

Title of the scraped Reddit page.

requestedUrl string

Reddit URL requested by the scraper.

fetchUrl string

Normalized Reddit URL fetched by the scraper.

finalUrl string

Final URL after redirects.

responseStatus number | null

HTTP status returned by Reddit, or null when unavailable.

listingType string

Always comment-search for a successful response.

listingTitle string | null

Display title of the result listing.

resultCountText string | null

Result count text displayed by Reddit.

items[].id string | null

Comment ID without the t1_ prefix.

items[].fullname string | null

Reddit comment fullname.

items[].subreddit string | null

Subreddit name without the r/ prefix.

items[].subredditPrefixed string | null

Subreddit name with the r/ prefix.

items[].author string | null

Comment author.

items[].parentPostTitle string | null

Parent post title.

items[].parentPostAuthor string | null

Parent post author.

items[].parentPostUrl string | null

Parent post URL.

items[].permalink string | null

Absolute comment permalink.

items[].contextUrl string | null

Comment URL including Reddit context.

items[].fullCommentsUrl string | null

URL of the full comments page.

items[].createdAt string | null

ISO 8601 creation timestamp.

items[].score number | null

Comment score.

items[].scoreText string | null

Score text as displayed by Reddit.

items[].replyCount number | null

Reply count when available.

items[].replyCountText string | null

Reply count text as displayed by Reddit.

items[].bodyText string

Plain-text comment body.

items[].bodyHtml string | null

HTML comment body when available.

items[].distinguished string | null

Moderator/admin distinction, or null.

items[].stickied boolean

Whether the comment is stickied.

itemCount number

Number of comments returned in items.

nextCursorUrl string | null

Next search cursor URL, or null.

prevCursorUrl string | null

Previous search cursor URL, or null.

pagesRequested number

Number of pages requested.

pagesScraped number

Number of pages successfully scraped.

scrapedAt string

ISO 8601 timestamp for the scrape.

transport string

Reddit page transport used for extraction.

Request

curl -X POST "https://api.fetchlayer.dev/reddit/search-comments" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"query":"mcp","sort":"top","time":"all","limit":25}'

Response

{
  "blocked": false,
  "listingType": "comment-search",
  "items": [
    {
      "id": "xyz123",
      "bodyText": "MCP has been a game changer for my workflow.",
      "subreddit": "programming",
      "author": "devuser",
      "score": 342,
      "permalink": "https://www.reddit.com/r/programming/comments/.../comment/...",
      "createdAt": "2026-08-13T03:00:00.000Z",
      "stickied": false
    }
  ],
  "itemCount": 1,
  "pagesRequested": 1,
  "pagesScraped": 1,
  "transport": "new-reddit-html"
}