# Subreddit Top Posts This Week: JSON or CSV

Paste a subreddit's top-of-the-week link and get its best posts with title, body, score, comment count, author, flair and media links. Change the link or the time filter for day, month, year or all 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 8 seconds, $0.01 at free-plan prices

## Input

```json
{
  "startUrls": [
    "https://www.reddit.com/r/Python/top/?t=week"
  ],
  "maxItems": 100
}
```

## 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": "microsoft agent-framework on PyPI was compromised twice in 33 minutes last night",
    "subreddit": "Python",
    "author": "BattleRemote3157",
    "score": 448,
    "upvoteRatio": 0.98,
    "numComments": 57,
    "flair": "News",
    "createdAt": "2026-11-18T03:28:24Z",
    "url": "https://www.reddit.com/r/Python/comments/1xz4v1j/microsoft_agentframework_on_pypi_was_compromised/"
  },
  {
    "title": "Microsoft's PyPI package got compromised without a GitHub code change. How is this even possible?",
    "subreddit": "Python",
    "author": "enterthearena44",
    "score": 244,
    "upvoteRatio": 0.93,
    "numComments": 54,
    "flair": "Discussion",
    "createdAt": "2026-11-19T03:43:29Z",
    "url": "https://www.reddit.com/r/Python/comments/1xzzjn8/microsofts_pypi_package_got_compromised_without_a/"
  },
  {
    "title": "684 PyPI packages run code at every Python start, and only 13 are ready for PEP 829",
    "subreddit": "Python",
    "author": "Business-Feedback635",
    "score": 197,
    "upvoteRatio": 0.93,
    "numComments": 30,
    "flair": "Discussion",
    "createdAt": "2026-11-20T02:08:21Z",
    "url": "https://www.reddit.com/r/Python/comments/1y0riix/684_pypi_packages_run_code_at_every_python_start/"
  }
]
```

Full sample: https://datapika.com/data/tasks/subreddit-top-posts-this-week.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 "Subreddit Top Posts This Week: JSON or CSV" 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 8 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 '{"startUrls":["https://www.reddit.com/r/Python/top/?t=week"],"maxItems":100}'
```

## Change it

- startUrls takes any reddit.com link: a subreddit, a post, a user or a search page.
- Raise maxItems for a bigger dataset; you pay per result delivered.

## FAQ

### Can I change the time range?

Yes. Use a different link (e.g. /top/?t=month) or set subreddits with sort top and a time value.

### 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.
