# 9GAG Post Downloader(Video & Image) (`codenest/9gag-post-downloader-video-image`) Actor

Download viral 9GAG videos & images with full metadata - post IDs, titles, uploaders, like/comment counts, tags, and multiple video codec formats (H.265/VP9/VP8/MP4).

- **URL**: https://apify.com/codenest/9gag-post-downloader-video-image.md
- **Developed by:** [CodeNest](https://apify.com/codenest) (community)
- **Categories:** Videos, Developer tools, Automation
- **Stats:** 6 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## 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

## 🎯 9GAG Post Downloader (Video & Image) - Ultimate Viral Content Downloader

**Easily download viral 9GAG posts with our powerful **9GAG Post Downloader (Video & Image)**! This Apify actor enables batch downloading of both videos and images while preserving high-quality media, complete metadata, and multiple video codec options.**

---

### 📋 Overview

Need to archive viral memes, repurpose comedy content, or analyze trending posts? This **9GAG Post Downloader (Video & Image)** delivers:

- 🎬 **Video+Image Support** - Download both media types automatically
- 🎨 **Multiple Video Codecs** - VP8, VP9, H.265, and standard MP4
- 📊 **Rich Metadata** - Titles, uploaders, engagement metrics, tags
- ⚡ **Batch Processing** - Handle 50+ URLs per run with concurrency control
- 🔍 **Smart Detection** - Auto-identifies media type and available formats

Perfect for content creators 🎭, meme archivists 📚, social media managers 📈, and data analysts 🔬!

---

### ⭐ Core Capabilities of 9GAG Post Downloader (Video & Image)

#### 🖼️ Media Options
- **Video Download** - Multiple quality formats with codec variants
- **Image Download** - High-resolution original images
- **Thumbnail Extraction** - Preview images for quick browsing
- **Bulk Mode** - Process unlimited posts concurrently

#### 📊 Metadata Mastery
- **Creator Profiles** - Uploader names and handles
- **Upload Dates** - ISO 8601 timestamp format
- **Engagement Metrics** - Like counts, comment counts, view counts
- **Content Tags** - Category labels for organization
- **Post Statistics** - Duration for videos, dimensions for images

#### 🔧 Advanced Tech Features
- **Concurrency Control** - Adjustable parallel processing (1-10 threads)
- **Smart Format Selection** - Auto-picks best available quality
- **URL Cleaner** - Removes tracking parameters automatically
- **Error Resilience** - Individual post failures don't stop batch

---

### ⚙️ Input Configuration

Simply enter 9GAG post URLs in the Input Section, configure concurrency, and click "Start". URLs look like this:

```json
{
  "urls": [
    {
      "url": "https://9gag.com/gag/aE0mVL9?utm_source=copy_link&utm_medium=post_share"
    },
    {
      "url": "https://9gag.com/gag/aXP6N0v?utm_source=copy_link&utm_medium=post_share"
    }
  ],
  "extraction_method": "auto",
  "max_concurrency": 3
}
````

#### 📝 Input Specifications

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `urls` | Array | ✅ Yes | - | 9GAG post URLs to process |
| `url` | String | ✅ Yes | - | Valid 9GAG post URL (gag/ format) |
| `extraction_method` | String | ❌ No | "auto" | "auto", "direct", or "api" method |
| `max_concurrency` | Integer | ❌ No | 3 | Parallel downloads (1-10 recommended) |

***

### 📤 Output Structure

Your **9GAG Post Downloader (Video & Image)** produces comprehensive output:

```json
[
  {
    "post_id": "aXP6N0v",
    "source_url": "https://9gag.com/gag/aXP6N0v?utm_source=copy_link&utm_medium=post_share",
    "clean_url": "https://9gag.com/gag/aXP6N0v",
    "title": "A Chinese streamer's beauty filter crashed, she lost 140,000 subscribers in a minute.",
    "description": null,
    "thumbnail": "https://img-9gag-fun.9cache.com/photo/aXP6N0v_460s.jpg",
    "upload_date": "20260419",
    "uploader": "Ché Hues",
    "duration": 4,
    "view_count": null,
    "like_count": 3933,
    "comment_count": 337,
    "tags": ["random"],
    "media_type": "video",
    "video_url": "https://img-9gag-fun.9cache.com/photo/aXP6N0v_460svvp9.webm",
    "image_url": "https://img-9gag-fun.9cache.com/photo/aXP6N0v_460s.jpg",
    "video_formats": [...],
    "error": null
  }
]
```

#### 📖 Output Field Documentation

**🔹 Post Identification**
| Field | Description |
|-------|-------------|
| `post_id` | Unique 9GAG post identifier |
| `source_url` | Original URL with tracking parameters |
| `clean_url` | URL without UTM parameters |
| `title` | Post title/caption content |

**🔹 Creator & Time Data**
| Field | Description |
|-------|-------------|
| `uploader` | Username of content uploader |
| `upload_date` | Publication date (YYYYMMDD or ISO format) |
| `duration` | Video length in seconds (null for images) |

**🔹 Engagement Metrics**
| Field | Description |
|-------|-------------|
| `like_count` | Number of upvotes received |
| `comment_count` | Total user comments |
| `view_count` | Video view count (when available) |
| `tags` | Category labels for content filtering |

**🔹 Media Assets**
| Field | Description |
|-------|-------------|
| `media_type` | "video" or "image" - auto-detected |
| `video_url` | Best quality video URL (videos only) |
| `image_url` | High-resolution image URL (both types) |
| `thumbnail` | Preview image for galleries |
| `video_formats` | All available video codec variants |

***

### 🎨 Video Format Options

The **9GAG Post Downloader (Video & Image)** automatically detects multiple codec formats:

#### Available Codecs:

1. **H.265/HEVC** - Best compression, highest quality
2. **VP9** - Modern open codec, YouTube standard
3. **VP8** - Legacy support, broad compatibility
4. **Standard MP4** - Universal playback support

#### Format Details:

| Format ID | Extension | Codec | Best For |
|-----------|-----------|-------|----------|
| `460sv-h265` | .mp4 | H.265 | Maximum quality, smaller files |
| `460sv-vp9` | .webm | VP9 | Modern browsers, efficient |
| `460sv-vp8` | .webm | VP8 | Legacy device support |
| `460sv` | .mp4 | H.264 | Universal compatibility |

***

### 🔧 Technical Features of This 9GAG Post Downloader (Video & Image)

#### 🚀 Performance Optimization

- **Concurrent Downloads** - Process up to 10 posts simultaneously
- **Smart Rate Limiting** - Avoids 9GAG restrictions automatically
- **Memory Efficient** - Streams media directly to storage
- **Resume Capable** - Continues batch even after individual failures

#### 🎯 Intelligent Detection

- **Auto Media Type** - Distinguishes videos from images
- **Format Negotiation** - Selects best available codec
- **URL Normalization** - Removes tracking garbage automatically
- **Fallback Chains** - Tries alternative formats if primary fails

#### 📊 Complete Metadata Extraction

- **Engagement Analytics** - Like/comment/view counts
- **Temporal Data** - Precise upload timestamps
- **Social Graph** - Uploader identification
- **Content Classification** - All associated tags

***

### 💡 Use Cases for 9GAG Post Downloader (Video & Image)

- **🎭 Meme Archivists** - Build personal collections of viral content
- **📱 Social Media Managers** - Repurpose trending posts for campaigns
- **📊 Data Analysts** - Track engagement patterns and viral metrics
- **🎬 Content Creators** - Gather inspiration from successful posts
- **🔬 Researchers** - Study meme evolution and internet culture
- **📚 Educators** - Create presentations with relevant examples
- **🤖 AI Trainers** - Build datasets for meme recognition models

***

### ✨ Why Choose Our 9GAG Post Downloader (Video & Image)?

- **⚡ Blazing Fast** - Concurrent downloads with optimized CDN access
- **🎯 100% Accurate** - Maintains original quality without recompression
- **🔄 Regular Updates** - Adapts to 9GAG platform changes automatically
- **📦 Complete Data** - Everything from video codecs to engagement metrics
- **🛡️ Production Ready** - Battle-tested with thousands of posts
- **💰 Cost Efficient** - Optimized to minimize compute time

***

### ⚠️ Limitations

- Only works with public 9GAG posts (non-private content)
- Some older posts may have limited format availability
- Extreme concurrency (10+) may trigger rate limiting
- Requires valid post URLs (gag/ format, not collections)

***

### 🔗🛠 Complete Social Media Downloader Suite

Explore our professional downloader collection:

#### 📱 Short-Form Content Tools:

- [Instagram Reels Downloader](https://apify.com/codenest/instagram-reels-downloader)
- [Facebook Reels Downloader](https://apify.com/codenest/facebook-reels-downloader)

#### 🎵 Video Platform Tools:

- [YouTube Video Downloader](https://apify.com/codenest/youtube-video-downloader)
- [YouTube Shorts Downloader](https://apify.com/codenest/youtube-shorts-downloader)
- [Facebook Video Downloader](https://apify.com/codenest/facebook-video-downloader)

***

### 📧 Need Custom Features for Your 9GAG Post Downloader (Video & Image)?

Want **higher resolution videos**, **specific codec preferences**, **advanced filtering**, or **custom output formats**?

✉️ Email **<codenest2.0@gmail.com>** for tailored enterprise solutions!

# Actor input Schema

## `urls` (type: `array`):

List of 9Gag post URLs to scrape. Each entry must be a 9Gag /gag/{id} URL.

## `extraction_method` (type: `string`):

Choose 'auto' to try all methods in cascade order (recommended), or force a specific method.

## `max_concurrency` (type: `integer`):

Maximum number of posts to process in parallel (1â€“10). Default is 3.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://9gag.com/gag/aE0mVL9"
    },
    {
      "url": "https://9gag.com/gag/aXP6N0v"
    }
  ],
  "extraction_method": "auto",
  "max_concurrency": 3
}
```

# 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 = {
    "urls": [
        {
            "url": "https://9gag.com/gag/aE0mVL9"
        },
        {
            "url": "https://9gag.com/gag/aXP6N0v"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("codenest/9gag-post-downloader-video-image").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 = { "urls": [
        { "url": "https://9gag.com/gag/aE0mVL9" },
        { "url": "https://9gag.com/gag/aXP6N0v" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("codenest/9gag-post-downloader-video-image").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 '{
  "urls": [
    {
      "url": "https://9gag.com/gag/aE0mVL9"
    },
    {
      "url": "https://9gag.com/gag/aXP6N0v"
    }
  ]
}' |
apify call codenest/9gag-post-downloader-video-image --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=codenest/9gag-post-downloader-video-image",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "9GAG Post Downloader(Video & Image)",
        "description": "Download viral 9GAG videos & images with full metadata - post IDs, titles, uploaders, like/comment counts, tags, and multiple video codec formats (H.265/VP9/VP8/MP4).",
        "version": "0.0",
        "x-build-id": "hUdszsyzK0thjtE0l"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/codenest~9gag-post-downloader-video-image/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-codenest-9gag-post-downloader-video-image",
                "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/codenest~9gag-post-downloader-video-image/runs": {
            "post": {
                "operationId": "runs-sync-codenest-9gag-post-downloader-video-image",
                "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/codenest~9gag-post-downloader-video-image/run-sync": {
            "post": {
                "operationId": "run-sync-codenest-9gag-post-downloader-video-image",
                "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",
                "properties": {
                    "urls": {
                        "title": "9Gag Post URLs",
                        "type": "array",
                        "description": "List of 9Gag post URLs to scrape. Each entry must be a 9Gag /gag/{id} URL.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "url": {
                                    "title": "Post URL",
                                    "description": "Examples: https://9gag.com/gag/aXP6N0v  or  https://9gag.com/gag/aXP6N0v?utm_source=copy_link&utm_medium=post_share",
                                    "type": "string",
                                    "pattern": "^https://9gag\\.com/gag/[A-Za-z0-9]+"
                                }
                            },
                            "required": [
                                "url"
                            ]
                        }
                    },
                    "extraction_method": {
                        "title": "Extraction Method",
                        "enum": [
                            "auto",
                            "yt-dlp",
                            "beautifulsoup",
                            "9gag-api",
                            "cloudscraper",
                            "playwright"
                        ],
                        "type": "string",
                        "description": "Choose 'auto' to try all methods in cascade order (recommended), or force a specific method.",
                        "default": "auto"
                    },
                    "max_concurrency": {
                        "title": "Max Concurrency",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Maximum number of posts to process in parallel (1â€“10). Default is 3.",
                        "default": 3
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
