# Facebook Video Downloader (`utils/facebook-video-downloader`) Actor

Download Facebook videos, reels and watch links as MP4 (video + audio merged) - no login needed for public posts. Batch up to 5 links per run, pick a quality ceiling, parallel downloads, never-fail dataset output. Pricing: per-minute by quality tier, see README. JSON API for developers and AI agents

- **URL**: https://apify.com/utils/facebook-video-downloader.md
- **Developed by:** [Oliver Queen](https://apify.com/utils) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.00 / 1,000 videos downloaded (1080p)

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/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

Turn any list of Facebook links into ready-to-download **MP4** video files with sound included — a reel, a page video, a `/watch` link, a shared post — fully automatic, **no login, no cookies, no API key** for public posts. A **Facebook video downloader** built for both people and pipelines.

| | |
|---|---|
| **Per-minute pricing by quality** | From **$0.004 to $0.009 per started minute**, depending on the delivered quality tier. See the pricing table below. Raw link delivery is **$0.002 per video**. |
| **Real MP4 files** | Video and audio are merged into a single `.mp4` that plays anywhere — no separate audio track to combine. Need audio only? Choose **MP3 output**, a **raw link** instead of a stored file, or **metadata only** for a row with no file at all. |
| **Quality you choose** | Cap the download at any height: up to **1080p**, 720p or 480p. |
| **Every public link type** | Reels, page videos, `/watch/?v=` links, `/share/...` links and legacy permalinks. |
| **Free** | Up to **5 videos per run**, downloaded in parallel. |
| **Self-healing** | A failed fetch is automatically retried on a different connection. |
| **Never-fail runs** | The run always finishes with one dataset row per video — successes and failures alike, with a machine-readable `errorClass`. |
| **Bring your own S3 (optional)** | Deliver files straight to your own S3-compatible bucket (AWS S3, Cloudflare R2, MinIO, B2) — the key-value store stays the main store and is always the fallback. |

### How to download video from Facebook

1. Open the actor and click **Add item** under *Facebook videos*.
2. Paste a Facebook URL — a video, reel, `/watch/?v=...` or `/share/...` link. Optionally set **Video Quality** per video.
3. Add up to **5 videos** per run.
4. Hit **Run**. When it finishes, grab the files from the **Output ▸ Download** column — or take them straight from the API.

Quality is a **ceiling**, not a promise of an exact height: pick *Best* to take the highest available (up to 1080p), or 720p / 480p to cap the download. The delivered file is never higher than the ceiling and may be lower when the source has nothing higher.

### How much does it cost to download Facebook video?

Pricing is **per started minute**, and the per-minute price depends on the quality tier of the delivered file. Each tier is a separate event, charged at most **once per run**:

| Event | Quality tier | Price / started minute |
|---|---|---|
| `VIDEO_DOWNLOADED_SD` | 480p and below | **$0.004** |
| `VIDEO_DOWNLOADED_720P` | 720p | **$0.006** |
| `VIDEO_DOWNLOADED_1080P` | 1080p and above | **$0.009** |

- **Started minutes** = `max(1, ceil(duration / 60))`. A 3.5-minute video bills **4** started minutes; a 30-second reel bills **1**.
- The tier is read from the delivered file. A source taller than 1080p is delivered and billed as 1080p — **1080p is the product cap**. If the height cannot be determined, the **720p** tier is used.
- A **$0.00005** actor-start event applies once per run.
- Three optional inputs — **MP3** output, **metadata only** and **link** delivery — bill a **flat per-result** price instead of the per-minute tiers; see *MP3, metadata-only and link output* below.

*Examples:*

- A **30-second 480p** reel → **1 started minute × $0.004 = $0.004**
- A **3-minute 1080p** video → 3 × $0.009 = **$0.027**
- A **3.5-minute 1080p** video → 4 × $0.009 = **$0.036**
- A **10-minute 720p** video → 10 × $0.006 = **$0.06**
- A **20-minute 1080p** video → 20 × $0.009 = **$0.18**

#### MP3, metadata-only and link output

Three optional inputs change what a video delivers, and each has its own
flat per-result price — **charged once per video**, never per minute:

| Option | Event | Price / result | When charged |
|---|---|---|---|
| `outputFormat: "mp3"` | `AUDIO_DOWNLOADED_MP3` | **$0.005** | when the video's download starts (once per video, kept if the download later fails) |
| `metadataOnly: true` | `METADATA_ONLY` | **$0.002** | only when the metadata row is delivered; a failed row is **$0** |
| `delivery: "link"` | `LINK_DELIVERED` | **$0.002** | only when the link row is delivered; extraction only (no file, no storage); a failed row is **$0** |

- **`outputFormat: "mp3"`** — the video is fetched exactly as usual, then its
  audio track is extracted and delivered as an `.mp3` file (the `.mp4` is
  removed). Use it for music, podcasts and voice notes. If the audio
  extraction ever fails, the `.mp4` is delivered unchanged — the run never
  fails for it.
- **`metadataOnly: true`** — no video or audio file is downloaded or
  stored. Each row carries the title, duration and source URL plus the
  post's own metadata: uploader name and id, view count (and live
  concurrent viewers when the post exposes it), upload date, thumbnail
  link and the description text — all read from the same lookup, so you
  pay only for the lookup, never for extra requests. Handy for
  cataloguing, moderation queues and analytics.
