# Reddit Video Downloader: Images, Galleries & Videos (`accountable_eel/reddit-media-downloader`) Actor

Downloads Reddit images, galleries, videos with sound, and GIFs into run Key-Value store by keyword, subreddit or post URL. Real ffprobe metadata, no login.

- **URL**: https://apify.com/accountable_eel/reddit-media-downloader.md
- **Developed by:** [Adriana Voss](https://apify.com/accountable_eel) (community)
- **Categories:** Social media, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.56 / 1,000 stored media files

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/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 Video Downloader: Images, Galleries & Videos

Finds Reddit posts by search keyword, subreddit or direct post URL and downloads their media directly into your run's key-value store: images, full galleries, merged MP4 videos with audio, and animated GIFs.

Every file gets a SHA-256 checksum computed while streaming, and videos are probed with ffprobe for duration, resolution, fps, codec and audio presence. No login or cookies required.

### Who it's for

- **Media archivists & researchers**: Back up high-resolution photography, video footage, and multi-image galleries from targeted subreddits or topics.
- **Dataset & ML pipelines**: Collect clean image and video training data with structured metadata (title, author, score, dimensions, duration, SHA-256).
- **Content curators**: Extract original Reddit videos with audio merged and synchronized, without manual screen recording or watermarks.

### Why this one

- **Merged video & audio**: Reddit hosts video and audio on separate DASH streams. This actor inspects `DASHPlaylist.mpd`, grabs the best video track (up to 720p) and audio track, and merges them losslessly via ffmpeg into a complete MP4.
- **Complete gallery support**: Multi-image galleries (`media_metadata` + `gallery_data`) are extracted in their exact original order with individual `galleryIndex` tracking.
- **Direct CDN downloads**: Reddit API endpoints use UNBLOCKER proxies to bypass bot blocks, but media downloads (`i.redd.it`, `v.redd.it`) stream directly for fast, efficient fetching.
- **Real ffprobe specs**: Every downloaded video is probed for actual dimensions, duration, fps, codec, and whether it has sound (`hasAudio`).
- **Fair pay-per-event pricing**: Skipped external links, NSFW posts (when excluded), duplicate posts, and failed downloads are never billed.

### What you get

One row per stored file by default (or one row per source when "Expand rows" is disabled).

| Field | Type | Description |
|---|---|---|
| `postId` / `postUrl` | text / link | Reddit post ID (e.g. `1wv7eqf`) and permanent post link |
| `subreddit` | text | Subreddit name without prefix (e.g. `EarthPorn`) |
| `source` / `sourceValue` | text | `query`, `subreddit`, or `post`, and the search query, subreddit or post URL it came from |
| `kind` | text | Media type: `image`, `video`, or `gif` |
| `galleryIndex` | number | Zero-based index within a gallery post (null for single items) |
| `kvKey` / `kvUrl` | text / link | Storage key in your run's Key-Value store and direct API download URL |
| `originalMediaUrl` | link | Original source URL on `i.redd.it`, `v.redd.it`, or `preview.redd.it` |
| `bytes` / `sha256` | number / text | Exact file size in bytes and hex SHA-256 checksum |
| `width` / `height` | number | Pixel dimensions from metadata or ffprobe |
| `duration_s` / `fps` / `codec` / `hasAudio` | number / text / boolean | ffprobe metrics for video files (null for stills) |
| `title` / `author` / `score` / `numComments` | text / number | Post submission metadata from Reddit |
| `createdAt` | date | Post creation timestamp in ISO 8601 |
| `skipped` / `error` | text | Skip reason (`external-host`, `nsfw`, `duplicate`) or failure error message (unbilled) |

### Scope and limits

- **Supported hosts**: Native Reddit media (`i.redd.it`, `v.redd.it`, `preview.redd.it`) and direct `i.imgur.com` files are downloaded. Third-party video hosts (YouTube, RedGifs) and complex external galleries are skipped without billing.
- **NSFW filter**: Off by default. When `includeNsfw` is false, 18+ posts are skipped and never billed.
- **Resolution cap**: Video DASH streams select the highest quality representation up to 720p to balance visual fidelity with download speeds and storage efficiency.
- **Storage**: Files are saved into the run's private Key-Value store. Accessing `kvUrl` requires your Apify API token.

### Pricing

- **File stored**: $6 per 1,000 files
- **Megabyte downloaded**: $0.005 per MB

Plus a $0.003 start fee per run. Each event above is billed independently, only when it actually returns data — misses (`found:false`) are never charged.

Billing is per stored file (`file` event) plus per megabyte stored, rounded up per file (`megabyte` event). Misses, duplicates, external-host skips, NSFW skips, and over-cap files are strictly free.

### Example runs

1. **Download top weekly photos from r/EarthPorn**
   ```json
   {
     "subreddits": ["EarthPorn"],
     "sort": "top",
     "time": "week",
     "maxPostsPerSource": 10,
     "kinds": "images"
   }
   ```

2. **Search and archive video clips across Reddit**
   ```json
   {
     "queries": ["highland cow"],
     "sort": "top",
     "time": "all",
     "maxPostsPerSource": 5,
     "kinds": "videos"
   }
   ```

3. **Download media from specific Reddit post URLs**
   ```json
   {
     "posts": [
       "https://www.reddit.com/r/EarthPorn/comments/1wwbnul/",
       "https://www.reddit.com/r/videos/comments/1wv7eqf/"
     ],
     "kinds": "all"
   }
   ```

Use-case variant candidate: none

### How to use

1. **In the Apify Console.** Open the actor page and click **Start** — the `queries` field is already pre-filled with a working example. Results land in the run's dataset as soon as each item is found.
2. **Via the API.** Call it directly with a POST request — no Console needed once you have an API token:
   ```bash
   curl "https://api.apify.com/v2/acts/accountable_eel~reddit-media-downloader/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
     -X POST \
     -H "Content-Type: application/json" \
     -d '{"queries":["nature photography"]}'
   ```
3. **On a schedule.** Save this actor as an Apify **Task** with the input you want, then add a **Schedule** (hourly, daily, weekly) so it runs on its own — no server of your own required.

### Input

```json
{
  "queries": [
    "nature photography"
  ]
}
```

One search term per line to search across Reddit. You can also specify subreddits or post URLs in the fields below. At least one of queries, subreddits, or posts must be non-empty. Accepted formats: nature photography, timelapse.

### Sample output

| query | found | status | postId | postUrl | subreddit | source | sourceValue | kind | galleryIndex | kvKey | kvUrl | originalMediaUrl | bytes | sha256 | width | height | duration_s | fps | codec | hasAudio | title | author | score | numComments | createdAt | skipped | error | scrapedAt |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| nature photography | true | OK | <post id> | <post url> | <subreddit> | <source type> | <source> | <file kind> | <gallery index> | <storage key> | <storage url> | <original media url> | \<size (bytes)> | <sha-256> | <width> | <height> | \<duration (s)> | <fps> | <codec> | <has audio> | <post title> | <author> | <score> | <comments> | <created at> | <skipped reason> | <error> | 1970-01-01T00:00:00.000Z |

### Use it from Clay, n8n, Make, or an AI agent

This actor runs synchronously over plain HTTP — call it directly from a script, a workflow tool, or an AI agent, no Apify Console needed once you have an API token.

```bash
curl "https://api.apify.com/v2/acts/accountable_eel~reddit-media-downloader/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"queries":["nature photography"]}'
```

**n8n.** Add an HTTP Request node: Method `POST`, URL `https://api.apify.com/v2/acts/accountable_eel~reddit-media-downloader/run-sync-get-dataset-items?token=<YOUR_TOKEN>`, Body Content Type `JSON`, JSON Body `{"queries":["nature photography"]}` (swap in an expression from an earlier node for a real value).

**Clay.** Add an "HTTP API" column: Method `POST`, URL `https://api.apify.com/v2/acts/accountable_eel~reddit-media-downloader/run-sync-get-dataset-items?token=<YOUR_TOKEN>`, Body `{"queries":["{{source}}"]}`, mapping the row's source into the `queries` array.

**MCP.** In Claude, Cursor, or any MCP client with the Apify MCP server, ask for "Reddit Video Downloader: Save Images and MP4" — the agent will find and run this actor.

### Related actors

- [Reddit Search Scraper: New Posts Alerts by Keyword & Subreddit](https://apify.com/accountable_eel/reddit-search-lookup): post text, scores and comments for a keyword or subreddit, and only the new posts on a schedule.

### Tips

- Set `maxPostsPerSource` to a modest number (e.g. 5-10) when exploring new subreddits to test content types.
- Select `kinds: "videos"` to filter exclusively for video submissions.
- Toggle `includeNsfw: true` if scraping communities designated 18+ by Reddit.

# Actor input Schema

## `queries` (type: `array`):

One search term per line to search across Reddit. You can also specify subreddits or post URLs in the fields below. At least one of queries, subreddits, or posts must be non-empty. Accepted formats: nature photography, timelapse. You're only charged for the ones we actually find — a miss costs nothing.

## `testRun` (type: `boolean`):

Turn this on to test your input on a small sample before running the full list. Turn it off to process everything.

## `onlyFound` (type: `boolean`):

Only keep rows where something was actually found. Misses are always free, whether or not you show them here.

## `includeKeywords` (type: `array`):

Optional. Only keep results that mention at least one of these words (e.g. a job title, a city, a product name). Leave empty to keep everything.

## `excludeKeywords` (type: `array`):

Optional. Drop any result that mentions one of these words. Leave empty to skip nothing.

## `maxResults` (type: `integer`):

Optional. Stop the run once this many results have been found — useful for a quick, cheap sample. Leave blank for no limit.

## `subreddits` (type: `array`):

Subreddit names or URLs, one per line, e.g. EarthPorn or r/EarthPorn.

## `posts` (type: `array`):

Direct Reddit post URLs, one per line, e.g. https://www.reddit.com/r/EarthPorn/comments/.../

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

How to sort posts: relevance (queries only), new, or top.

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

Time filter for top or relevance search: day, week, month, year, or all.

## `maxPostsPerSource` (type: `integer`):

Max posts to fetch per query or subreddit. Default 25.

## `kinds` (type: `string`):

Filter media kinds: all, images, or videos.

## `includeNsfw` (type: `boolean`):

Off by default. When false, skip over_18 posts (never billed).

## `maxMb` (type: `integer`):

Aborts a single file's download once it exceeds this size in MB. Default 100.

## `skipDuplicatePosts` (type: `boolean`):

On by default. Skip posts already processed earlier in this run.

## `columns` (type: `array`):

Choose which pieces of information to include in each result row. All are included by default.

## `expandRows` (type: `boolean`):

When on, each file found gets its own row instead of being grouped under its source. You're still only charged once per source, no matter how many rows it produces.

## `maxConcurrency` (type: `integer`):

Parallel requests. Keep conservative — this target has no browser fallback, so getting blocked costs more than slow-and-steady.

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

Apify Proxy config. Residential recommended for anti-bot-sensitive targets.

## Actor input object example

```json
{
  "queries": [
    "nature photography"
  ],
  "testRun": false,
  "onlyFound": false,
  "includeKeywords": [],
  "excludeKeywords": [],
  "subreddits": [
    "EarthPorn"
  ],
  "posts": [],
  "sort": "top",
  "time": "week",
  "maxPostsPerSource": 25,
  "kinds": "all",
  "includeNsfw": false,
  "maxMb": 100,
  "skipDuplicatePosts": true,
  "columns": [
    "postId",
    "postUrl",
    "subreddit",
    "source",
    "sourceValue",
    "kind",
    "galleryIndex",
    "kvKey",
    "kvUrl",
    "originalMediaUrl",
    "bytes",
    "sha256",
    "width",
    "height",
    "duration_s",
    "fps",
    "codec",
    "hasAudio",
    "title",
    "author",
    "score",
    "numComments",
    "createdAt",
    "skipped",
    "error"
  ],
  "expandRows": true,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "UNBLOCKER"
    ]
  }
}
```

# Actor output Schema

## `results` (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 = {
    "queries": [
        "nature photography"
    ],
    "includeKeywords": [],
    "excludeKeywords": [],
    "subreddits": [
        "EarthPorn"
    ],
    "posts": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("accountable_eel/reddit-media-downloader").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 = {
    "queries": ["nature photography"],
    "includeKeywords": [],
    "excludeKeywords": [],
    "subreddits": ["EarthPorn"],
    "posts": [],
}

# Run the Actor and wait for it to finish
run = client.actor("accountable_eel/reddit-media-downloader").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 '{
  "queries": [
    "nature photography"
  ],
  "includeKeywords": [],
  "excludeKeywords": [],
  "subreddits": [
    "EarthPorn"
  ],
  "posts": []
}' |
apify call accountable_eel/reddit-media-downloader --silent --output-dataset

```

## MCP server setup

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

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/QeoU1Z1UDFCJV6vAm/builds/cM1DrCcZScidrAsI6/openapi.json
