# XFantazy Downloader (`maximedupre/xfantazy-downloader`) Actor

Download-ready XFantazy video data from public video URLs. Export direct source-hosted MP4 links, quality labels, titles, durations, thumbnails, tags, and fresh media URL expiry hints.

- **URL**: https://apify.com/maximedupre/xfantazy-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

$2.65 / 1,000 resolved 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

### 📥 XFantazy downloader for public video URLs

XFantazy Downloader turns public [XFantazy](https://xfantazy.com/) video page URLs into structured Apify dataset rows with direct source-hosted media links. Paste one or more XFantazy video URLs and get video IDs, source URLs, titles, durations, thumbnails, uploader or channel details, tags, quality labels, file sizes, and media URL expiry times when XFantazy exposes them.

Use this XFantazy downloader when you already have video URLs and need repeatable exports for content review, cataloging, media operations, research, or an API pipeline. The Actor works with public, reachable XFantazy video pages only. You do not need an XFantazy account, cookies, a browser extension, local playback, or a separate source API key.

For a small first run, paste a few public XFantazy video page URLs and start the Actor. When the output shape fits your workflow, add a larger batch, schedule the Actor, export the dataset, or call it through the Apify API.

### ✅ What this Actor does

- Accepts public XFantazy `/video/...` page URLs.
- Resolves multiple video URLs in one run.
- Saves one dataset row per successfully resolved video.
- Returns direct source-hosted media URLs when XFantazy exposes them.
- Keeps all detected playable variants in `mediaVariants`, including source quality labels and dimensions when known.
- Adds title, video ID, source URL, duration, thumbnail URL, uploader or channel details, publication date, and tags when those values are public.
- Parses media URL expiry timestamps from signed source URLs when available.
- Skips invalid, unsupported, private, removed, blocked, account-only, or no-media targets without saving paid failure rows.

This Actor is URL-first. It does not search XFantazy, crawl categories, follow recommendations, unlock premium or account-only media, download files into Apify storage, create ZIP archives, transcode videos, or install a browser extension.

### 📦 Data you can export

Each output row represents one public XFantazy video where at least one direct source-hosted media link was found. Core fields include:

- `submittedUrl` - the XFantazy URL you submitted.
- `videoId` - XFantazy video identifier when available.
- `videoUrl` - source-confirmed XFantazy video page URL.
- `title` - video title when available.
- `durationSeconds` - video duration in seconds when available.
- `thumbnailUrl` - source thumbnail or poster image URL when available.
- `uploaderName` and `uploaderUrl` - uploader, channel, or profile details when available.
- `publishedAt` - source publication timestamp when available.
- `tags` - source tags and categories.
- `mediaVariants` - direct media links with `mediaUrl`, `quality`, `width`, `height`, `contentType`, `fileSizeBytes`, and `expiresAt`.

Direct media URLs can be signed and time-limited. Use `mediaVariants[].expiresAt` to decide when to consume or refresh a result. The Actor does not invent missing metadata; nullable fields stay empty when XFantazy does not expose the value.

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

### 🚀 How to run

1. Open the Actor input.
2. Add one or more public XFantazy video page URLs in **XFantazy video URLs**.
3. Start the Actor.
4. Open the dataset.
5. Use `mediaVariants[].mediaUrl` for the direct source-hosted media links.

The Actor pushes successful rows while the run is active, so you can inspect early results before a larger batch finishes.

### 🔎 Input

The public input has one required field:

```json
{
	"startUrls": [
		{
			"url": "https://xfantazy.com/video/example-video"
		}
	]
}
````

The Actor does not expose proxy, browser, retry, quality, cookie, account, storage, ZIP, or download-file settings. Those are not needed for the approved public-video workflow.

### 📤 Output example

```json
{
	"submittedUrl": "https://xfantazy.com/video/example-video",
	"videoId": "abc123",
	"videoUrl": "https://xfantazy.com/video/example-video",
	"title": "Example video title",
	"durationSeconds": 197,
	"thumbnailUrl": "https://s.xfantazy.com/thumbnail/example/w960/0",
	"uploaderName": "Example channel",
	"uploaderUrl": "https://xfantazy.com/channel/example-channel",
	"publishedAt": "2026-06-25T19:23:53.000Z",
	"tags": ["example", "hd"],
	"mediaVariants": [
		{
			"mediaUrl": "https://media.example/video-360p.mp4?temp_url_expires=1782502322",
			"quality": "360p",
			"width": 640,
			"height": 360,
			"contentType": "video/mp4",
			"fileSizeBytes": 18434649,
			"expiresAt": "2026-06-26T19:32:02.000Z"
		}
	]
}
```

Rows are success-only. If a submitted URL cannot be resolved into at least one direct source-hosted media link, the Actor logs the outcome and does not create a placeholder row.

### 💳 Pricing

This Actor uses pay-per-event pricing. You are charged for each accessible XFantazy video that is saved to the dataset with at least one direct media link. Invalid URLs, unsupported pages, private pages, account-only videos, blocked pages, no-media targets, and empty outputs are not charged as resolved videos.

The current event price is $0.00265 per resolved video, or $2.65 per 1,000 successful videos.

### ⚠️ Limits and access

- Only public XFantazy video page URLs are supported.
- The Actor returns fresh source-hosted media URLs; it does not store XFantazy videos in Apify storage.
- Some media URLs may expire. Rerun the Actor to refresh them.
- Some XFantazy pages expose only public preview or trailer-quality media, while higher-quality or original files may be blocked by the source.
- Public source pages can expose different metadata by video, region, or run time.
- Use the Actor only for videos you are authorized to access, process, or download.

### ❓ FAQ

#### 🔐 Do I need XFantazy cookies or an account?

No. The Actor is built for public XFantazy video pages and does not ask for XFantazy credentials, cookies, local browser state, or extension data.

#### 📁 Does this Actor download MP4 files into Apify storage?

No. It returns direct source-hosted media links in the dataset. It does not mirror, transcode, zip, or rehost video files.

#### 🎚️ Can I choose a preferred quality?

The Actor returns all source-exposed variants it can validate, including quality labels such as `360p` when XFantazy exposes them. Choose the variant you want from the dataset.

#### 🔎 Why did a URL produce no row?

The Actor saves rows only when it finds at least one direct source-hosted media link. Removed, private, account-only, blocked, unsupported, or no-media pages are reported in logs instead of being saved as failed rows.

#### 🔌 Can I use the results through an API?

Yes. The output is an Apify dataset, so you can fetch it through the Apify API, export it in common formats, schedule runs, or connect it to downstream workflows.

### 📝 Changelog

- 0.1: Initial release.

### 🆘 Support

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

### 🔗 Other actors

- [XVideos Downloader ↗](https://apify.com/maximedupre/xvideos-downloader) - Extract direct MP4/HLS links and metadata from public XVideos URLs.
- [XNXX Video Downloader ↗](https://apify.com/maximedupre/xnxx-video-downloader) - Resolve public XNXX video URLs or IDs into direct media links and metadata.
- [PornTrex Downloader ↗](https://apify.com/maximedupre/porntrex-downloader) - Export direct media links and metadata from public PornTrex video URLs.
- [SpankBang Downloader ↗](https://apify.com/maximedupre/spankbang-downloader) - Get direct media links, quality variants, and metadata from public SpankBang URLs.
- [RedGifs Bulk Downloader ↗](https://apify.com/maximedupre/redgifs-bulk-downloader) - Collect public RedGifs video links, metadata, thumbnails, and tags.

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

# Actor input Schema

## `startUrls` (type: `array`):

Paste public XFantazy video page URLs to resolve in this run.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://xfantazy.com/video/5d2047db188a6055cfddbe42"
    },
    {
      "url": "https://xfantazy.com/video/604a5d98d7357618a3d7dffd"
    },
    {
      "url": "https://xfantazy.com/video/5d20a4715b5ea9558d56c49c"
    },
    {
      "url": "https://xfantazy.com/video/670ad11749662e7b5b60bca8"
    },
    {
      "url": "https://xfantazy.com/video/5d1fe0357dec725593aa49d0"
    }
  ]
}
```

# Actor output Schema

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

Open the default dataset with one successful XFantazy 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 = {
    "startUrls": [
        {
            "url": "https://xfantazy.com/video/5d2047db188a6055cfddbe42"
        },
        {
            "url": "https://xfantazy.com/video/604a5d98d7357618a3d7dffd"
        },
        {
            "url": "https://xfantazy.com/video/5d20a4715b5ea9558d56c49c"
        },
        {
            "url": "https://xfantazy.com/video/670ad11749662e7b5b60bca8"
        },
        {
            "url": "https://xfantazy.com/video/5d1fe0357dec725593aa49d0"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/xfantazy-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 = { "startUrls": [
        { "url": "https://xfantazy.com/video/5d2047db188a6055cfddbe42" },
        { "url": "https://xfantazy.com/video/604a5d98d7357618a3d7dffd" },
        { "url": "https://xfantazy.com/video/5d20a4715b5ea9558d56c49c" },
        { "url": "https://xfantazy.com/video/670ad11749662e7b5b60bca8" },
        { "url": "https://xfantazy.com/video/5d1fe0357dec725593aa49d0" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/xfantazy-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 '{
  "startUrls": [
    {
      "url": "https://xfantazy.com/video/5d2047db188a6055cfddbe42"
    },
    {
      "url": "https://xfantazy.com/video/604a5d98d7357618a3d7dffd"
    },
    {
      "url": "https://xfantazy.com/video/5d20a4715b5ea9558d56c49c"
    },
    {
      "url": "https://xfantazy.com/video/670ad11749662e7b5b60bca8"
    },
    {
      "url": "https://xfantazy.com/video/5d1fe0357dec725593aa49d0"
    }
  ]
}' |
apify call maximedupre/xfantazy-downloader --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "XFantazy Downloader",
        "description": "Download-ready XFantazy video data from public video URLs. Export direct source-hosted MP4 links, quality labels, titles, durations, thumbnails, tags, and fresh media URL expiry hints.",
        "version": "0.1",
        "x-build-id": "KkHCBkpag9k4Ut3dw"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maximedupre~xfantazy-downloader/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maximedupre-xfantazy-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~xfantazy-downloader/runs": {
            "post": {
                "operationId": "runs-sync-maximedupre-xfantazy-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~xfantazy-downloader/run-sync": {
            "post": {
                "operationId": "run-sync-maximedupre-xfantazy-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": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "XFantazy video URLs",
                        "minItems": 1,
                        "type": "array",
                        "description": "Paste public XFantazy video page URLs to resolve in this run.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "title": "URL",
                                    "type": "string",
                                    "description": "A public XFantazy video page URL, such as https://xfantazy.com/video/example-video.",
                                    "pattern": "^https?://"
                                }
                            }
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