- **`delivery: "link"`** — no video or audio file is downloaded or stored:
  each row carries Facebook's **raw CDN URL** in `downloadUrl`, plus
  `expiresAt` — the exact moment that signed link stops working. The link
  is **not tied to our servers** (download it from anywhere, no cookies),
  but it **is time-limited** (about four days for our test videos; it
  varies per video), so **download it promptly from `downloadUrl` before
  `expiresAt`**. Cheapest mode at **$0.002 per video**; `bytes` is the
  source's approximate size when Facebook reports it. Handy when you just
  need a URL to hand to your own downloader.
- **Precedence:** `metadataOnly` wins over `delivery` and `outputFormat`;
  `delivery: "link"` wins over `outputFormat`; anything other than
  `"mp3"` is treated as `"mp4"` (the default) and an unknown `delivery`
  value is treated as `"file"`. `storeFile: false` keeps its old
  precedence over all — nothing is delivered and nothing is charged.
- **Examples:** a 30-second reel as MP3 → **$0.005** (not 1 × the video
  tier); a 10-minute video as MP3 → **$0.005**; 100 metadata rows →
  **$0.20**; 100 link rows → **$0.20**.
- **Billing availability:** this actor's pricing plan is created separately
  in the Apify Console. Until that plan lists these events, the platform
  refuses the charge and those rows bill **$0** — delivery is not affected.

#### When am I charged?

- Each requested video is charged **at most once per run** — **retries are free**, and a video can never be billed twice in one run.
- Invalid or non-video links are rejected before any attempt → **$0**.
- A video that never starts downloading (deleted post, login-walled post, oversized file) → **$0**.
- An `outputFormat: "mp3"` row that fails after its download started keeps its **$0.005** floor (same rule as the video tiers); a `metadataOnly` or `delivery: "link"` row that fails is **$0**.
- Cap spending with the standard `maxTotalChargeUsd` run option; platform compute usage is billed as normal Apify units on top of the per-minute price.

### Facebook video API for automation and AI agents

Everything the UI does is available through the JSON input API, so the actor drops straight into scripts, CI jobs, schedulers, and AI agents (Apify MCP server, webhooks, Zapier/Make):

```json
{
    "videos": [
        { "url": "https://www.facebook.com/reel/1376651124309650" },
        { "url": "https://www.facebook.com/NASA/videos/1557618349384047",
          "videoQuality": "medium" }
    ],
    "videoQuality": "best"
}
```

