Reddit Keyword Scraper avatar

Reddit Keyword Scraper

Pricing

$9.00/month + usage

Go to Apify Store
Reddit Keyword Scraper

Reddit Keyword Scraper

Scrap Reddit using keywords

Pricing

$9.00/month + usage

Rating

0.0

(0)

Developer

Alexandre AMIEL

Alexandre AMIEL

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

3 days ago

Last modified

Share

An Apify Actor that searches a subreddit for a keyword and returns every matching post and comment.

Input

FieldTypeRequiredDefaultDescription
subredditstringSubreddit to scan (e.g. pasta)
keywordstringKeyword to search for (e.g. tomato)
maxPostsinteger50Maximum posts to analyze (1–1000)
sortstringnewSort order: new · top · relevance · comments
timestringmonthTime filter: hour · day · week · month · year · all
includePostsbooleantrueMatch keyword in post title / body
includeCommentsbooleantrueMatch keyword in comments
maxCommentsPerPostinteger200Max comments to scan per post (0–2000)
commentDepthinteger3Nested reply depth to traverse (1–10)
requestDelayMsinteger800Delay between requests in ms (rate-limit safety)

Example storage/key_value_stores/default/INPUT.json:

{
"subreddit": "pasta",
"keyword": "tomato",
"maxPosts": 50,
"includePosts": true,
"includeComments": true
}

Output

Each dataset item represents one post that matched the keyword (in the post itself and/or in its comments).

{
"keyword": "tomato",
"subreddit": "pasta",
"post": {
"id": "abc123",
"title": "My tomato pasta recipe",
"selftext": "...",
"author": "u/someone",
"score": 142,
"numComments": 37,
"createdUtc": 1708300000,
"permalink": "https://www.reddit.com/r/pasta/comments/abc123/...",
"url": "https://www.reddit.com/r/pasta/comments/abc123/...",
"matchedInPost": true
},
"matchedComments": [
{
"id": "xyz789",
"author": "u/other",
"body": "I use canned tomato for this...",
"score": 12,
"createdUtc": 1708301000,
"permalink": "https://www.reddit.com/r/pasta/comments/abc123/_/xyz789"
}
],
"matchSummary": {
"matchedInPost": true,
"matchedCommentsCount": 1
}
}

Project structure

.actor/
├── actor.json # Actor name, version, runtime settings
├── input_schema.json # Input validation & Apify Console form
├── dataset_schema.json # Output dataset schema
└── output_schema.json # Output storage definition
src/
└── main.js # Actor entry point
storage/ # Local storage (mirrors cloud during dev)
├── datasets/ # Output items (JSON)
├── key_value_stores/ # INPUT.json lives here
└── request_queues/ # Crawl queue
Dockerfile # Container image definition

Local development

# Install dependencies
npm install
# Edit input
# storage/key_value_stores/default/INPUT.json
# Run locally
apify run

Deploy to Apify

apify login # enter your API token
apify push # build & deploy

Or connect your Git repository directly from the Apify Console.