# Reddit Media Search (`crawlix/reddit-media-search`) Actor

Reddit media search discovers and extracts public Reddit images, videos, GIFs, and galleries with direct MP4 downloads, HLS streams, carousel counts, and community metadata by keyword. Harvest rich visual content with Pay-Per-Event billing, custom sort, and clean JSON/CSV dataset exports.

- **URL**: https://apify.com/crawlix/reddit-media-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 media

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 Media Search** is a high-performance, production-grade data extraction tool engineered to search and harvest public images, videos, GIFs, and galleries across Reddit. Designed for computer vision engineers, multimedia researchers, creative directors, digital archivists, and automation developers, this reddit media search discovers visual content, trending creative assets, and authentic user-generated imagery with structured precision.

By providing target keywords, the reddit media search queries the public Reddit media directory and extracts rich media records. Each returned item is enriched with direct high-resolution media URLs, preview thumbnail links, format classifications (image, video, gif, gallery), author profiles, community names, engagement metrics, and published timestamps. Whether you need to build high-quality visual training datasets or monitor multimedia trends, this reddit media search delivers clean, structured feeds ready for analytical pipelines.

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

#### Core Capabilities Matrix

- **Keyword-Driven Visual Discovery**: Input single or multi-term queries to extract matching photos, artwork, video clips, animated GIFs, and carousel galleries with the reddit media search.
- **Direct High-Resolution Media Links**: Extracts the source media URL (`media_url`) for immediate downloading, training ingestion, or media processing.
- **Direct MP4 & HLS Video Stream Extraction**: Captures direct downloadable high-resolution MP4 video links (up to 1080p via `video_url`) and HLS `.m3u8` streaming playlists (`hls_url`) alongside video duration.
- **Multi-Image Carousel Gallery Support**: Identifies multi-image galleries from Reddit's `1/N` badges (e.g. `1/11`), extracting the full image count (`gallery_total`) and primary high-resolution assets.
- **Multi-Format Classification**: Automatically classifies assets into standard categories: `image`, `video`, `gif`, and `gallery`.
- **Flexible Sorting Filters**: Support for multiple ordering methods including Relevance, Hot, Top, New, and Comment Count to discover high-impact media posts.
- **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 media item 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 media search supports a wide range of commercial, academic, and analytical workflows:

#### 1. Computer Vision & Machine Learning Training

Build diverse visual training sets for image classification, object detection, generative AI models, and style transfer algorithms. Data scientists rely on the reddit media search to collect thousands of authentic real-world images and videos tagged by specific keyword themes.

#### 2. Creative Inspiration & Trend Forecasting

Discover emerging visual styles, viral memes, artistic aesthetics, and popular infographic formats. Creative directors and digital marketing agencies use this reddit media search to stay ahead of cultural trends and consumer visual preferences.

#### 3. Product & Brand Asset Monitoring

Monitor how consumers visually showcase, unbox, or demonstrate products in real community environments. Brand intelligence teams utilize this reddit media search to harvest organic user-generated content and visual product reviews.

#### 4. Digital Asset Archiving & Curation

Curate public domain images, historical photographs, digital art portfolios, or nature photography shared across passionate visual communities with the reddit media search.

#### 5. Meme & Viral Culture Analysis

Study the spread, variation, and evolution of internet memes and short-form video clips across digital subcultures. Social media researchers utilize this reddit media search to collect visual cultural artifacts timestamped across specific historical timeframes.

#### 6. Copyright & Brand Infringement Monitoring

Intellectual property analysts search for unauthorized trademark usage, pirated creative assets, or counterfeit product imagery across public communities using this reddit media search.

***

### Target Audiences & Engineering Teams

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

- **Computer Vision Engineers**: Ingest high-resolution images and video URLs directly into model training pipelines across AWS, Google Cloud, or local GPU clusters.
- **Creative Directors & Designers**: Collect real-world visual references, mood boards, and user designs across niche subreddits using the reddit media search.
- **Brand & Marketing Analysts**: Track consumer visual representations of brand packaging, merchandise, and retail displays.
- **Academic & Media Researchers**: Extract large multimedia corpora to study online visual communication and community dynamics with this reddit media search.
- **Automation Developers**: Seamlessly connect visual data feeds into downstream webhooks, digital asset management (DAM) platforms, and storage buckets.