Only `url` is required — empty fields fall back to the global defaults. Start a run with `POST https://api.apify.com/v2/acts/<username>~facebook-video-downloader/runs` and poll it, or use run webhooks and the scheduler for recurring jobs.

Each run produces:

- **Dataset** — one item per video:
  `url`, `vid`, `title`, `duration`, `qualityTier`, `billedMinutes`, `ok`, `method`, `filename`, `downloadUrl`, `expiresAt`, `storedVia`, `seconds`, `bytes`, `attempt`, `chargedUsd`, `error`, `errorClass`
- **Key-value store** — the video files themselves (`.mp4`); the main store, always used unless you opt into S3 below (a `delivery: "link"` run stores nothing)
- `downloadUrl` points at the stored file — or, with `delivery: "link"`, at Facebook's raw CDN URL (then `expiresAt` says when it stops working); the **Output** tab shows a ready-made table

#### Optional: deliver to your own S3 bucket

The key-value store is the main store and works with zero setup. If your pipeline reads from your own object storage instead, fill the optional **S3 delivery** section (any S3-compatible service: AWS S3, Cloudflare R2, MinIO, Backblaze B2, ...) and switch the **S3 delivery** toggle on for the videos you want there:

| Field | Values | Default |
|---|---|---|
| `s3.endpoint` | S3 API endpoint URL | — (disabled) |
| `s3.bucket` | Existing bucket name | — |
| `s3.region` | e.g. `us-east-1` · R2 needs `auto` | `us-east-1` |
| `s3.accessKey` / `s3.secretKey` | Credentials with `PutObject` on the bucket | — |
| `s3.publicBaseUrl` | Public URL prefix for `downloadUrl` (optional) | path-style endpoint URL |
| `videos[].s3` | `true` = deliver this video to the bucket | `false` (key-value store) |

- **Optional by design** — leave the section empty and nothing changes; toggles default to OFF.
- **Never fails the run** — missing/invalid credentials or a failed upload automatically fall back to the key-value store.

#### Input reference

| Field | Values | Default |
|---|---|---|
| `videos` | One item per video (max 5) — required, at least one link | — |
| `videos[].url` | Facebook video / reel / watch / share URL *(required)* | — |
| `videos[].videoQuality` | `best` · `high` · `medium` · `low` | global |
| `videos[].s3` | `true` · `false` — see *Optional: deliver to your own S3 bucket* | `false` |
| `videoQuality` | `best` (≤1080p) · `high` (≤1080p) · `medium` (≤720p) · `low` (≤480p) | `best` |
| `outputFormat` | `mp4` (video + audio) · `mp3` (audio only) — see *MP3, metadata-only and link output* | `mp4` |
| `metadataOnly` | `true` = metadata row only, no file downloaded or stored | `false` |
| `delivery` | `file` = download and store the file · `link` = return Facebook's raw CDN URL (no download, no storage; the link expires — see *MP3, metadata-only and link output*) | `file` |

Global settings act as defaults for every video that leaves a field empty.

#### Output row reference

