# Reddit Post Search (`crawlix/reddit-post-search`) Actor

Reddit post search extracts public posts, thread links, author usernames, upvote scores, comment counts, timestamps, and community metadata by keyword. Features post format detection, preview thumbnails, Pay-Per-Event billing, custom sort filters, and clean JSON/CSV/Excel dataset exports.

- **URL**: https://apify.com/crawlix/reddit-post-search.md
- **Developed by:** [Crawlix](https://apify.com/crawlix) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 post collecteds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

The **Reddit Post Search** is a high-performance, production-grade data extraction tool engineered to search and harvest public posts across Reddit. Designed for data scientists, market researchers, brand intelligence analysts, and automation developers, this reddit post search discovers discussions, sentiment trends, product feedback, and breaking community topics with structured accuracy.

By providing target keywords, the reddit post search queries the public Reddit ecosystem and extracts rich post records. Each returned item is enriched with author profile metadata, community names, engagement metrics, direct thread URLs, and published timestamps. Whether you need to monitor niche subreddits or track global brand sentiment, this reddit search scraper delivers clean, structured feeds ready for analytical pipelines.

The reddit post search operates under a verified Pay-Per-Event pricing model, ensuring you only pay for successfully saved post records. With integrated support for custom sorting algorithms and granular time filtering windows, this reddit scraper provides complete control over your dataset collection.

#### Core Capabilities Matrix

- **Keyword-Driven Discovery**: Input single or multi-term queries to extract matching discussion posts across all public communities with the reddit post search.
- **Full Post Format Classification**: Automatically detects and classifies posts into `"text"`, `"image"`, `"video"`, `"gif"`, `"gallery"`, or `"link"`.
- **Clean Preview Thumbnail Extraction**: Accurately extracts post preview thumbnails (`thumbnail_url`) directly from dedicated post card containers.
- **Flexible Sorting Filters**: Support for multiple ordering methods including Relevance, Hot, Top, New, and Comment Count to discover high-impact discussions.
- **Time-Window Filtering**: Narrow your search to specific publication intervals including Past Hour, Today, Past Week, Past Month, Past Year, or All Time.
- **Filter Interaction Awareness**: Automatically adheres to platform filtering logic—when sorting by Hot or New, time filtering is safely streamlined without manual configuration.
- **Strict Deduplication Parity**: Every post identifier is strictly deduplicated before storage, guaranteeing that your dataset contains only unique records with zero duplicate charges.
- **Zero-Null Standard**: Dynamic field inclusion strips empty attributes row by row, keeping your exported CSV, JSON, and Excel tables clean and lightweight.
- **Resilient Infrastructure**: Direct residential proxy integration guarantees high extraction uptime across international regions without interruptions.

***

### Practical Use Cases & Applications

The reddit post search supports a wide range of commercial, academic, and analytical workflows:

#### 1. Brand Sentiment & Reputation Intelligence

Track public discussions regarding your brand, products, or competitors. Marketing teams use this reddit search scraper to analyze real customer opinions, uncover pain points, and monitor brand perception shifts across relevant niche subreddits.

#### 2. Market Research & Consumer Insights

Identify unmet consumer needs, community feedback, and product sentiment. E-commerce entrepreneurs and product managers rely on this reddit scraper to uncover organic community discussions, emerging consumer habits, and authentic reviews.

#### 3. Competitor Intelligence & Benchmarking

Discover what users appreciate or criticize about competing services. By running targeted keyword queries with the reddit post search, market analysts can benchmark competitor reception and identify product differentiators.

#### 4. AI Training & Large Language Model Datasets

Acquire conversational text datasets for training natural language processing models, sentiment classifiers, and conversational agents. The reddit post search provides high-quality text content and post titles formatted for immediate model ingestion.

#### 5. Crisis Detection & Early Trend Discovery

Monitor sudden spikes in negative discussions or emerging news stories. PR agencies utilize this reddit search scraper with real-time sorting to catch breaking viral threads before they escalate.

#### 6. Investment & Financial Research

Gauge retail investor sentiment around publicly traded stocks, consumer brands, and macroeconomic trends. Financial analysts use the reddit scraper to monitor discussion volume and sentiment trajectory across specialized communities.

***

### Target Audiences & Engineering Teams

This reddit post search is purpose-built for diverse professionals seeking automated reddit data extraction:

- **Data Engineers & Architects**: Integrate scalable reddit data extraction pipelines directly into Snowflake, BigQuery, or Amazon S3 via REST API.
- **Market Researchers**: Gather authentic qualitative consumer insights across thousands of organic subreddit discussions without manual browsing.
- **Growth Hackers & Marketers**: Pinpoint trending community discussions where prospective buyers actively discuss problems your solution resolves.
- **Academic & Social Scientists**: Extract rich social datasets to study discourse dynamics, digital culture trends, and online community behaviors using this reddit search scraper.
- **Product Managers**: Monitor user reactions to feature updates, app releases, and industry news directly from active users.

***

### Key Architectural Advantages & Reliability

The reddit post search incorporates enterprise-grade engineering principles to ensure consistent data delivery:

#### Universal Multi-Format Playback & Download

Posts featuring media assets are delivered with direct format download links ready for any screen or device: universal MP4 video links (up to 1080p, 720p, 480p, etc.), Apple HLS `.m3u8` playlists, MPEG-DASH `.mpd` adaptive manifests, direct AAC digital audio stream links, and multi-format image links (WebP, JPG, PNG, and original full-resolution uncompressed files).

#### Strict Deduplication Parity

When collecting extensive search results, online communities often return repeated posts across result boundaries. The reddit post search maintains an internal verified identifier index. Duplicate items are instantly discarded without charging events or advancing progress trackers, guaranteeing 100% parity between target counts and final dataset rows.

#### Zero-Null Data Purity Standard

Traditional scrapers often clutter output tables with hundreds of empty columns or null values. This reddit scraper implements recursive dynamic field inclusion: any attribute lacking data for a specific post is completely omitted from that row, maximizing storage efficiency and downstream analytical speed.

#### Anti-Interruption Fallback

Network hiccups and platform adjustments are handled gracefully. In the rare event of a connection interruption, the reddit post search safely seals all collected records in the cloud dataset and finishes with a clean exit status, preventing data loss.

#### Budget-Capped Spending Protection

Utilize Apify Max Total Charge limits with confidence. The reddit search scraper checks spending limits after every single charge event, immediately pausing further operations the instant your predefined budget ceiling is reached.

***

### Quickstart: Step-by-Step Execution Guide

Getting started with the reddit post search takes less than one minute:

1. **Set Up Search Keywords**: Enter your target terms in the `keyword` input field (e.g. `flower`, `artificial intelligence`, `electric vehicles`).
2. **Define Output Volume**: Set `max_items` to the number of unique posts you wish to collect (prefilled to 10 for free accounts).
3. **Select Sort Order**: Choose how results should be ordered—Relevance (default, free), Hot, Top, New, or Comment Count.
4. **Choose Time Range**: If using Relevance, Top, or Comment Count, optionally narrow results to Past Hour, Today, Past Week, Past Month, or Past Year.
5. **Run the Scraper**: Click the **Start** button on the Apify Console. Watch the live progress tracker step toward your target count.
6. **Export Your Dataset**: Download your structured records in JSON, CSV, Excel, XML, or Parquet format with a single click.

***

### Input Parameters & Configuration Reference

The reddit post search provides an intuitive configuration interface:

| Parameter Key | UI Title | Data Type | Default | Description |
|---|---|---|---|---|
| `keyword` | Search Keyword(s) | Array of Strings | `["flower"]` | Target search terms to query. Provide one or multiple keywords to discover matching posts. |
| `max_items` | Max Posts per Keyword | Integer | `10` | Total number of unique posts to extract. Free tier accounts are capped at 10 items per run; paid accounts have no volume limit. |
| `sort` | Sort Order | String (Select) | `relevance` | Ordering method for search results. Options: `relevance`, `hot`, `top`, `new`, `comments`. Filters are free of charge. |
| `time` | Time Range | String (Select) | `all` | Publication time frame. Options: `all`, `year`, `month`, `week`, `day`, `hour`. Ignored when Hot or New is selected. |
| `proxyCountry` | Connection Country | String (Select) | `US` | Origin country for network connections. Defaults to United States for optimal platform responsiveness. |

> **Note on Free Account Limits**: Free Apify tier accounts are capped at a maximum of 10 items per run. Upgrading to any paid Apify tier unlocks unlimited volume per run with this reddit post search.

***

### Extracted Dataset Schema & Field Definitions

The reddit post search extracts rich, normalized attributes for every discovered discussion. Output fields are organized into two availability tiers:

#### Fields That Most of the Time May Come in the Output

*Fields that are consistently populated across standard post extractions:*

- `id` *(string)*: Unique platform identifier for the post thread (e.g. `t3_1h7a9bc`).
- `title` *(string)*: The full headline or title text written by the author.
- `url` *(string)*: Direct canonical URL to the Reddit post discussion thread.
- `author` *(string)*: Public username of the author who submitted the post.
- `subreddit` *(string)*: Prefixed community name where the post resides (e.g. `r/flowers`).
- `score` *(integer)*: Net score (upvotes minus downvotes) recorded at extraction time.
- `comments_count` *(integer)*: Total number of comments posted on the thread.
- `post_type` *(string)*: Format classification of the post (e.g. `text`, `image`, `video`, `link`, `gallery`).
- `created_at` *(string)*: Publication timestamp formatted in standard ISO 8601.
- `query` *(string)*: The specific keyword query that discovered this record.
- `scraped_at` *(string)*: ISO timestamp recording when the record was extracted.

#### Fields Less Often Available (Present When Provided by the Listing or Broadcaster)

*Fields included when provided by the post author or community:*

- `author_id` *(string)*: Internal user account identifier of the submission author.
- `subreddit_id` *(string)*: Unique identifier of the host community.
- `domain` *(string)*: External host domain for shared link posts (e.g. `i.redd.it`, `youtube.com`).
- `content_url` *(string)*: Direct link to the shared image, external article, or video asset.
- `text_content` *(string)*: Full text body or selftext content of text discussions.
- `thumbnail_url` *(string)*: Preview thumbnail image link if generated by the platform.
- `media_urls` *(array of strings)*: List of all high-resolution image URLs for carousels/galleries or direct video stream.
- `image_formats` *(object)*: Map of available image format download links (`webp`, `jpg`, `png`, `original` uncompressed).
- `video_url` *(string)*: Direct downloadable MP4 video link (up to 1080p) for video submissions.
- `video_resolutions` *(object)*: Mapping of available video resolution heights (e.g. `1080p`, `720p`, `480p`, `360p`) to direct downloadable MP4 URLs.
- `video_formats` *(object)*: Playable video streams categorized by format (`mp4`, `hls`, `dash`) compatible across mobile, desktop, TV, and web players.
- `audio_url` *(string)*: Direct DASH audio stream URL for Reddit-hosted videos (`https://v.redd.it/{id}/DASH_AUDIO_128.mp4`).
- `audio_format` *(string)*: Digital audio encoding standard (`aac`).
- `audio_formats` *(object)*: Direct audio stream format links (`aac`, `mp4`) for video submissions.
- `hls_url` *(string)*: HLS streaming playlist link (`.m3u8`) for video submissions.
- `dash_url` *(string)*: MPEG-DASH manifest stream link (`.mpd`) for video submissions.
- `duration` *(number)*: Duration of video assets in seconds.
- `gallery_total` *(integer)*: Total number of items in carousel gallery submissions.
- `is_nsfw` *(boolean)*: True if the post is marked as adult 18+ content.
- `is_spoiler` *(boolean)*: True if the post is tagged as a spoiler.

> *Note on Dynamic Field Inclusion: A field with no value is omitted from the row.*

#### Sample JSON Output Record

##### Carousel / Multi-Image Post Example

```json
{
  "id": "t3_1h7a9bc",
  "title": "Beautiful blooming flower garden in early spring - 20 photo showcase",
  "url": "https://www.reddit.com/r/flowers/comments/1h7a9bc/beautiful_blooming_flower_garden_in_early_spring/",
  "author": "nature_enthusiast",
  "author_id": "t2_abc123xyz",
  "subreddit": "r/flowers",
  "subreddit_id": "t5_2qgzy",
  "score": 342,
  "comments_count": 58,
  "post_type": "gallery",
  "created_at": "2024-05-18T14:30:00.000Z",
  "domain": "reddit.com",
  "content_url": "https://www.reddit.com/r/flowers/comments/1h7a9bc/beautiful_blooming_flower_garden_in_early_spring/",
  "thumbnail_url": "https://preview.redd.it/flower_slide_1.jpg?width=140&height=140&crop=1%3A1%2Csmart",
  "media_urls": [
    "https://preview.redd.it/flower_slide_1.jpg?width=1080&crop=smart&auto=webp&s=sample1",
    "https://preview.redd.it/flower_slide_2.jpg?width=1080&crop=smart&auto=webp&s=sample2",
    "https://preview.redd.it/flower_slide_3.jpg?width=1080&crop=smart&auto=webp&s=sample3"
  ],
  "image_formats": {
    "original": "https://i.redd.it/flower_slide_1.jpg",
    "jpg": "https://i.redd.it/flower_slide_1.jpg",
    "webp": "https://preview.redd.it/flower_slide_1.jpg?width=1080&crop=smart&auto=webp&s=sample1"
  },
  "gallery_total": 20,
  "is_nsfw": false,
  "is_spoiler": false,
  "query": "flower",
  "scraped_at": "2024-11-24T18:30:00.000Z"
}
```

##### Video Post Example

```json
{
  "id": "t3_1vw3ctj",
  "title": "Macro time-lapse video of rare flower opening at sunrise",
  "url": "https://www.reddit.com/r/flowers/comments/1vw3ctj/macro_timelapse_video_of_rare_flower_opening/",
  "author": "flower_cinematographer",
  "author_id": "t2_18of0hzwh6",
  "subreddit": "r/flowers",
  "subreddit_id": "t5_2qgzy",
  "score": 1240,
  "comments_count": 86,
  "post_type": "video",
  "created_at": "2024-11-20T14:22:00.000Z",
  "domain": "reddit.com",
  "content_url": "https://www.reddit.com/r/flowers/comments/1vw3ctj/macro_timelapse_video_of_rare_flower_opening/",
  "thumbnail_url": "https://external-preview.redd.it/flower_poster.png",
  "media_urls": [
    "https://packaged-media.redd.it/sample_vid/pb/m2-res_1080p.mp4?s=sample"
  ],
  "video_url": "https://packaged-media.redd.it/sample_vid/pb/m2-res_1080p.mp4?s=sample",
  "video_resolutions": {
    "1080p": "https://packaged-media.redd.it/sample_vid/pb/m2-res_1080p.mp4?s=sample",
    "720p": "https://packaged-media.redd.it/sample_vid/pb/m2-res_720p.mp4?s=sample",
    "480p": "https://packaged-media.redd.it/sample_vid/pb/m2-res_480p.mp4?s=sample",
    "360p": "https://packaged-media.redd.it/sample_vid/pb/m2-res_360p.mp4?s=sample"
  },
  "video_formats": {
    "mp4": "https://packaged-media.redd.it/sample_vid/pb/m2-res_1080p.mp4?s=sample",
    "hls": "https://v.redd.it/sample_vid/HLSPlaylist.m3u8",
    "dash": "https://v.redd.it/sample_vid/DASHPlaylist.mpd"
  },
  "audio_url": "https://v.redd.it/sample_vid/DASH_AUDIO_128.mp4",
  "audio_format": "aac",
  "audio_formats": {
    "aac": "https://v.redd.it/sample_vid/DASH_AUDIO_128.mp4",
    "mp4": "https://v.redd.it/sample_vid/DASH_AUDIO_128.mp4"
  },
  "hls_url": "https://v.redd.it/sample_vid/HLSPlaylist.m3u8",
  "dash_url": "https://v.redd.it/sample_vid/DASHPlaylist.mpd",
  "duration": 18.2,
  "is_nsfw": false,
  "is_spoiler": false,
  "query": "flower",
  "scraped_at": "2024-11-24T18:30:00.000Z"
}
```

***

### Operational Constraints & Platform Limits

When designing workflows around the reddit post search, consider the following platform characteristics:

- **Public Content Scope**: The reddit search scraper extracts publicly accessible discussions. Private, restricted, or quarantined subreddits that require private invitations are excluded.
- **Search Depth Boundaries**: Like all major online platforms, search result directories reflect a finite depth of matching records for any single keyword and filter configuration.
- **Deleted or Removed Posts**: Submissions that have been removed by moderators or deleted by authors prior to extraction will not appear in search results.
- **Free Account Quota**: Free tier accounts on Apify are subject to a strict 10-item cap per run. Paid subscription plans have no volume restrictions.
- **Filter Interaction Rules**: When selecting `Hot` or `New` sort modes, Reddit automatically disables time-based filtering. The reddit post search respects this logic automatically.

***

### Best Practices & Performance Optimization

To maximize the value and efficiency of your reddit data extraction operations:

1. **Use Specific Search Keywords**: Target niche terms or product names (e.g. `mechanical keyboard switches`) rather than overly broad single words (`keyboard`) to harvest higher-intent discussions.
2. **Combine Sorting Strategies**: Run parallel jobs with `Top` (for historical high-impact discussions) and `New` (for real-time sentiment monitoring) using this reddit search scraper.
3. **Leverage Time Windows Wisely**: For tracking breaking news or product launches, pair `Top` sorting with `Past Week` or `Past Month` to isolate top-voted recent discussions.
4. **Schedule Recurring Runs**: Automate recurring runs via the Apify platform scheduler (e.g. every morning at 08:00 UTC) to continuously feed your analytics dashboards.
5. **Set Realistic Target Counts**: For niche topics with limited discussion volume, setting `max_items` to 50–100 ensures fast completion without requesting non-existent items.

***

### Troubleshooting & Frequently Asked Questions

#### Why did my run stop at exactly 10 posts?

Free tier accounts on the Apify platform are capped at 10 items per run (`FREE_USER_MAX_ITEMS = 10`). To extract larger volumes of posts, upgrade your Apify account to any paid tier. If you are already on a paid tier and encounter this limit, please report it via the Issues tab on this actor Console with your Run ID.

#### Is the 10-item free limit per day or per run?

The limit applies per run. Free accounts can test the reddit post search with up to 10 items on any execution.

#### Why is the Time Range filter not working with Hot or New sort orders?

Reddit's platform architecture does not support time filtering when sorting by Hot or New. When either mode is selected, the reddit post search automatically ignores the time filter and extracts posts matching the chosen sort order without error.

#### Can I search multiple keywords in a single run?

Yes. You can provide multiple keywords in the `keyword` string list input. The reddit post search processes each term in sequence until your total target post count is fulfilled.

#### What video, audio, and image download formats are supported?

Video submissions provide direct universal MP4 links (across multiple resolutions such as 1080p, 720p, 480p, etc.), Apple HLS `.m3u8` playlists, and MPEG-DASH `.mpd` adaptive manifests. Video audio is delivered as dedicated AAC stream links in `audio_url` and `audio_formats`. Image submissions include direct links in WebP, JPG, PNG, and the original uncompressed source file via `image_formats`.

#### What happens if a keyword has fewer results than my requested max_items?

The reddit search scraper exhausts all available matching posts on the platform, saves all unique records collected, and exits cleanly with a normal completion status.

#### How does Pay-Per-Event billing work?

You are charged strictly for successfully extracted and stored post records. If an error occurs or zero results match your query, no post billing events occur.

***

### Technical Architecture Glossary

- **Pay-Per-Event (PPE)**: A transparent monetization architecture where charges occur only upon verified record extraction, eliminating upfront subscription waste.
- **Deduplication Parity**: An algorithmic check that guarantees the final dataset row count matches the exact number of unique items discovered, discarding repeated records.
- **Zero-Null Standard**: An output standard where empty, null, or blank attributes are completely removed from the pushed record to ensure pristine data tables.
- **Subreddit**: An independent, topic-specific community on Reddit dedicated to discussions, news, and shared media around a specific theme.
- **Post Thread**: A top-level discussion submission submitted by a Reddit user containing a title, optional text body, and linked media.
- **Net Score**: The aggregate upvote tally calculated by subtracting downvotes from upvotes on a post.
- **Free Account Cap**: A standard 10-item volume limit applied per run to free Apify accounts to facilitate safe testing.

***

### Support & Feedback Channels

We actively maintain the **Reddit Post Search** to ensure total synchronization with platform updates.

- **Bug Reports & Inquiries**: If you experience an issue or wish to request additional filter options, open a ticket directly in the **Issues** tab on the Apify Actor Console.
- **Include Your Run ID**: To accelerate investigation, please include your specific **Run ID** when submitting an issue.
- **Continuous Maintenance**: Our engineering team monitors platform changes daily to provide rapid updates and ensure uninterrupted extraction reliability.

# Actor input Schema

## `keyword` (type: `array`):

One or more search keywords to find posts for (e.g. 'flower', 'technology', 'artificial intelligence'). Free plan users can collect up to 10 posts per run; paid users have unlimited collection.

## `max_items` (type: `integer`):

Maximum number of unique Reddit posts to collect for each search keyword. Free plan accounts are capped at 10 items total per run; paid accounts have no volume limit.

## `sort` (type: `string`):

Select how search results should be sorted: Relevance, Hot, Top, New, or Comment Count. Note: When Hot or New is selected, the Time Range filter is automatically ignored.

## `time` (type: `string`):

Filter posts by publication time window: All Time, Past Year, Past Month, Past Week, Today, or Past Hour. Active when Sort Order is Relevance, Top, or Comment Count; ignored when Hot or New is selected.

## `proxyCountry` (type: `string`):

Select the country connection for network queries. Defaults to United States (US).

## Actor input object example

```json
{
  "keyword": [
    "flower"
  ],
  "max_items": 10,
  "sort": "relevance",
  "time": "all",
  "proxyCountry": "US"
}
```

# Actor output Schema

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

All collected Reddit post records from this run. Use the Export button on the Output tab to download in CSV, Excel, JSON, or XML format.

# 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 = {
    "keyword": [
        "flower"
    ],
    "max_items": 10,
    "sort": "relevance",
    "time": "all",
    "proxyCountry": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlix/reddit-post-search").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 = {
    "keyword": ["flower"],
    "max_items": 10,
    "sort": "relevance",
    "time": "all",
    "proxyCountry": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("crawlix/reddit-post-search").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 '{
  "keyword": [
    "flower"
  ],
  "max_items": 10,
  "sort": "relevance",
  "time": "all",
  "proxyCountry": "US"
}' |
apify call crawlix/reddit-post-search --silent --output-dataset

```

## MCP server setup

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

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/zYNQdtWPQoU486ycq/builds/7lylN6hcKn1JY9toF/openapi.json
