# Scrape the top posts of a subreddit

**Use case:** 

Ready-to-run example: point at a subreddit listing URL, or just name a subreddit, and get its posts and comments as structured rows.

## Input

```json
{
  "startUrls": [
    {
      "url": "https://www.reddit.com/r/dataisbeautiful/top/?t=month"
    }
  ],
  "subreddits": [
    "rust"
  ],
  "sort": "hot",
  "time": "all",
  "maxPostsPerSource": 100,
  "maxItems": 0,
  "deepCoverage": false,
  "includeComments": false,
  "maxCommentsPerPost": 50,
  "commentSort": "confidence",
  "maxCommentDepth": 10,
  "postedAfter": "",
  "skipNsfw": false,
  "onlyNew": false,
  "maxConcurrency": 8,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

## Output

```json
{
  "type": {
    "label": "Type"
  },
  "id": {
    "label": "ID"
  },
  "subreddit": {
    "label": "Community"
  },
  "title": {
    "label": "Title"
  },
  "body": {
    "label": "Text"
  },
  "author": {
    "label": "Author"
  },
  "score": {
    "label": "Score"
  },
  "upvoteRatio": {
    "label": "Upvote ratio"
  },
  "numComments": {
    "label": "Comments"
  },
  "createdAt": {
    "label": "Posted at"
  },
  "url": {
    "label": "URL"
  },
  "permalink": {
    "label": "Permalink"
  },
  "flair": {
    "label": "Flair"
  },
  "linkUrl": {
    "label": "Links to"
  },
  "images": {
    "label": "Images"
  },
  "videoUrl": {
    "label": "Video"
  },
  "postId": {
    "label": "On post"
  },
  "postTitle": {
    "label": "Post title"
  },
  "parentId": {
    "label": "Reply to"
  },
  "depth": {
    "label": "Depth"
  },
  "sourceRef": {
    "label": "From input"
  },
  "errorReason": {
    "label": "Gap reason"
  },
  "message": {
    "label": "Explanation"
  },
  "scrapedAt": {
    "label": "Scraped at"
  }
}
```

## About this Actor

This example demonstrates how to use [Reddit Scraper API — Posts, Comments, Search, Users](https://apify.com/vonsensey/reddit-scraper-posts-comments-api) with a specific input configuration. Visit the [Actor detail page](https://apify.com/vonsensey/reddit-scraper-posts-comments-api) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
This Task's input is already configured above — use it as-is rather than inventing a new one.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/vonsensey/reddit-scraper-posts-comments-api.md

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).