| Field | Meaning |
|---|---|
| `vid` | Facebook media id of the item (reel/video id, or the share-link code). |
| `title` / `duration` | Post title and video duration in seconds. |
| `qualityTier` | Quality bucket the file priced at: `480`, `720`, `1080` or `unknown`. |
| `billedMinutes` | Started minutes charged for this video. |
| `chargedUsd` | The pay-per-event amount charged for this video. |
| `ok` | `true` when the file was delivered. |
| `method` | `primary` (first path), `fallback` (retry on another connection), `link` (raw-URL delivery) or `fail`. |
| `filename` / `downloadUrl` / `storedVia` | Stored file name (`.mp4`, or `.mp3` with `outputFormat: "mp3"`), direct link, and where it went (`kv` or `s3`). Both are empty on a `metadataOnly` row; a `delivery: "link"` row has no `filename`/`storedVia` and `downloadUrl` is Facebook's raw CDN URL. |
| `expiresAt` | `delivery: "link"` only: when the signed CDN URL stops working (ISO-8601 UTC). Download before then. |
| `bytes` / `seconds` / `attempt` | File size (approximate source size on a link row), wall seconds, and the attempt that settled the row. |
| `metadataOnly` | Present and `true` on a metadata-only row (no file). |
| `uploader` / `uploaderId` | Page or profile that posted the video, and its machine id (metadata-only rows, when the post exposes them). |
| `views` / `concurrentViewers` | Total view count, plus live concurrent viewers when the post exposes it (metadata-only rows). |
| `uploadDate` / `timestamp` | Upload date as `YYYYMMDD` and its Unix timestamp (metadata-only rows). |
| `thumbnail` / `description` | Thumbnail image URL and the post description, both one line and length-capped (metadata-only rows). |
| `error` | Human-readable failure reason (failed rows only). |
| `errorClass` | Machine-readable failure class: `bad-url`, `login-walled`, `cannot-parse`, `not-found`, `auth-expired`, `size-cap`, `no-output`, `timeout`, `unavailable`, `no-egress`. |

### Disclaimer

This actor is a technical tool provided for **legitimate purposes only**: research, study, and personal offline viewing of content you have the right to access. It does not encourage or support redistributing or re-publishing downloaded content in any way that violates Facebook's Terms of Service or copyright law. You are solely responsible for how you use it, and downloading a video grants you no right to it beyond the rights you already hold. Do not use the actor to obtain private, login-walled or otherwise restricted material you have no right to view. The actor is provided "as is", without warranties of any kind, to the extent permitted by law. This is not legal advice: if you are unsure whether your use is permitted, check Facebook's terms and the law where you are.

### Terms & acceptable use

- **You need the rights to the content.** Only request videos you own, have explicit permission or a license for, or are otherwise entitled to use — the rights question is the same whether you stream the video in a browser or download it with this actor.
- **The platform's Terms and your local law still apply.** Using this actor does not exempt you from Facebook's Terms of Service or from copyright and other laws where you are; complying with them is your responsibility, not the actor's.
- **No redistribution.** Downloaded files are for your own permitted use — do not re-publish, re-upload, sell or otherwise distribute content you do not have the rights to.
- **Access can change or stop.** The actor depends on a third-party platform, so supported link types, behaviour and availability may change at any time, without notice, and the actor may be withdrawn entirely.
- **No warranty, limited liability.** The actor is provided "as is" (see the Disclaimer above) and, to the extent permitted by law, its publisher is not liable for any loss or damage arising from your use of it or from the content you download with it.

### FAQ

**Which Facebook links work?** Public videos, reels, `/watch/?v=...` links, `/share/v/...` and `/share/r/...` links, page videos (`facebook.com/<page>/videos/<id>`) and legacy permalinks. Group posts, profile pages, photo posts and feed links are not videos — they are rejected before any attempt and cost nothing. Short `fb.watch` / `fb.me` links are resolved automatically before download; if a short link cannot be resolved (for example, its video was deleted), the row asks you to paste the full `facebook.com` URL instead.

**What if a video fails?** The fetch was already retried on another connection. Anything still failing is reported in the dataset with an actionable `error` and a machine-readable `errorClass`; just re-run it (nothing is charged for a download that never started).

**Why is a post reported as login-walled?** Some posts are only visible to logged-in users (private posts, some groups, age-restricted posts). They are detected and reported instead of being downloaded — public posts need no account at all.

**Is there a video limit?** Up to **5 links per run**; chain runs via API for more (each run is independent).

**Do I get audio too?** Yes — the delivered `.mp4` contains both video and audio, merged.

