scraper
Back to API docs

Overview

  • Overview

APIs

  • POSTPost
  • POSTSearch
  • POSTSubreddit
  • POSTUser Posts
  • POSTUser Comments
  • POSTCommunity

Reddit Search

1 credit

Search Reddit for posts and comments.

POST/api/v1/tools/reddit/search

Parameters

querystringrequired

Search query string.

subredditstring

Restrict results to one subreddit, with or without the r/ prefix.

sortstring

Result sort: hot (default), relevance, top, new, or comments.

timestring

Time window for top and controversial: hour, day, week, month, year, or all (default). A window narrower than "all" also filters the whole walk.

maxResultsnumber

Maximum matching posts to return; the same limit applies to matching comments. Defaults to 50. Set 0 to return everything the call can fetch. Other sorts and time windows are walked and deduplicated when needed. Upper bound is determined by your plan.

includeNsfwboolean

Include over-18 posts. Defaults to true.

includeCommentsboolean

Also fetch the comment thread of each found post, returned in threadComments. Costs 2 credits instead of 1. Defaults to false.

maxCommentsPerPostnumber

Maximum comments per post when includeComments is true. Defaults to 50. Set 0 to keep the whole thread. The comments of all posts together stay within your plan limit, and the response then has truncated set to true.

commentSortstring

Comment ordering: confidence (default), top, new, controversial, old, or qa.

expandCommentsboolean

Follow "load more comments" links until the thread is complete or the comment limit is met. Defaults to true. Set false to keep only the first page Reddit serves.

depthstring

Field preset used when fields is omitted: basic, the default, returns every field except the HTML text, and detailed also returns it. fields overrides depth.

fieldsstring[]

Fields to include per post/comment. Overrides depth. Use ["*"] for all fields. Available fields: type, id, author, title, selftext, body, score, created, subreddit, numComments, parentId, permalink, parentPostTitle, parentPostUrl, scrapedAt.

commentFieldsstring[]

Comment fields to include when includeComments is true. Overrides depth. Use ["*"] for all fields, including the HTML text.

Response Schema

dataobject

Reddit search result

postsobject[]

Matching posts. Fields depend on depth and fields.

commentsobject[]

Matching comments. Fields depend on depth and fields.

threadCommentsobject[]

Comments of the found posts, in thread order. Present only when includeComments is true. They are not part of count. Fields depend on depth and commentFields.

countnumber

Total number of matching posts and matching comments returned

truncatedboolean

Present and true when the call stopped before it read everything: the request budget ended, or thread comments passed your plan limit.

metaobject

Request metadata

toolstring

Tool name (reddit-search)

creditsUsednumber

Credits consumed (1, or 2 with includeComments)

requestIdstring

Unique request ID

Request

curl -X POST https://scraper.run/api/v1/tools/reddit/search \
-H "Authorization: Bearer sc_live_..." \
-H "Content-Type: application/json" \
-d '{
"query": "best rust web frameworks",
"subreddit": "rust",
"sort": "top",
"time": "year"
}'

Response Example

{
"data": {
"posts": [
{
"type": "post",
"id": "t3_abc123",
"author": "rustacean",
"title": "Best Rust web frameworks in 2026?",
"selftext": "I have been comparing Actix, Axum, and Rocket...",
"score": 256,
"created": "2026-04-07T10:00:00.000Z",
"subreddit": "r/rust",
"numComments": 89,
"permalink": "https://www.reddit.com/r/rust/comments/abc123/best_rust_web_frameworks/",
"scrapedAt": "2026-04-08T18:00:00.000Z"
}
],
"comments": [
{
"type": "comment",
"id": "t1_xyz789",
"author": "web_dev",
"body": "Axum has the best ergonomics in my experience.",
"score": 45,
"created": "2026-04-07T11:30:00.000Z",
"subreddit": "r/rust",
"parentId": "t3_abc123",
"permalink": "https://www.reddit.com/r/rust/comments/abc123/best_rust_web_frameworks/xyz789/",
"parentPostTitle": "Best Rust web frameworks in 2026?",
"parentPostUrl": "https://www.reddit.com/r/rust/comments/abc123/best_rust_web_frameworks/"
}
],
"count": 2
},
"meta": {
"tool": "reddit-search",
"creditsUsed": 1,
"requestId": "req_abc123"
}
}