***

### Key Architectural Advantages & Reliability

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

#### Universal Multi-Format Playback & Download

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 media posts across result boundaries. The reddit media 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 media search implements recursive dynamic field inclusion: any attribute lacking data for a specific media item 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 media 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 media search 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 media search takes less than one minute:

1. **Set Up Search Keywords**: Enter your target terms in the `keyword` input field (e.g. `flower`, `digital wallpaper`, `nature photography`).
2. **Define Output Volume**: Set `max_items` to the number of unique media items 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 media 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 media items with the reddit media search. |
| `max_items` | Max Media per Keyword | Integer | `10` | Total number of unique media items 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 media search.

***

### Extracted Dataset Schema & Field Definitions

The reddit media search extracts rich, normalized attributes for every discovered media item. 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 media extractions:*

- `id` *(string)*: Unique platform identifier for the media submission (e.g. `t3_1h7a9bc`).
- `title` *(string)*: Headline or title text of the media post.
- `url` *(string)*: Direct link to the Reddit discussion thread.
- `media_url` *(string)*: Direct high-resolution link to the hosted image, video, or GIF asset.
- `media_type` *(string)*: Classification of the media format (`image`, `video`, `gif`, `gallery`).
- `author` *(string)*: Public username of the creator who shared the media.
- `subreddit` *(string)*: Prefixed community name where the media was posted (e.g. `r/flowers`).
- `score` *(integer)*: Net score (upvotes minus downvotes) recorded at extraction time.
- `comments_count` *(integer)*: Total comment count on the submission.
- `created_at` *(string)*: Publication timestamp in ISO 8601 format.
- `query` *(string)*: The specific keyword query that discovered this media item.
- `scraped_at` *(string)*: ISO timestamp recording when the item was extracted.

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

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

