# Pornhub Downloader (`maximedupre/pornhub-downloader`) Actor

Download public Pornhub video data from video URLs, listing URLs, or search terms. Export metadata, engagement, tags, channel details, thumbnails, and source-visible HLS links.

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

## Pricing

$4.45 / 1,000 scraped videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

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

### 🎬 Pornhub downloader for public video data

Pornhub Downloader collects public [Pornhub](https://www.pornhub.com/) video data from direct video URLs, listing URLs, search pages, or plain search terms. Use this Pornhub downloader when you need repeatable exports for content review, research, cataloging, moderation support, media operations, or an API workflow.

For a quick first run, add one Pornhub video URL or search term, keep **Maximum discovery videos** at `25`, and start the Actor. The run saves one row per accepted public video with the source view key, title, description, duration, upload date, thumbnail, engagement, tags, categories, performers, channel details, discovery context, and source-visible media links when Pornhub exposes them.

### ✅ What this Actor does

- Accepts public Pornhub video URLs.
- Accepts Pornhub listing URLs and search result pages.
- Accepts plain search terms and discovers matching public videos.
- Lets you filter discovered videos by production type and duration.
- Saves one dataset row per accepted public video.
- Returns video metadata, engagement, taxonomy, channel details, thumbnails, and media variants when available.
- Pushes accepted rows during the run so you can inspect early results before a larger job finishes.
- Skips duplicate or unsupported targets instead of filling your export with failure rows.

This Actor is built for public Pornhub pages. It does not use a Pornhub account, cookies, Premium access, private content, or a browser extension.

### 📦 Data you can export

Each saved video can include:

- `viewKey` - Pornhub's source-native video identifier.
- `title`, `description`, `durationSeconds`, `uploadDate`, and `thumbnailUrl`.
- `engagement.views`, `engagement.upvotes`, `engagement.downvotes`, `engagement.likePercent`, and `engagement.favorites`.
- `taxonomy.categories`, `taxonomy.tags`, `taxonomy.performers`, and `taxonomy.production`.
- `channel.name`, `channel.url`, `channel.videoCount`, and `channel.subscriberCount`.
- `media.masterPlaylistUrl` and `media.variants` with quality, dimensions, content type, and media URL when the source exposes playable links.
- `discovery` context, including the search term, listing or search URL, and result rank when the video came from discovery.

You can open the dataset in Apify, export it as JSON, CSV, Excel, XML, RSS, or HTML, call it from the Apify API, schedule recurring runs, or connect the results to webhooks and integrations.

### 🚀 How to run

1. Add one target per row in **Pornhub targets**.
2. Use direct video URLs when you already know the exact videos.
3. Use listing URLs, search URLs, or plain search terms when you want discovery.
4. Set **Maximum discovery videos** to cap search and listing output.
5. Choose optional production and duration filters for discovery targets.
6. Start the Actor and open the dataset.

Example targets:

```text
https://www.pornhub.com/view_video.php?viewkey=ph5f1b2c3d4e5f6
https://www.pornhub.com/video/search?search=example
example search term
````

### 🔧 Input options

| Field | What to enter |
| ----- | ------------- |
| `targets` | One Pornhub video URL, listing URL, search URL, or plain search term per row. |
| `maxItems` | Maximum videos to collect from search terms and listing URLs. Default is `25`; maximum is `5000`. |
| `production` | Discovery filter for all videos, professional videos, or homemade videos. |
| `minDuration` | Optional minimum duration filter for discovery targets. |
| `maxDuration` | Optional maximum duration filter for discovery targets. |

Direct video URLs are resolved as individual videos. Discovery targets use **Maximum discovery videos** so run size and spend stay predictable.

### 📤 Output example

```json
{
	"viewKey": "ph5f1b2c3d4e5f6",
	"title": "Example video title",
	"description": "Source video description when available.",
	"durationSeconds": 742,
	"uploadDate": "2026-06-01",
	"thumbnailUrl": "https://ei.phncdn.com/videos/202606/01/123456/original/(m=eaAaGwObaaaa)(mh=example).jpg",
	"engagement": {
		"views": 1234567,
		"upvotes": 12345,
		"downvotes": 321,
		"likePercent": 97,
		"favorites": 4567
	},
	"taxonomy": {
		"categories": ["Category"],
		"tags": ["tag"],
		"performers": ["Performer Name"],
		"production": "professional"
	},
	"channel": {
		"name": "Channel Name",
		"url": "https://www.pornhub.com/channels/channel-name",
		"videoCount": 120,
		"subscriberCount": 456789
	},
	"media": {
		"masterPlaylistUrl": "https://example.com/master.m3u8",
		"variants": [
			{
				"quality": "720p",
				"width": 1280,
				"height": 720,
				"contentType": "application/vnd.apple.mpegurl",
				"mediaUrl": "https://example.com/720p.m3u8"
			}
		]
	},
	"discovery": {
		"query": "example search term",
		"listingUrl": "https://www.pornhub.com/video/search?search=example+search+term",
		"rank": 1
	}
}
```

### 💳 Pricing

This Actor uses pay-per-event pricing. You are charged `$0.00445` for each accepted public video saved by the Actor, which is `$4.45` per 1,000 accepted videos.

Targets that do not produce an accepted video, such as invalid, duplicate, unsupported, unavailable, or no-result targets, do not create scraped-video events. Use **Maximum discovery videos** to keep test runs small and cap larger discovery jobs.

### ⚠️ Limits and caveats

The Actor works with public Pornhub pages and the data Pornhub exposes for those pages at run time. Some videos may have missing descriptions, engagement counts, channel facts, taxonomy values, thumbnails, or media variants. In those cases, the Actor saves the available data and leaves unavailable values empty.

Source-visible media URLs can depend on Pornhub availability and playback rules after your run. If a downstream tool needs fresh links, rerun the Actor for the same target.

Discovery targets stop when the Actor reaches **Maximum discovery videos** or when Pornhub stops returning matching public videos for the submitted listing, search page, or search term.

### ❓ FAQ

#### Can I use search terms instead of Pornhub URLs?

Yes. Add one plain search term per row in **Pornhub targets**. The Actor converts it into Pornhub search discovery and saves matching public videos up to **Maximum discovery videos**.

#### Does this Actor download hosted video files?

No. It exports public video metadata and source-visible media links. It does not copy files into Apify storage or create ZIP archives.

#### Does it need cookies, login, or a Pornhub account?

No. The normal workflow is for public pages and does not require Pornhub cookies, login, a browser extension, or a source API key.

#### Why did a target return no videos?

The target may be invalid, unsupported, duplicated, unavailable, restricted, temporarily empty, or not exposing accepted public videos during the run. The Actor continues with the next target and keeps the dataset focused on successful video results.

### 📝 Changelog

- 0.1: Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~pornhub-downloader/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Other actors

- [RedGifs Bulk Downloader ↗](https://apify.com/maximedupre/redgifs-bulk-downloader) - Download RedGifs video links, metadata, tags, thumbnails, and optional hosted files.
- [AShemaleTube Downloader ↗](https://apify.com/maximedupre/ashemaletube-downloader) - Extract public AShemaleTube HLS links, titles, durations, thumbnails, and tags.
- [OnlyFans Downloader ↗](https://apify.com/maximedupre/onlyfans-downloader) - Export media URLs and post context from OnlyFans content you can access.
- [Facebook Media Downloader ↗](https://apify.com/maximedupre/facebook-media-downloader) - Download public Facebook video and reel links with captions, thumbnails, and engagement counts.
- [Instagram Downloader API ↗](https://apify.com/maximedupre/instagram-downloader-api) - Extract public Instagram media URLs, captions, thumbnails, and engagement counts.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

## `targets` (type: `array`):

Add one Pornhub video URL, listing URL, or search term per row.

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

Maximum videos to collect from search terms and listing URLs.

## `production` (type: `string`):

Choose which production type to collect from discovery targets.

## `minDuration` (type: `string`):

Keep discovery results at or above this video length.

## `maxDuration` (type: `string`):

Keep discovery results at or below this video length.

## Actor input object example

```json
{
  "targets": [
    "indian"
  ],
  "maxItems": 64,
  "production": "all",
  "minDuration": "none",
  "maxDuration": "none"
}
```

# Actor output Schema

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

Open the dataset with one accepted public Pornhub video per row.

# 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 = {
    "targets": [
        "indian"
    ],
    "maxItems": 64
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/pornhub-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 = {
    "targets": ["indian"],
    "maxItems": 64,
}

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/pornhub-downloader").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 '{
  "targets": [
    "indian"
  ],
  "maxItems": 64
}' |
apify call maximedupre/pornhub-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=maximedupre/pornhub-downloader",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Pornhub Downloader",
        "description": "Download public Pornhub video data from video URLs, listing URLs, or search terms. Export metadata, engagement, tags, channel details, thumbnails, and source-visible HLS links.",
        "version": "0.1",
        "x-build-id": "yi7YNXNoFQ3a6HyIV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maximedupre~pornhub-downloader/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maximedupre-pornhub-downloader",
                "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/maximedupre~pornhub-downloader/runs": {
            "post": {
                "operationId": "runs-sync-maximedupre-pornhub-downloader",
                "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/maximedupre~pornhub-downloader/run-sync": {
            "post": {
                "operationId": "run-sync-maximedupre-pornhub-downloader",
                "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",
                "required": [
                    "targets"
                ],
                "properties": {
                    "targets": {
                        "title": "Pornhub targets",
                        "minItems": 1,
                        "maxItems": 500,
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Add one Pornhub video URL, listing URL, or search term per row.",
                        "items": {
                            "type": "string",
                            "minLength": 1
                        }
                    },
                    "maxItems": {
                        "title": "Maximum discovery videos",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum videos to collect from search terms and listing URLs.",
                        "default": 64
                    },
                    "production": {
                        "title": "Production",
                        "enum": [
                            "all",
                            "professional",
                            "homemade"
                        ],
                        "type": "string",
                        "description": "Choose which production type to collect from discovery targets.",
                        "default": "all"
                    },
                    "minDuration": {
                        "title": "Minimum duration",
                        "enum": [
                            "none",
                            "10",
                            "20",
                            "30"
                        ],
                        "type": "string",
                        "description": "Keep discovery results at or above this video length.",
                        "default": "none"
                    },
                    "maxDuration": {
                        "title": "Maximum duration",
                        "enum": [
                            "none",
                            "10",
                            "20",
                            "30"
                        ],
                        "type": "string",
                        "description": "Keep discovery results at or below this video length.",
                        "default": "none"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
