# Reddit Media Search Scraper (`easyapi/reddit-media-search-scraper`) Actor

Extract media posts from Reddit's search results with rich metadata. Supports both images and videos with multiple quality options. Perfect for AI, meme research, trend analysis, and content curation from Reddit's vast media library.

- **URL**: https://apify.com/easyapi/reddit-media-search-scraper.md
- **Developed by:** [EasyApi](https://apify.com/easyapi) (community)
- **Categories:** Social media
- **Security:** Limited permissions
- **Stats:** 40 total users, 0 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Reddit Media Search Scraper 🎯

Extract media-focused content from Reddit search results with comprehensive metadata and high-quality media sources.

### 🌟 Features

- Search media posts across all Reddit communities
- Support for both images and videos
- Multiple video quality options (220p to 720p)
- Rich post metadata extraction
- Smart pagination handling

### 📊 Data Structure

Each result includes:

- Post metadata (ID, title, timestamps, scores)
- Community information
- Author details
- Media content with multiple quality options
- Engagement metrics
- Position in search results

### 🎥 Video Support

Includes multiple resolution options:

- 720p (1280x720)
- 480p (854x480)
- 360p (640x360)
- 240p (426x240)
- 220p (392x220)

### 💡 Use Cases

- AI/ML Dataset Collection
- Meme Research
- Visual Trend Analysis
- Content Curation
- Social Media Monitoring
- Digital Marketing Research
- Academic Studies
- Media Archive Building

#### Input Example

A full explanation of an input example in JSON.

```
{
    "query": "ai",
	"sort": "relevance",
    "time": "all",
    "safeSearch": "0",
    "maxItems": 45
}
```

#### Output sample

The results will be wrapped into a dataset which you can always find in the **Storage** tab. Here's an excerpt from the data you'd get if you apply the input parameters above:

And here is the same data but in JSON. You can choose in which format to download your data: JSON, JSONL, Excel spreadsheet, HTML table, CSV, or XML.

```
[
	{
		"post_id": "t3_1epeshq",
		"title": "These are all AI",
		"created_timestamp": "2024-08-11T07:12:08.989Z",
		"score": 23117,
		"comment_count": 3483,
		"nsfw": false,
		"spoiler": false,
		"url": "https://www.reddit.com/r/ChatGPT/comments/1epeshq/these_are_all_ai/",
		"subreddit": {
			"id": "t5_7hqomg",
			"name": "ChatGPT",
			"nsfw": false
		},
		"author": {
			"id": "t2_rpv4m"
		},
		"position": 0,
		"media_type": "image",
		"media": {
			"src": "https://preview.redd.it/these-are-all-ai-v0-o95bc7fqizhd1.png?width=640&crop=smart&auto=webp&s=10dc1daadf4e261c82ec2d236ae89d40b6bc703f",
			"alt": "r/ChatGPT - These are all AI"
		}
	},
	{
		"post_id": "t3_10jou5a",
		"title": "AI Visual Translation from FlawlessAI",
		"created_timestamp": "2023-01-23T22:00:06.409Z",
		"score": 81587,
		"comment_count": 2508,
		"nsfw": false,
		"spoiler": false,
		"url": "https://www.reddit.com/r/nextfuckinglevel/comments/10jou5a/ai_visual_translation_from_flawlessai/",
		"subreddit": {
			"id": "t5_m0bnr",
			"name": "nextfuckinglevel",
			"nsfw": false
		},
		"author": {
			"id": "t2_gikix"
		},
		"position": 1,
		"media_type": "video",
		"media": {
			"poster": "https://external-preview.redd.it/CNUdLX6hWCo9T-RAnxEkNPOWZsTw2FwAp_gohmQAxvw.png?format=pjpg&auto=webp&s=6fbcb980115ddaf44c98c2b6d70c0d15872383f2",
			"duration": 23,
			"sources": [
				{
					"url": "https://packaged-media.redd.it/tq2o1kj08vda1/pb/m2-res_220p.mp4?m=DASHPlaylist.mpd&v=1&e=1730782800&s=b55797a7d0aa9447fe4da12b1a0d0e56e13f2be6",
					"width": 392,
					"height": 220
				},
				{
					"url": "https://packaged-media.redd.it/tq2o1kj08vda1/pb/m2-res_240p.mp4?m=DASHPlaylist.mpd&v=1&e=1730782800&s=59bbdfb7e863010dcef35122ab6041e288e55b9b",
					"width": 426,
					"height": 240
				},
				{
					"url": "https://packaged-media.redd.it/tq2o1kj08vda1/pb/m2-res_360p.mp4?m=DASHPlaylist.mpd&v=1&e=1730782800&s=2b37607c3cc874e03e80269971b32c1730145553",
					"width": 640,
					"height": 360
				},
				{
					"url": "https://packaged-media.redd.it/tq2o1kj08vda1/pb/m2-res_480p.mp4?m=DASHPlaylist.mpd&v=1&e=1730782800&s=fc42e2578abd44f77dc4504827b6c4deb8ab4d4b",
					"width": 854,
					"height": 480
				},
				{
					"url": "https://packaged-media.redd.it/tq2o1kj08vda1/pb/m2-res_720p.mp4?m=DASHPlaylist.mpd&v=1&e=1730782800&s=d27e73fb4ea131dfa71bb21ca90a9eadcd454050",
					"width": 1280,
					"height": 720
				}
			]
		}
	},
    ...
]
```

### Related Actors

- 🔍 [Reddit Posts Search Scraper](https://apify.com/easyapi/reddit-posts-search-scraper) - Extract Reddit posts from search results with rich metadata for content research and trend analysis.
- 💬 [Reddit Comments Scraper](https://apify.com/easyapi/reddit-comments-scraper) - Extract Reddit comments with complete thread structure and engagement metrics.
- 🔎 [SubReddit Posts Search Scraper](https://apify.com/easyapi/subreddit-posts-search-scraper) - Scrape Reddit search results from any subreddit with advanced filtering options.
- 🗨️ [SubReddit Comments Search Scraper](https://apify.com/easyapi/subreddit-comments-search-scraper) - Extract Reddit comments from any subreddit's search results with advanced filtering.
- 👥 [Reddit Communities Search Scraper](https://apify.com/easyapi/reddit-communities-search-scraper) - Extract Reddit communities with comprehensive metadata and member counts.
- 📊 [Reddit Trends Scraper](https://apify.com/easyapi/reddit-trends-scraper) - Extract trending posts and discussions from Reddit with advanced filtering capabilities.
- 🎥 [All-in-One Media Downloader](https://apify.com/easyapi/all-in-one-media-downloader) - Download videos, images, or audio from various platforms including Reddit.
- 🔍 [SubReddit Media Search Scraper](https://apify.com/easyapi/subreddit-media-search-scraper) - Extract media content from Reddit subreddit search results.
- 🎬 [YouTube Video Data Scraper](https://apify.com/easyapi/youtube-video-data-scraper) - A powerful YouTube video data extractor for comprehensive metadata collection.
- 📸 [Instagram Posts Scraper](https://apify.com/easyapi/instagram-posts-scraper) - Extract Instagram posts data with comprehensive details and engagement metrics.
- 🎥 [TikTok Videos Scraper](https://apify.com/easyapi/tiktok-videos-scraper) - Scrape TikTok video search results with advanced filtering capabilities.
- 📹 [Facebook Videos Scraper](https://apify.com/easyapi/facebook-videos-scraper) - Scrape Facebook Watch videos data including video details and creator information.
- 🎞️ [YouTube Trending Videos/Shorts Scraper](https://apify.com/easyapi/youtube-trending-videos-shorts-scraper) - Extract trending videos and shorts from YouTube's trending page.
- 🖼️ [Pinterest Image Downloader](https://apify.com/easyapi/pinterest-image-downloader) - Easily download high-quality images from Pinterest with batch capabilities.
- 📥 [Tumblr Media Downloader](https://apify.com/easyapi/tumblr-media-downloader) - Extract and download high-quality images and videos from Tumblr posts.

# Actor input Schema

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

Search term to find media posts

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

How to sort the search results

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

Time period to search within

## `safeSearch` (type: `string`):

Enable (1) or disable (0) safe search

## `maxItems` (type: `integer`):

Maximum number of media posts to extract

## `proxyConfiguration` (type: `object`):

Optionally, use Apify Proxy or custom HTTP proxy to avoid IP address-based blocking.

## Actor input object example

```json
{
  "query": "ai",
  "sort": "relevance",
  "time": "all",
  "safeSearch": "0",
  "maxItems": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `files` (type: `string`):

No description

# 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": "ai",
    "sort": "relevance",
    "time": "all",
    "safeSearch": "0",
    "maxItems": 10,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

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

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

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

```

## Python example

```python
from apify_client import ApifyClient

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

# Prepare the Actor input
run_input = {
    "query": "ai",
    "sort": "relevance",
    "time": "all",
    "safeSearch": "0",
    "maxItems": 10,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

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

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

```

## CLI example

```bash
echo '{
  "query": "ai",
  "sort": "relevance",
  "time": "all",
  "safeSearch": "0",
  "maxItems": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call easyapi/reddit-media-search-scraper --silent --output-dataset

```

## MCP server setup

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

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

## OpenAPI specification

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