**Can files go to my own S3/R2 bucket?** Yes — optionally. Fill the *S3 delivery* section and turn the per-video toggle on; the key-value store remains the main store and any S3 problem silently falls back to it.

**Is downloading Facebook video legal?** That depends on the content, Facebook's Terms of Service and the law where you are — see the **Disclaimer** and **Terms & acceptable use** sections above. For content you have the right to access, personal offline viewing is the use this actor is built for.

**Do links expire?** Yes. `delivery: "link"` returns Facebook's own CDN URL, not a file we host. The URL is signed and time-limited — `expiresAt` on the row states when it stops working (about four days for our test videos; it varies per video), so download it promptly and keep your own copy. A re-run produces a fresh URL.

**Why does a run sometimes take a couple of minutes for one video?** Container start dominates single-video runs; batching several links into one run amortizes the startup and is cheaper per video.

# Actor input Schema

## `videos` (type: `array`):

Add one item per video (max 5). Only URL is required — leave videoQuality empty to use the global setting below. When filled, overrides the video set. S3 toggle ON = deliver this video to the S3 bucket below (off = store in this run's key-value store).

## `videoQuality` (type: `string`):

Global default. Quality ceiling for the downloaded MP4. best = highest available (up to 1080p); high = up to 1080p; medium = up to 720p; low = up to 480p. The delivered file never exceeds the ceiling and may be lower when the source has nothing higher.

## `outputFormat` (type: `string`):

mp4 (default) = download the video with its audio merged as an MP4 file. mp3 = extract the audio track and deliver an MP3 file instead (no video stream). Ignored when Metadata only is on.

## `metadataOnly` (type: `boolean`):

ON = deliver only the metadata row (title, duration, source URL) — no video or audio file is downloaded or stored. Overrides Output format. OFF (default) = download the file as usual.

## `delivery` (type: `string`):

file (default) = download the video and store the MP4 in this run's key-value store. link = return Facebook's raw CDN URL in downloadUrl instead — no file is downloaded or stored, and the price is $0.002 per video. The link is time-limited: expiresAt says when it stops working (about four days for the test videos; it varies per video), so download promptly from downloadUrl before it expires. Ignored when Metadata only is on.

## `s3` (type: `object`):

OPTIONAL — the key-value store stays the main store. Deliver selected videos straight to your own S3-compatible bucket as well (AWS S3, Cloudflare R2, MinIO, Backblaze B2, ...). Per-video toggle: ON = S3, OFF (default) = key-value store only. Leave this section empty to disable. The bucket must already exist — the actor never creates buckets. A missing/invalid config or a failed upload automatically falls back to the key-value store — it never fails the run.

## Actor input object example

```json
{
  "videos": [
    {
      "url": "https://www.facebook.com/watch/?v=1376651124309650"
    }
  ],
  "videoQuality": "best",
  "outputFormat": "mp4",
  "metadataOnly": false,
  "delivery": "file"
}
```

# Actor output Schema

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

Per-video items with title, duration, quality tier, status and download link.

## `videoFiles` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videos": [
        {
            "url": "https://www.facebook.com/watch/?v=1376651124309650"
        }
    ],
    "videoQuality": "best",
    "outputFormat": "mp4",
    "delivery": "file"
};

// Run the Actor and wait for it to finish
const run = await client.actor("utils/facebook-video-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 = {
    "videos": [{ "url": "https://www.facebook.com/watch/?v=1376651124309650" }],
    "videoQuality": "best",
    "outputFormat": "mp4",
    "delivery": "file",
}

# Run the Actor and wait for it to finish
run = client.actor("utils/facebook-video-downloader").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "videos": [
    {
      "url": "https://www.facebook.com/watch/?v=1376651124309650"
    }
  ],
  "videoQuality": "best",
  "outputFormat": "mp4",
  "delivery": "file"
}' |
apify call utils/facebook-video-downloader --silent --output-dataset

```

## MCP server setup

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

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

## OpenAPI specification

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