# Reddit Search Posts (`shareze001/reddit-search-posts`) Actor

This tool searches for posts on Reddit using specific keywords. It retrieves detailed information such as the community name, post title, votes, comments, and more. The results are returned in a structured JSON format, making it easy to analyze and integrate into other applications.

- **URL**: https://apify.com/shareze001/reddit-search-posts.md
- **Developed by:** [shareze](https://apify.com/shareze001) (community)
- **Categories:** Social media, Integrations, E-commerce
- **Stats:** 4 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **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 usage examples, see the [API](#api) section below.

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

# README

## Reddit Search Posts

This tool is designed to search for posts on Reddit based on specific keywords. It retrieves detailed information about the posts, including the community, title, votes, comments, and more.

### How to Use

#### 1. Input Configuration

The tool requires an input JSON object to define the search parameters. The structure of the input is as follows:

```json
{
  "keywords": "nike",
  "size": 10
}
```

- **`keywords`**: (Required) The search keywords, e.g., `nike`, `nike shoes`.
- **`size`**: (Required) The number of posts to retrieve. Default is 10. Minimum is 1.

#### 2. Output Data

The tool returns an array of objects containing information about the posts. The structure of each object is as follows:

```json
{
  "community_icon": "https://example.com/icon.png",
  "community_name": "ExampleCommunity",
  "community_url": "https://www.reddit.com/r/ExampleCommunity",
  "community_members": 100000,
  "community_online_members": 500,
  "search_warnings": "Some warnings",
  "post_title": "Example Post Title",
  "post_votes": 1000,
  "post_comments": 50,
  "post_description": "This is an example post description.",
  "post_url": "https://www.reddit.com/r/ExampleCommunity/comments/12345/example_post",
  "search_post_thumbnail": "https://example.com/thumbnail.png"
}
```

- **`community_icon`**: The URL of the community's icon.
- **`community_name`**: The name of the Reddit community.
- **`community_url`**: The URL of the Reddit community.
- **`community_members`**: The total number of members in the community.
- **`community_online_members`**: The number of online members in the community.
- **`search_warnings`**: Any warnings related to the search.
- **`post_title`**: The title of the post.
- **`post_votes`**: The number of votes the post received.
- **`post_comments`**: The number of comments on the post.
- **`post_description`**: A brief description of the post.
- **`post_url`**: The URL of the post.
- **`search_post_thumbnail`**: The URL of the post's thumbnail image.

#### 3. Running the Tool

1. Deploy the tool on the Apify platform.
2. Provide the input JSON in the tool's input configuration.
3. Run the tool to search for posts on Reddit.
4. Retrieve the output dataset containing the post details.

#### Notes

- Ensure that the input `keywords` are valid and correspond to existing Reddit content.
- The tool uses Reddit's public interface and may be subject to rate limits or restrictions.
- The `size` parameter determines the maximum number of posts to retrieve.

# Actor input Schema

## `keywords` (type: `string`):

Search keywords, for example: nike, nike shoes etc.

## `size` (type: `integer`):

posts size

## Actor input object example

```json
{
  "keywords": "nike",
  "size": 10
}
```

# 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 = {
    "keywords": "nike",
    "size": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("shareze001/reddit-search-posts").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 = {
    "keywords": "nike",
    "size": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("shareze001/reddit-search-posts").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 '{
  "keywords": "nike",
  "size": 10
}' |
apify call shareze001/reddit-search-posts --silent --output-dataset

```

## MCP server setup

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

```

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/ErQ0nDEshnw1p9xnS/builds/olDksvsLKj1VysgrV/openapi.json
