# Reddit Search by Date: Posts in a Date Range

Crawls a subreddit by newest posts and keeps only those between postedAfter and postedBefore. Use it to collect one week or one month of a community for analysis. Reddit lists about 1,000 posts per listing, so very busy subreddits reach back a shorter time.

- Actor: openclawai/reddit-scraper (Reddit Scraper), https://datapika.com/actors/reddit-scraper
- Run on Apify: https://apify.com/openclawai/reddit-scraper
- Tested: 2026-11-23, 5 rows in 10 seconds, $0.01 at free-plan prices

## Input

```json
{
  "subreddits": [
    "MachineLearning"
  ],
  "sort": "new",
  "postedAfter": "2026-11-01",
  "postedBefore": "2026-11-20",
  "maxItems": 300
}
```

## Output fields

- `title`: Title
- `subreddit`: Subreddit
- `author`: Author
- `score`: Score
- `upvoteRatio`: Upvote %
- `numComments`: Comments
- `flair`: Flair
- `createdAt`: Posted
- `url`: Link

## Sample rows (personal data masked)

```json
[
  {
    "title": "Do we have AI Bots submitting the rebuttal as well [D]",
    "subreddit": "MachineLearning",
    "author": "Fantastic-Nerve-4056",
    "score": 11,
    "upvoteRatio": 0.7619047619047619,
    "numComments": 2,
    "flair": "Discussion",
    "createdAt": "2026-11-20T23:52:07Z",
    "url": "https://www.reddit.com/r/MachineLearning/comments/1y1il4v/do_we_have_ai_bots_submitting_the_rebuttal_as/"
  },
  {
    "title": "Levent Alpöge claims to have found a proof of the Riemann Hypothesis [N]",
    "subreddit": "MachineLearning",
    "author": "Benlus",
    "score": 20,
    "upvoteRatio": 0.8846153846153846,
    "numComments": 3,
    "flair": "News",
    "createdAt": "2026-11-20T16:47:05Z",
    "url": "https://www.reddit.com/r/MachineLearning/comments/1y18bbc/levent_alpöge_claims_to_have_found_a_proof_of_the/"
  },
  {
    "title": "ICLR: Reviewer inactive during rebuttal [D]",
    "subreddit": "MachineLearning",
    "author": "rfusername",
    "score": 0,
    "upvoteRatio": 0.18181818181818185,
    "numComments": 3,
    "flair": "Discussion",
    "createdAt": "2026-11-20T14:25:03Z",
    "url": "https://www.reddit.com/r/MachineLearning/comments/1y14rxa/iclr_reviewer_inactive_during_rebuttal_d/"
  }
]
```

Full sample: https://datapika.com/data/tasks/reddit-posts-by-date-range.json

## How to run it

1. **Open the actor on Apify.** Click Copy input, then Run on Apify to open the Reddit Scraper. Sign in or create a free account, open the JSON tab of the input form and paste the input.
2. **Start the "Reddit Search by Date: Posts in a Date Range" task.** Press Start. Change any input field first if you need a different topic, account or size; the fields are listed above.
3. **Get the results.** Rows arrive in a dataset while the run works. Our test returned 5 rows in 10 seconds.
4. **Use the data.** Download JSON, CSV or Excel, call the run from the API, schedule it, or let an AI agent run it through MCP.

API (replace the token):

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/openclawai~reddit-scraper/run-sync-get-dataset-items?maxTotalChargeUsd=1" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"subreddits":["MachineLearning"],"sort":"new","postedAfter":"2026-11-01","postedBefore":"2026-11-20","maxItems":300}'
```

## Change it

- Put any community in subreddits, e.g. startups or marketing; several run in one go.
- sort takes hot, new, top, rising or controversial.
- postedAfter and postedBefore (YYYY-MM-DD) give an exact date window.
- Raise maxItems for a bigger dataset; you pay per result delivered.

## FAQ

### How far back can I go?

A subreddit listing reaches about 1,000 posts back. For older posts, use a keyword search with time set to all.

### Do I need a Reddit account or API key?

No. It reads public Reddit data anonymously, with no login, cookie, app registration or API key.

### How much does it cost?

You pay per result delivered to your dataset: posts, comments, users or communities. There is no start fee. The current prices are on the Pricing tab.

### How do I export the results?

Download the dataset as JSON, CSV or Excel, read it through the Apify API, or run the task from an AI agent through the Apify MCP server.
