# Reddit API Scraper (`comchat/reddit-api-scraper`) Actor

Reddit Scraper is a powerful tool that allows you to extract data from Reddit such as posts by keyword. With Reddit Scraper, you can easily gather valuable information from Reddit without the need to log in. You can easily use this Reddit scraper as an alternative API.

- **URL**: https://apify.com/comchat/reddit-api-scraper.md
- **Developed by:** [Comchat](https://apify.com/comchat) (community)
- **Categories:** Social media, Lead generation
- **Features:** Full permissions
- **Stats:** 2,052 total users, 22 monthly users, 100.0% runs succeeded, 68 bookmarks
- **User rating**: 3.18 out of 5 stars

## Pricing

$5.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What is Reddit API Scraper?

Reddit API Scraper is a web scraping tool created to **extract data from Reddit such as posts and user details by keyword**. It can also scrape posts in specific subreddits. This Search API doesn’t need Reddit API keys and is a good fit for you if you need to:

- scrape **posts from Reddit search** by keywords
- scrape **posts from subreddits** by keywords
- sort Reddit data by **top, newest, most relevant, or most comments** first
- get **up to 250 results per search term**
- export **Reddit data via API** or download in JSON, Excel, CSV formats

### What data can I extract from Reddit?

With this Reddit API, you will be able to extract the following data from Reddit:

<table>
<tr>
<td>📌 Reddit posts</td>
<td>💬 Reddit comments</td>
</tr>
<tr>
<td>👤 User details</td>
<td>🔍 Subreddit details</td>
</tr>
<tr>
<td>📃 Post title and text</td>
<td>⏱ Timestamps</td>
</tr>
<tr>
<td>🔗 Post URL</td>
<td>🌠 Image URL</td>
</tr>
<tr>
<td>🌐 Community URL</td>
<td>📚 Category</td>
</tr>
</table>

### How much does it cost to scrape Reddit data?

This scraper uses the pay-per-result pricing model, so your costs can be easily calculated. It will cost you **$5 to scrape 1,000 search results, so 0.005 USD per item**.

Apify’s Free plan provides $5 free usage credits every month. For those credits, you can get up to **1,000 results from Reddit for free**.

If you need to get more Reddit data regularly, you should grab an Apify subscription. We recommend our [$49/month **Starter** **plan**](https://apify.com/pricing) - that one could get you up to 10,000 Reddit results every month. Or get up to 100,000 results for $499 with the [Scale plan](https://apify.com/pricing) - wow!

### How to scrape Reddit data?

You don't need any programming skills or experience to use Reddit Scraper.

1. [Create](https://console.apify.com/sign-up) a free Apify account using your email.
2. Find [Reddit API Scraper](https://apify.com/comchat/reddit-api-scraper).
3. Choose a keyword or subreddit to scrape posts.
4. Click "Start" and wait for the data to be extracted.
5. Download your data extracted from Reddit in JSON, XML, CSV, Excel, or HTML.

### ⬇️ Input example

This scraper will extract posts based on a keyword or a subreddit name. To get started, **simply enter a search term or the name of a subreddit.** You’ll extract all data associated with specific keywords in communities and posts. You can also **specify the number of posts to scrape**. Click on the [input tab](https://apify.com/comchat/reddit-api-scraper/api) for a full explanation of input in JSON.

```json
 {
  "over18": true,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "resultsLimit": 5,
  "searchList": [
    "lake"
  ],
  "sortBy": "new",
  "subRedditList": [
    "explainlikeimfive"
  ]
}
```

### ⬆️ Output example

The scraped results will be shown as a dataset which you can find in the **Storage** tab. Note that the output will be organized as a table for viewing convenience.

Here’s a JSON example of one scraped place on Reddit with all the details. You can preview all the fields and **download the file with Reddit data in various formats** (JSON, CSV, Excel, and more).

```json
{
  "metaData": {
    "keyword": "lake",
    "subRedditName": "explainlikeimfive"
  },
  "id": "15bwpbo",
  "subreddit": "IdahoNSFW",
  "title": "Any F or MF looking to hang out on a boat out on lake couer d alene?",
  "subreddit_name_prefixed": "r/IdahoNSFW",
  "name": "t3_15bwpbo",
  "link_flair_text_color": "dark",
  "subreddit_type": "public",
  "author_fullname": "t2_61mm5fwpd",
  "crosspost_parent_list": [
    {
      "approved_at_utc": null,
      "subreddit": "IdahoSwingers",
      "selftext": "Taking boat out on the lake this weekend and looking for someone to share in the sun and fun. Maybe boat up to Harrison and take in the sites and have a lot of fun.\nHit me up🏴‍☠️ SM 6’3 athletic and got looking to enjoy the sun",
      "author_fullname": "t2_61mm5fwpd",
      "saved": false,
      "mod_reason_title": null,
      "gilded": 0,
      "clicked": false,
      "title": "Any F or MF looking to hang out on a boat out on lake couer d alene?",
      "link_flair_richtext": [],
      "subreddit_name_prefixed": "r/IdahoSwingers",
      "hidden": false,
      "pwls": null,
      "link_flair_css_class": null,
      "downs": 0,
      "top_awarded_type": null,
      "hide_score": true,
      "name": "t3_15bwo7l",
      "quarantine": false,
      "link_flair_text_color": "dark",
      "upvote_ratio": 1,
      "author_flair_background_color": null,
      "subreddit_type": "public",
      "ups": 1,
      "total_awards_received": 0,
      "media_embed": {},
      "author_flair_template_id": null,
      "is_original_content": false,
      "user_reports": [],
      "secure_media": null,
      "is_reddit_media_domain": true,
      "is_meta": false,
      "category": null,
      "secure_media_embed": {},
      "link_flair_text": null,
      "can_mod_post": false,
      "score": 1,
      "approved_by": null,
      "is_created_from_ads_ui": false,
      "author_premium": false,
      "thumbnail": "",
      "edited": false,
      "author_flair_css_class": null,
      "author_flair_richtext": [],
      "gildings": {},
      "content_categories": null,
      "is_self": false,
      "mod_note": null,
      "created": 1690548845,
      "link_flair_type": "text",
      "wls": null,
      "removed_by_category": null,
      "banned_by": null,
      "author_flair_type": "text",
      "domain": "i.redd.it",
      "allow_live_comments": false,
      "selftext_html": "&lt;!-- SC_OFF --&gt;&lt;div class=\"md\"&gt;&lt;p&gt;Taking boat out on the lake this weekend and looking for someone to share in the sun and fun. Maybe boat up to Harrison and take in the sites and have a lot of fun.\nHit me up🏴‍☠️ SM 6’3 athletic and got looking to enjoy the sun&lt;/p&gt;\n&lt;/div&gt;&lt;!-- SC_ON --&gt;",
      "likes": null,
      "suggested_sort": null,
      "banned_at_utc": null,
      "url_overridden_by_dest": "https://i.redd.it/qbhmjksndpeb1.jpg",
      "view_count": null,
      "archived": false,
      "no_follow": true,
      "is_crosspostable": false,
      "pinned": false,
      "over_18": true,
      "all_awardings": [],
      "awarders": [],
      "media_only": false,
      "can_gild": false,
      "spoiler": false,
      "locked": false,
      "author_flair_text": null,
      "treatment_tags": [],
      "visited": false,
      "removed_by": null,
      "num_reports": null,
      "distinguished": null,
      "subreddit_id": "t5_39269d",
      "author_is_blocked": false,
      "mod_reason_by": null,
      "removal_reason": null,
      "link_flair_background_color": "",
      "id": "15bwo7l",
      "is_robot_indexable": true,
      "report_reasons": null,
      "author": "tombraider6869",
      "discussion_type": null,
      "num_comments": 0,
      "send_replies": true,
      "whitelist_status": null,
      "contest_mode": false,
      "mod_reports": [],
      "author_patreon_flair": false,
      "author_flair_text_color": null,
      "permalink": "/r/IdahoSwingers/comments/15bwo7l/any_f_or_mf_looking_to_hang_out_on_a_boat_out_on/",
      "parent_whitelist_status": null,
      "stickied": false,
      "url": "https://i.redd.it/qbhmjksndpeb1.jpg",
      "subreddit_subscribers": 10657,
      "created_utc": 1690548845,
      "num_crossposts": 3,
      "media": null,
      "is_video": false
    }
  ],
  "link_flair_type": "text",
  "author_flair_type": "text",
  "domain": "i.redd.it",
  "url_overridden_by_dest": "https://i.redd.it/qbhmjksndpeb1.jpg",
  "subreddit_id": "t5_526k6l",
  "author": "tombraider6869",
  "crosspost_parent": "t3_15bwo7l",
  "permalink": "/r/IdahoNSFW/comments/15bwpbo/any_f_or_mf_looking_to_hang_out_on_a_boat_out_on/",
  "url": "https://i.redd.it/qbhmjksndpeb1.jpg"
},
{
  "metaData": {
    "keyword": "lake",
    "subRedditName": "explainlikeimfive"
  },
  "id": "15bwowb",
  "subreddit": "r4rbrisbane",
  "selftext": "(M4F)",
  "author_fullname": "t2_qa4p5tsc",
  "title": "26 kiwi male looking for older female to show a good time DM is open (forest lake area) 😏",
  "subreddit_name_prefixed": "r/r4rbrisbane",
  "name": "t3_15bwowb",
  "link_flair_text_color": "dark",
  "subreddit_type": "public",
  "link_flair_type": "text",
  "author_flair_type": "text",
  "domain": "self.r4rbrisbane",
  "selftext_html": "&lt;!-- SC_OFF --&gt;&lt;div class=\"md\"&gt;&lt;p&gt;(M4F)&lt;/p&gt;\n&lt;/div&gt;&lt;!-- SC_ON --&gt;",
  "subreddit_id": "t5_2ut7l",
  "author": "New_Stable3679",
  "permalink": "/r/r4rbrisbane/comments/15bwowb/26_kiwi_male_looking_for_older_female_to_show_a/",
  "url": "https://old.reddit.com/r/r4rbrisbane/comments/15bwowb/26_kiwi_male_looking_for_older_female_to_show_a/"
},
{
  "metaData": {
    "keyword": "lake",
    "subRedditName": "explainlikeimfive"
  },
  "id": "15bworq",
  "subreddit": "madisonwi",
  "selftext": "I see tons of construction equipment there. Are they building something on this prime waste of space or is this just a staging area for some other purpose?",
  "author_fullname": "t2_uw61dro9",
  "title": "What’s going on with the big parking lot on East Wash by the Capitol?",
  "subreddit_name_prefixed": "r/madisonwi",
  "name": "t3_15bworq",
  "link_flair_text_color": "dark",
  "subreddit_type": "public",
  "link_flair_type": "text",
  "author_flair_type": "text",
  "domain": "i.redd.it",
  "selftext_html": "&lt;!-- SC_OFF --&gt;&lt;div class=\"md\"&gt;&lt;p&gt;I see tons of construction equipment there. Are they building something on this prime waste of space or is this just a staging area for some other purpose?&lt;/p&gt;\n&lt;/div&gt;&lt;!-- SC_ON --&gt;",
  "url_overridden_by_dest": "https://i.redd.it/yxs39rmsdpeb1.jpg",
  "subreddit_id": "t5_2r8rz",
  "author": "scottjones608",
  "whitelist_status": "all_ads",
  "permalink": "/r/madisonwi/comments/15bworq/whats_going_on_with_the_big_parking_lot_on_east/",
  "parent_whitelist_status": "all_ads",
  "url": "https://i.redd.it/yxs39rmsdpeb1.jpg"
},
{
  "metaData": {
    "keyword": "lake",
    "subRedditName": "explainlikeimfive"
  },
  "id": "15bwo7l",
  "subreddit": "IdahoSwingers",
  "selftext": "Taking boat out on the lake this weekend and looking for someone to share in the sun and fun. Maybe boat up to Harrison and take in the sites and have a lot of fun.\nHit me up🏴‍☠️ SM 6’3 athletic and got looking to enjoy the sun",
  "author_fullname": "t2_61mm5fwpd",
  "title": "Any F or MF looking to hang out on a boat out on lake couer d alene?",
  "subreddit_name_prefixed": "r/IdahoSwingers",
  "name": "t3_15bwo7l",
  "link_flair_text_color": "dark",
  "subreddit_type": "public",
  "link_flair_type": "text",
  "author_flair_type": "text",
  "domain": "i.redd.it",
  "selftext_html": "&lt;!-- SC_OFF --&gt;&lt;div class=\"md\"&gt;&lt;p&gt;Taking boat out on the lake this weekend and looking for someone to share in the sun and fun. Maybe boat up to Harrison and take in the sites and have a lot of fun.\nHit me up🏴‍☠️ SM 6’3 athletic and got looking to enjoy the sun&lt;/p&gt;\n&lt;/div&gt;&lt;!-- SC_ON --&gt;",
  "url_overridden_by_dest": "https://i.redd.it/qbhmjksndpeb1.jpg",
  "subreddit_id": "t5_39269d",
  "author": "tombraider6869",
  "permalink": "/r/IdahoSwingers/comments/15bwo7l/any_f_or_mf_looking_to_hang_out_on_a_boat_out_on/",
  "url": "https://i.redd.it/qbhmjksndpeb1.jpg"
},
{
  "metaData": {
    "keyword": "lake",
    "subRedditName": "explainlikeimfive"
  },
  "id": "15bwlsf",
  "subreddit": "dirtyr4r",
  "selftext": "I recently took time off to write a novel, currently staying at a secluded lake house so also trying to socialize! But I’m mainly looking to meet people with interesting stories to tell, or with interesting things to share. Message and inspire me?",
  "author_fullname": "t2_geq8ixnog",
  "title": "32 [M4F] NC - Writer seeking inspiration or more",
  "subreddit_name_prefixed": "r/dirtyr4r",
  "name": "t3_15bwlsf",
  "link_flair_text_color": "light",
  "subreddit_type": "public",
  "link_flair_text": "male",
  "link_flair_type": "text",
  "author_flair_type": "text",
  "domain": "self.dirtyr4r",
  "selftext_html": "&lt;!-- SC_OFF --&gt;&lt;div class=\"md\"&gt;&lt;p&gt;I recently took time off to write a novel, currently staying at a secluded lake house so also trying to socialize! But I’m mainly looking to meet people with interesting stories to tell, or with interesting things to share. Message and inspire me?&lt;/p&gt;\n&lt;/div&gt;&lt;!-- SC_ON --&gt;",
  "link_flair_template_id": "d897238a-545a-11eb-8db1-0e23163a9deb",
  "subreddit_id": "t5_2vqun",
  "link_flair_background_color": "#0079d3",
  "author": "moonglowing",
  "permalink": "/r/dirtyr4r/comments/15bwlsf/32_m4f_nc_writer_seeking_inspiration_or_more/",
  "url": "https://old.reddit.com/r/dirtyr4r/comments/15bwlsf/32_m4f_nc_writer_seeking_inspiration_or_more/"
}]
```

### ❓ FAQ

#### Do I need proxies to scrape Reddit?

If you run the scraper on the Apify platform, for successful Reddit scraping you will need [residential proxies](https://apify.com/proxy?pricing=residential-ip#pricing) which are included in Apify's **monthly Starter plan** **($49)**.

For more details about how our pricing works, platform credits, proxies, and usage, see the [platform pricing page](https://apify.com/pricing/actors).

#### Want to scrape Reddit by URLs?

If you want to **scrape Reddit data by direct URLs**, for example, you can try out a [Reddit scraper](https://apify.com/trudax/reddit-scraper) made by another developer.

#### Can I integrate this Reddit scraper with other apps?

Yes. Reddit Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). You can integrate with Make, LangChain, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, [and more](https://docs.apify.com/integrations).

Or you can use [webhooks](https://docs.apify.com/integrations/webhooks) to carry out an action whenever an event occurs, e.g. get a notification whenever Reddit Scraper successfully finishes a run.

#### Can I use Reddit Scraper data with API?

Yes. You can do so using the Apify API which will enable you to manage, schedule, and run Apify scrapers, including this one. The API also lets you access any datasets, monitor actor performance, fetch results, create and update versions, and more.

To access the API using Node.js, use the `apify-client` NPM package. To access the API using Python, use the `apify-client` PyPI package. Check out the [Apify API reference](https://docs.apify.com/api/v2) docs for full details or click on the [API tab](https://apify.com/comchat/reddit-api-scraper/api) for code examples.

#### Is it legal to scrape Reddit data?

It is legal to scrape publicly available data. However, you should be aware that the results from your Reddit web scraping **might contain personal information**.

Personal data is protected by GDPR ([EU Regulation 2016/679](https://eur-lex.europa.eu/eli/reg/2016/679/oj)), and by other regulations around the world. Generally, you should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, please consult your lawyers. You can also read our blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `searchList` (type: `array`):

Search posts by keyword

## `subRedditList` (type: `array`):

Plain text name (i.e. Webscraping) or subreddit_name_prefixed (i.e. r/Webscraping)

## `resultsLimit` (type: `integer`):

Reddit only allows you to get 250 results per search term.

## `sortBy` (type: `string`):

Sorting for search

## `over18` (type: `boolean`):

Include content rated as 18+ by Reddit

## `beforePostId` (type: `string`):

Provide post ID to search for results before it

## `proxy` (type: `object`):

<strong>A proxy server is required to run this actor!</strong> Either use an Apify residential proxy, or provide your own proxy servers. Datacenter proxies will not work.

## Actor input object example

```json
{
  "searchList": [
    "webscraping"
  ],
  "resultsLimit": 5,
  "sortBy": "new",
  "over18": true,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchList": [
        "webscraping"
    ],
    "resultsLimit": 5,
    "sortBy": "new",
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("comchat/reddit-api-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchList": ["webscraping"],
    "resultsLimit": 5,
    "sortBy": "new",
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("comchat/reddit-api-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchList": [
    "webscraping"
  ],
  "resultsLimit": 5,
  "sortBy": "new",
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call comchat/reddit-api-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,comchat/reddit-api-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/tW0tdmu7XAIoNezk2/builds/LQ9IVTStmedGyeJbF/openapi.json
