Apify example task · whoareyouanas/reddit-scraper
Compare top posts across two data science subreddits
Sample public posts from r/datascience and r/dataengineering. Compare topics, scores and source links using a shared sorting and scope.
- Actor
- Reddit Scraper - Posts, Comments & Search
- Result limit
- 10 (maxItems)
- Estimated cost
- Up to $0.015
- Run options
- Actor defaults
Example updated 2026-11-20 · actor build 2.1.5 · runs in your own Apify account
01 / About the actor
Reddit Scraper - Posts, Comments & Search
Export archived Reddit posts and nested comments from Reddit URLs or keyword searches scoped to a subreddit. Filter by date and flair and download CSV, Excel, or JSON.
URLs or subreddit search
Provide a Reddit post, subreddit, or profile URL, or search for a keyword in a particular subreddit.
Nested comments
Collect available replies alongside post records when comments are enabled.
Scoped exports
Choose filters and record caps before exporting for research.
02 / Input
The exact input this example runs.
Set startUrls for URL-based collection. For keyword searches, provide searches and a subreddit scope. Set explicit caps for the record types you need.
{
"includeNSFW": false,
"maxItems": 10,
"proxy": {
"useApifyProxy": true
},
"startUrls": [
{
"url": "https://www.reddit.com/r/datascience/"
},
{
"url": "https://www.reddit.com/r/dataengineering/"
}
],
"sort": "top",
"time": "month",
"maxPostCount": 5,
"skipComments": true
}| Field | Value in this example | What it controls |
|---|---|---|
| includeNSFWChange this | false | Include adult-rated posts, associated comments, and subreddits in results. |
| maxItemsChange this | 10 | Hard cap on the total number of items saved to the dataset across all categories. |
| proxy | 1 settings | Legacy proxy setting retained for saved inputs. This actor uses a public archive. |
| startUrlsChange this | https://www.reddit.com/r/datascience/, https://www.reddit.com/r/dataengineering/ | Paste Reddit post, comment, subreddit, user, or search-page URLs. Clear this field to use the keyword search form. |
| sortChange this | "top" | Rank results by recency, keyword relevance, score, activity, or comment count. |
| timeChange this | "month" | Limit results to a recent time window (most useful with sort = top or controversial). |
| maxPostCountChange this | 5 | Maximum posts saved for each subreddit, search term, user, or post URL. Use 0 for a comments-only or metadata-only run. |
| skipCommentsChange this | true | Skip scraping comments when going through posts. |
Other inputs you can add (8)
| Field | Type / required | Default | Purpose |
|---|---|---|---|
| ignoreStartUrls | boolean | false | Set to true to bypass the Start URLs field (used as a fix for tools like Zapier). |
| searches | array | Not specified | Keywords to search in the archive. With Start URLs, use the searchTerms API alias to run both. |
| searchCommunityName | string | Not specified | Search inside one subreddit, such as programming or r/programming. Without a scope the archive only searches communities whose names match the keyword. |
| searchPosts | boolean | true | Include matching posts in search results. |
| searchComments | boolean | false | Search comment text in the selected community. |
| searchCommunities | boolean | false | Include matching communities (subreddits) in search results. |
| searchUsers | boolean | false | Include matching user profiles in search results. |
| skipUserPosts | boolean | false | Skip scraping a user's submitted posts when going through their profile. |
03 / Make it yours
Change these fields for your own research.
01 · includeNSFW
Include NSFW content
Include adult-rated posts, associated comments, and subreddits in results.
Example: false
02 · maxItems
Max items (total)
Hard cap on the total number of items saved to the dataset across all categories.
Example: 10
03 · startUrls
Start URLs
Paste Reddit post, comment, subreddit, user, or search-page URLs. Clear this field to use the keyword search form.
Example: https://www.reddit.com/r/datascience/, https://www.reddit.com/r/dataengineering/
04 · sort
Sort
Rank results by recency, keyword relevance, score, activity, or comment count.
Example: "top"
05 · time
Time filter
Limit results to a recent time window (most useful with sort = top or controversial).
Example: "month"
06 · maxPostCount
Max posts per target
Maximum posts saved for each subreddit, search term, user, or post URL. Use 0 for a comments-only or metadata-only run.
Example: 5
07 · skipComments
Skip comments
Skip scraping comments when going through posts.
Example: true
Run it in three steps
- Open the example on Apify and select Try for free to copy it into your Apify account.
- Replace the sample values above with your own target and keep the limit small.
- Start the run, then export the dataset as JSON, CSV or Excel.
04 / Output
What the results table shows.
- Inspect the record type and source URL before combining post, comment, community, and user records.
- Check the available reply hierarchy and dates against the source when using nested comments.
Columns in the “Post columns” view
id
ID
username
Author
title
Title
communityName
Community
body
Body
flair
Flair
postType
Post type
upVotes
Up votes
numberOfComments
Comments
isVideo
Video
over18
NSFW
url
URL
createdAt
Created
A view selects columns for the table. The full JSON export keeps every field, including nested arrays and objects.
05 / Cost
What this example costs to run.
At most about $0.015: up to 10 results at $0.0015 each (Reddit result) plus $0.0005 per GB of memory for the start event. Fewer results cost less. The live Pricing tab on Apify is authoritative.
Actor Start
$0.0005 per event · per GB of memory
Reddit result
$0.0015 per event
Prices checked 2026-11-23. Set a run spending limit in Apify when you widen the input.
06 / API
Run the same input from your code.
This call starts a billable run of Reddit Scraper - Posts, Comments & Search with this example's input and returns the dataset items when it finishes. Synchronous calls wait up to five minutes; for longer runs, POST to /runs instead and read the run's default dataset when it succeeds. Keep the token in an environment variable.
curl --request POST \
'https://api.apify.com/v2/acts/whoareyouanas~reddit-scraper/run-sync-get-dataset-items?format=json' \
--header "Authorization: Bearer $APIFY_TOKEN" \
--header 'Content-Type: application/json' \
--data '{"includeNSFW":false,"maxItems":10,"proxy":{"useApifyProxy":true},"startUrls":[{"url":"https://www.reddit.com/r/datascience/"},{"url":"https://www.reddit.com/r/dataengineering/"}],"sort":"top","time":"month","maxPostCount":5,"skipComments":true}'Coverage & interpretation
Check the result before relying on it.
- Archive coverage varies by subreddit and date. Recent or removed posts and replies may be missing.
- Keyword search is scoped to a subreddit. Use the source URL to confirm a match before relying on it.
Questions
About this example.
What does the "Compare top posts across two data science subreddits" example collect?
Sample public posts from r/datascience and r/dataengineering. Compare topics, scores and source links using a shared sorting and scope. It runs Reddit Scraper - Posts, Comments & Search, published by whoareyouanas on Apify.
Which input does this example use?
Include NSFW content (includeNSFW) set to false; Max items (total) (maxItems) set to 10; Start URLs (startUrls) set to https://www.reddit.com/r/datascience/, https://www.reddit.com/r/dataengineering/; Sort (sort) set to "top"; Time filter (time) set to "month"; Max posts per target (maxPostCount) set to 5. The full JSON input is shown on this page.
How much does it cost to run this example?
At most about $0.015: up to 10 results at $0.0015 each (Reddit result) plus $0.0005 per GB of memory for the start event. Fewer results cost less. The live Pricing tab on Apify is authoritative.
How do I change it for my own research?
Open the example on Apify and select Try for free to copy it into your account, then edit Include NSFW content, Max items (total), Start URLs, Sort, Time filter, Max posts per target, Skip comments. Keep the result limit small for the first run and check the output before scaling up.
Can I run it from the API or on a schedule?
Yes. Send the same JSON input to the Reddit Scraper - Posts, Comments & Search run endpoint with your Apify API token, or save the copied task in your Apify account and add a schedule. Results land in the run's default dataset as JSON, CSV or Excel.
More examples
Related tasks you can copy.
Discover Reddit communities about homelabs
Search by homelab and collect the matching subreddit records. Review available community names, descriptions and member counts.
View exampleFind Python testing discussions on Reddit
Search public r/learnpython posts for pytest. Review post text, scores and source links for a small developer research sample.
View exampleFind Home Assistant backup discussions in Reddit comments
Search public r/homeassistant comments for backup restore experiences. Review the returned text and permalinks to locate the source threads.
View exampleAI Ad Analyzer
Score an ad creative with your own AI API key
Analyze one sample image ad for hooks, visible text, creative attributes and improvement suggestions. Add your own OpenAI API key in the secret apiKey field before running. Provider charges apply in addition to Apify usage; AI scores are not measured ad performance.
View exampleFacebook Group & Page Scraper
Collect images and video links from ESA Facebook posts
Sample public ESA Facebook posts with media extraction enabled. Review available image links, video links and source post URLs.
View exampleFacebook Post Scraper by ID
Look up a batch of Facebook posts by numeric ID
Supply three documented numeric IDs and compare the returned post text, timestamps and source URLs. Use the input ID to match the output back to your list.
View exampleGuides
Read more about this workflow.
Export Reddit Posts and Comments to CSV: Browser or Archive?
Choose a local export for the Reddit page you are reviewing or a dated archive export for historical research, with the right expectations for each.
How to Scrape Reddit Posts and Comments for Market Research
Use a Reddit scraper to find buyer language, product complaints, content ideas, and community signals from posts, comments, subreddits, and user profiles.
Top 5 Apify Scrapers to Automate Marketing Research
A practical stack of Apify scrapers for automating marketing research across Meta ads, Google ads, TikTok ads, Facebook Groups, and Reddit.
Top 7 Web Scrapers for Competitor Research in 2026
Compare the best web scrapers for competitor ad research, social listening, lead generation, and market research across Meta, Google, TikTok, Reddit, websites, and Facebook Groups.