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

Collect Reddit posts by keyword, community, and sort order in a few simple steps.

- **URL**: https://apify.com/pratikdani/reddit-search-posts.md
- **Developed by:** [Pratik Dani](https://apify.com/pratikdani) (community)
- **Categories:** Social media, News, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

Find Reddit posts that match a topic, community, or style of sorting in just a few clicks. This tool helps you quickly browse real conversations and popular posts so you can discover ideas, trends, and discussions without digging manually.

### What you get
- Post title
- Post author
- Community name
- Post link
- Number of comments
- Score and popularity signals
- Post date
- Post text, when available
- Media links and thumbnail images
- Flair or tag shown on the post
- Whether the post is archived, locked, or marked 18+
- Pagination support for more results

### How to use
1. Sign up for the marketplace and open this tool.
2. Enter the words you want to search for, such as a brand, topic, or phrase.
3. Optionally choose a community, sorting style, and time range.
4. Run the search to view matching posts.
5. Download the results and use them in your workflow, research, or review process.

### Inputs
| Field | Required | Plain-English description |
|---|---|---|
| query | Yes | The words or phrase you want to search for in Reddit posts. Example: `nike` |
| subreddit | No | A specific community to search within. Leave blank to search across Reddit more broadly. |
| sort | No | Chooses how results are arranged: relevance, hot, top, new, or comments. |
| time | No | Limits results to a time period such as hour, day, week, month, year, or all. Only works when sorting by top. |
| cursor | No | Used to continue from where the previous results ended, so you can view more posts. |
| maxResults | No | Sets how many results you want returned at once. |

### Output
Each result includes detailed post information in plain English:

- **all_awardings**: A list of awards the post received.
- **allow_live_comments**: Shows whether live comments are allowed.
- **approved_at_utc**: When the post was approved, if that applies.
- **approved_by**: Who approved the post, if available.
- **archived**: Shows whether the post is archived and no longer changing.
- **author**: The username of the person who posted it.
- **author_flair_background_color**: The background color of the author’s flair, if any.
- **author_flair_css_class**: The flair style class for the author, if any.
- **author_flair_richtext**: A richer version of the author flair content.
- **author_flair_template_id**: The flair template identifier, if used.
- **author_flair_text**: The text shown in the author’s flair.
- **author_flair_text_color**: The color of the author flair text.
- **author_flair_type**: The type of flair shown for the author.
- **author_fullname**: The author’s full internal name.
- **author_is_blocked**: Shows whether the author is blocked.
- **author_patreon_flair**: Shows whether the author has a special supporter flair.
- **author_premium**: Shows whether the author has premium status.
- **awarders**: A list of people or accounts that gave awards.
- **banned_at_utc**: When the post or author was banned, if that happened.
- **banned_by**: Who issued the ban, if available.
- **can_gild**: Shows whether the post can receive awards.
- **can_mod_post**: Shows whether moderators can post on it.
- **category**: The post category, if one exists.
- **clicked**: Shows whether the post has been clicked.
- **content_categories**: Content category labels, if present.
- **contest_mode**: Shows whether contest-style sorting is enabled.
- **created**: The creation time as a timestamp.
- **created_utc**: The creation time in universal time.
- **discussion_type**: The type of discussion, if set.
- **distinguished**: Whether the post is marked as official or highlighted.
- **domain**: The source site or media domain.
- **downs**: Number of downvotes.
- **edited**: Shows whether the post was edited.
- **gilded**: How many awards the post received.
- **gildings**: Award details in structured form.
- **hidden**: Shows whether the post is hidden.
- **hide_score**: Shows whether the score is hidden.
- **id**: The short ID for the post.
- **is_created_from_ads_ui**: Shows whether it was created through an ad tool.
- **is_crosspostable**: Shows whether it can be shared elsewhere.
- **is_meta**: Shows whether it is a meta post.
- **is_original_content**: Shows whether it is marked as original content.
- **is_reddit_media_domain**: Shows whether the media comes from Reddit.
- **is_robot_indexable**: Shows whether search tools can index it.
- **is_self**: Shows whether the post is text-based.
- **is_video**: Shows whether the post is a video.
- **likes**: The current like status, if available.
- **link_flair_background_color**: The background color of the post flair.
- **link_flair_css_class**: The flair style class for the post.
- **link_flair_richtext**: Rich flair content shown on the post.
- **link_flair_template_id**: The flair template identifier for the post.
- **link_flair_text**: The text label shown as flair.
- **link_flair_text_color**: The text color of the flair.
- **link_flair_type**: The type of flair used.
- **locked**: Shows whether comments are locked.
- **media**: Media attached to the post, if any.
- **media_embed**: Embedded media details.
- **media_only**: Shows whether the post contains only media.
- **mod_note**: Moderator note, if present.
- **mod_reason_by**: Who applied a moderator action, if available.
- **mod_reason_title**: Title of the moderation reason.
- **mod_reports**: Moderator reports attached to the post.
- **name**: The full post identifier.
- **no_follow**: Shows whether search engines should not follow the post.
- **num_comments**: Number of comments on the post.
- **num_crossposts**: Number of times it was crossposted.
- **num_reports**: Number of reports, if available.
- **over_18**: Shows whether the content is marked for adults.
- **permalink**: The Reddit link path to the post.
- **pinned**: Shows whether the post is pinned.
- **post_hint**: A hint about the post type, such as image or video.
- **preview**: Preview image details and sizes.
- **pwls**: Community or content weight indicator.
- **quarantine**: Shows whether the post is in a restricted community.
- **removal_reason**: Reason the post was removed, if available.
- **removed_by**: Who removed the post, if available.
- **removed_by_category**: Category of the remover, if available.
- **report_reasons**: Reasons the post was reported.
- **saved**: Shows whether the post was saved.
- **score**: The overall score of the post.
- **secure_media**: Secure media details, if any.
- **secure_media_embed**: Secure embedded media details.
- **selftext**: The text body of the post.
- **selftext_html**: The HTML version of the post text.
- **send_replies**: Shows whether replies are enabled.
- **spoiler**: Shows whether the post is marked as a spoiler.
- **stickied**: Shows whether the post is pinned to the top.
- **subreddit**: The community where the post was shared.
- **subreddit_id**: The internal ID of the community.
- **subreddit_name_prefixed**: The community name with the `r/` prefix.
- **subreddit_subscribers**: The number of people subscribed to that community.
- **subreddit_type**: The community type, such as public.
- **suggested_sort**: The suggested way to sort comments, if any.
- **thumbnail**: A small preview image link.
- **thumbnail_height**: The thumbnail height.
- **thumbnail_width**: The thumbnail width.
- **title**: The post title.
- **top_awarded_type**: The most prominent award type, if any.
- **total_awards_received**: Total number of awards received.
- **treatment_tags**: Labels attached for moderation or handling.
- **ups**: Number of upvotes.
- **upvote_ratio**: The share of votes that were upvotes.
- **url**: The main link for the post.
- **url_overridden_by_dest**: The final destination link, if different.
- **user_reports**: Reports submitted by users.
- **view_count**: Number of views, if available.
- **visited**: Shows whether the post has been visited.
- **wls**: Community or content weight indicator.

### Use cases
- Track what people are saying about a brand, product, or keyword.
- Find popular discussions in a specific community.
- Research customer opinions, trends, and recurring questions.
- Review recent or top posts for content ideas and market insight.

# Actor input Schema

## `query` (type: `string`):

What you want to search for. For example: "Nike shoes" or "python jobs".
## `subreddit` (type: `string`):

Optional: limit results to one subreddit. For example: "stocks" or "AskReddit".
## `sort` (type: `string`):

Choose how the results should be ordered. For example: "relevance" or "new".
## `time` (type: `string`):

Optional: choose a time period for top results. Use this only when sort is set to top. For example: "week" or "month".
## `maxResults` (type: `integer`):

Maximum number of results to return (default: 20).

## Actor input object example

```json
{
  "query": "nike",
  "subreddit": "stocks",
  "sort": "relevance",
  "maxResults": 20
}
````

# Actor output Schema

## `results` (type: `string`):

Formatted table view with labeled columns — ideal for reviewing data in Apify Console

## `rawData` (type: `string`):

Unformatted JSON items exactly as collected from the API — use this for programmatic processing

# 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 = {
    "query": "nike",
    "subreddit": "stocks"
};

// Run the Actor and wait for it to finish
const run = await client.actor("pratikdani/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 = {
    "query": "nike",
    "subreddit": "stocks",
}

# Run the Actor and wait for it to finish
run = client.actor("pratikdani/reddit-search-posts").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "query": "nike",
  "subreddit": "stocks"
}' |
apify call pratikdani/reddit-search-posts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=pratikdani/reddit-search-posts",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Reddit Search Posts",
        "description": "Collect Reddit posts by keyword, community, and sort order in a few simple steps.",
        "version": "0.0",
        "x-build-id": "rWSREVtUbBI1v7Wxg"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/pratikdani~reddit-search-posts/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-pratikdani-reddit-search-posts",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/pratikdani~reddit-search-posts/runs": {
            "post": {
                "operationId": "runs-sync-pratikdani-reddit-search-posts",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/pratikdani~reddit-search-posts/run-sync": {
            "post": {
                "operationId": "run-sync-pratikdani-reddit-search-posts",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "query"
                ],
                "properties": {
                    "query": {
                        "title": "Search keyword or phrase",
                        "type": "string",
                        "description": "What you want to search for. For example: \"Nike shoes\" or \"python jobs\"."
                    },
                    "subreddit": {
                        "title": "Subreddit name",
                        "type": "string",
                        "description": "Optional: limit results to one subreddit. For example: \"stocks\" or \"AskReddit\"."
                    },
                    "sort": {
                        "title": "Sort results by",
                        "enum": [
                            "relevance",
                            "hot",
                            "top",
                            "new",
                            "comments"
                        ],
                        "type": "string",
                        "description": "Choose how the results should be ordered. For example: \"relevance\" or \"new\".",
                        "default": "relevance"
                    },
                    "time": {
                        "title": "Time period",
                        "enum": [
                            "hour",
                            "day",
                            "week",
                            "month",
                            "year",
                            "all"
                        ],
                        "type": "string",
                        "description": "Optional: choose a time period for top results. Use this only when sort is set to top. For example: \"week\" or \"month\"."
                    },
                    "maxResults": {
                        "title": "Maximum results",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of results to return (default: 20).",
                        "default": 20
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