- `thumbnail_url` *(string)*: Link to the preview thumbnail image if available.
- `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 high-resolution MP4 video link for video or animated GIF submissions.
- `video_resolutions` *(object)*: Mapping of available video resolution heights (e.g. `1080p`, `720p`, `480p`, `360p`, `240p`) 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 assets.
- `dash_url` *(string)*: MPEG-DASH manifest stream link (`.mpd`) for video assets.
- `duration` *(number)*: Duration of video assets in seconds.
- `gallery_total` *(integer)*: Total number of items in carousel gallery submissions (e.g. 11 for 1/11).
- `author_id` *(string)*: Internal user account identifier of the submission author.
- `subreddit_id` *(string)*: Unique identifier of the host community.
- `domain` *(string)*: Hosting provider or domain for the media asset (e.g. `i.redd.it`, `v.redd.it`, `imgur.com`).
- `is_nsfw` *(boolean)*: True if the media post is marked as adult 18+ content.
- `is_spoiler` *(boolean)*: True if the media 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

##### Gallery / Carousel Submission Example

```json
{
  "id": "t3_1h7a9bc",
  "title": "High resolution photograph series of blooming lotus flowers in botanical garden",
  "url": "https://www.reddit.com/r/flowers/comments/1h7a9bc/high_resolution_photograph_series_of_blooming_lotus/",
  "media_type": "gallery",
  "media_url": "https://preview.redd.it/flower_slide_1_hd.jpg?width=1080&crop=smart&auto=webp&s=sample1",
  "media_urls": [
    "https://preview.redd.it/flower_slide_1_hd.jpg?width=1080&crop=smart&auto=webp&s=sample1",
    "https://preview.redd.it/flower_slide_2_hd.jpg?width=1080&crop=smart&auto=webp&s=sample2",
    "https://preview.redd.it/flower_slide_3_hd.jpg?width=1080&crop=smart&auto=webp&s=sample3"
  ],
  "image_formats": {
    "original": "https://i.redd.it/flower_slide_1_hd.jpg",
    "jpg": "https://i.redd.it/flower_slide_1_hd.jpg",
    "webp": "https://preview.redd.it/flower_slide_1_hd.jpg?width=1080&crop=smart&auto=webp&s=sample1"
  },
  "gallery_total": 3,
  "thumbnail_url": "https://preview.redd.it/flower_slide_1_hd.jpg?width=1080&crop=smart&auto=webp&s=sample1",
  "author": "botany_photographer",
  "author_id": "t2_abc123xyz",
  "subreddit": "r/flowers",
  "subreddit_id": "t5_2qgzy",
  "score": 542,
  "comments_count": 38,
  "created_at": "2024-05-18T14:30:00.000Z",
  "domain": "reddit.com",
  "is_nsfw": false,
  "is_spoiler": false,
  "query": "flower",
  "scraped_at": "2024-11-24T18:30:00.000Z"
}
```

##### Video Submission Example

```json
{
  "id": "t3_1vw3ctj",
  "title": "Time-lapse video of blooming rare desert orchid under morning sun",
  "url": "https://www.reddit.com/r/flowers/comments/1vw3ctj/timelapse_video_of_blooming_rare_desert_orchid/",
  "media_type": "video",
  "media_url": "https://packaged-media.redd.it/sample_vid/pb/m2-res_1080p.mp4?s=sample",
  "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": 24.5,
  "thumbnail_url": "https://external-preview.redd.it/orchid_poster.png",
  "author": "botany_videographer",
  "author_id": "t2_18of0hzwh6",
  "subreddit": "r/flowers",
  "subreddit_id": "t5_2qgzy",
  "score": 1240,
  "comments_count": 86,
  "created_at": "2024-11-20T14:22:00.000Z",
  "domain": "reddit.com",
  "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 media search, consider the following platform characteristics:

- **Public Content Scope**: The reddit media search extracts publicly accessible media posts. Private or quarantined subreddits that require individual 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**: Media 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 media search respects this logic automatically.

***

### Best Practices & Performance Optimization

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

1. **Use Specific Search Keywords**: Target descriptive visual terms (e.g. `macro flower photography`, `minimalist architecture`) rather than overly generic queries to harvest higher-quality images.
2. **Combine Sorting Strategies**: Run parallel jobs with `Top` (for all-time highest-rated community media) and `New` (for newly published creative works) using this reddit media search.
3. **Leverage Time Windows Wisely**: For tracking viral visual trends, pair `Top` sorting with `Past Week` or `Past Month` to isolate top-voted recent creations.
4. **Schedule Recurring Runs**: Automate recurring runs via the Apify platform scheduler (e.g. every morning at 08:00 UTC) to continuously feed your image repositories with the reddit media search.
5. **Set Realistic Target Counts**: For niche topics with limited media 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 media items?

Free tier accounts on the Apify platform are capped at 10 items per run (`FREE_USER_MAX_ITEMS = 10`). To extract larger volumes of media, 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 media 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 media search automatically ignores the time filter and extracts media 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 media search processes each term in sequence until your total target media count is fulfilled.

#### What media types does the scraper extract?

The reddit media search extracts photos, digital art, illustrations, animations, video clips, and galleries. The `media_type` attribute classifies each record as image, video, gif, or gallery.

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

Videos 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`. Images 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 media search exhausts all available matching media 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 media records. If an error occurs or zero results match your query, no media 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.
- **Media Post**: A top-level Reddit submission containing direct links or uploads of images, video clips, galleries, or GIFs.
- **Direct Media URL**: The original high-resolution URL hosting the full image or video asset without webpage wrappers.
- **Thumbnail URL**: A lightweight preview image generated by the platform for quick visual browsing.
- **Net Score**: The aggregate upvote tally calculated by subtracting downvotes from upvotes on a media submission.
- **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 Media 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 media for (e.g. 'flower', 'nature photography', 'wallpaper'). Free plan users can collect up to 10 media items per run; paid users have unlimited collection.

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

Maximum number of unique Reddit media items 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 media 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 media 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-media-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-media-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-media-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlix/reddit-media-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/V6Er6r3ZRNh6OnGH1/builds/ICQrZVxkuRQXBdLSJ/openapi.json
