# Facebook Video Downloader - Reels and Videos, MP4 or MP3 (`dami_studio/facebook-video-downloader`) Actor

Paste public Facebook video, watch or reel links and get each video as an MP4, or just its sound as an MP3. Each file is stored in the run with a direct download link. No login, no cookies. You pay per megabyte of file delivered, and links that fail cost nothing per megabyte.

- **URL**: https://apify.com/dami\_studio/facebook-video-downloader.md
- **Developed by:** [Dami's Studio](https://apify.com/dami_studio) (community)
- **Categories:** Videos, Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 megabyte downloadeds

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Facebook Video Downloader

Paste the link of a public Facebook video or reel and you get it as an MP4, or only its sound as an
MP3. Each file is saved in the run's key-value store, and its row in the dataset carries a direct
download link.

You pay for the megabytes you receive. A link that fails, or a video over your size limit, is skipped
and not billed per megabyte.

### Input

```json
{ "urls": ["https://www.facebook.com/cnn/videos/10155529876156509/"] }
```

| Field | Default | What it does |
|---|---|---|
| `urls` | none | One link per line: a Facebook video, watch or reel link. |
| `quality` | `1080` | `best`, `1080`, `720`, `480` or `360`. The number is the short side of the picture, so `1080` means 1920x1080 for a landscape video and 1080x1920 for a vertical one. If a video doesn't come in that quality, you get the closest one it has. |
| `audioOnly` | `false` | Only the video's sound, as a 128 kbit/s MP3. |
| `convertToH264` | `false` | Re-encode VP9 and AV1 videos to H.264, which older Apple players need. It takes longer; see the section on converting below. |
| `maxMegabytes` | `500` | Your limit per video. A bigger video is skipped before anything is downloaded. |

**fb.watch short links usually don't come through.** Facebook asks for a login before it opens them,
and there is no login behind this actor. Open the link in your browser and paste the facebook.com
address it lands on; that one works like any other link. facebook.com/share/ links are followed to the
post first, and then treated like the post's own link.

This actor takes Facebook links only. A TikTok or X link is refused before anything is fetched, with a
pointer to our [TikTok Video Downloader](https://apify.com/dami_studio/tiktok-video-downloader) or
[X Video Downloader](https://apify.com/dami_studio/x-video-downloader). YouTube links go in our
[YouTube Downloader](https://apify.com/dami_studio/youtube-video-downloader).

### What you get

One dataset row per delivered file:

```json
{
  "url": "https://www.facebook.com/cnn/videos/10155529876156509/",
  "host": "facebook",
  "title": "Holocaust survivor becomes US citizen",
  "author": "CNN",
  "durationSeconds": 44.48,
  "resolution": "1080x1080",
  "format": "mp4",
  "fileSizeBytes": 7725292,
  "billedMegabytes": 8,
  "videoCodec": "vp9",
  "convertedToH264": false,
  "note": null,
  "mediaKey": "facebook-10155529876156509.mp4",
  "mediaUrl": "https://api.apify.com/v2/key-value-stores/.../records/facebook-10155529876156509.mp4"
}
```

`resolution` and `durationSeconds` are measured on the file you receive, not copied from the page.
`billedMegabytes` is the file size rounded up to whole megabytes, where a megabyte is 1,000,000 bytes.
`videoCodec` is the codec of the file you receive. `convertedToH264` says whether the actor re-encoded
it for you, and when you asked for that and it wasn't done, `note` says why.
For a reel, the title is usually the caption with its view and reaction counts in front, the way
Facebook shows it.

Facebook sends picture and sound separately, and they are merged into one MP4 for you. You get H.264
video when Facebook offers it at your quality. Many videos, the one above included, only come as VP9 at
their best quality, and some reels only as AV1. Older players and editors may not open those; see
converting to H.264 below.

Links that don't work out are listed in the `ERRORS` record of the same key-value store, each with a
plain reason. They never show up in the dataset. If not one link could be downloaded, the run ends as
Failed instead of Succeeded, so a scheduled job or an integration notices.

### Converting VP9 and AV1 to H.264

Some reels exist on Facebook in one video codec only, and for a fair number of them that codec is VP9
or AV1. A browser plays them. QuickTime on a Mac, or an older iPhone, may not open them at all.

Turn on `convertToH264` and each video that isn't H.264 already is re-encoded to H.264 at the same
picture size, sound included. The MP4 starts playing before it has fully downloaded. Videos Facebook
already sends as H.264 are left as they are, and so are MP3s.

It takes longer, because every frame is encoded again. In testing, a 27-second 1080x1920 reel took
about a minute and a half at the default 1024 MB of memory and under a minute at 2048 MB; a 9-second
one took 20 seconds. At the default memory roughly three minutes of 1080p video can be converted per
link. For a longer video the run says how much memory to use, before anything is downloaded.

The H.264 file is bigger, about 2 to 2.6 times the original in testing, and you pay per megabyte of
the file you receive.
Converting costs $0.03 for each started minute of video converted, on top of the megabytes of the H.264 file.
A 27-second reel counts as one minute, a 61-second video as two.

When a conversion fails, or the H.264 copy would go over your `maxMegabytes` or the run's maximum
charge, you get the original file instead, with a `note` on its row saying why, and the conversion
isn't charged. A video too long to convert in the time the run has is skipped before anything is
downloaded, with a message saying what to change.

### Billing

Each delivered file is charged once, for its size in megabytes rounded up: the 7.7 MB video above
counts as 8 MB. The price per megabyte for your Apify plan is on the Pricing tab.

With the conversion on, a converted video also costs $0.03 for each started minute of video converted, on top of the megabytes of the H.264 file.
A 27-second reel counts as one minute. Videos that are already H.264, MP3s, and conversions that fail or
are refused cost nothing extra.

A link that fails, a video over your `maxMegabytes`, or one that doesn't fit the run costs nothing per
megabyte. If you set a maximum charge for the run, the actor checks it before each download and skips
a video it can't pay for rather than going over.

### Big files

Facebook videos can be long. One run holds files up to about 70% of its memory, so 716 MB at the
default 1024 MB. A bigger video is refused before it is downloaded, with a message that names the
memory to use: an hour-long stream came to 1,866 MB in testing and needed 4096 MB. Pick that in the
run options and run the link again. `maxMegabytes` goes up to 4000.

### What it doesn't do

- **Other sites.** Facebook only; see the links above for TikTok, X and YouTube. Instagram and Vimeo
  are not supported by any of them.
- **Private, friends-only or group-only videos.** There's no account and no cookies behind this. If
  you have to be signed in to watch it, it can't be downloaded here.
- **fb.watch short links, most of the time.** See above: paste the facebook.com address instead.
- **Live videos** while they are still live.
- **Posts without a video**, such as photo posts.
- **Whole pages or playlists.** One link, one video.
- **Other formats.** The conversion only makes H.264 MP4, at the video's own picture size.

Now and then Facebook doesn't return a video for a public link that worked a minute earlier. The actor
tries such a link once more on its own; if it still fails, the reason says to try again later.

### Copyright

The videos belong to the people who posted them. Download only what you own or have permission to
use, and stay within Facebook's terms.

### FAQ

**Do I need an account, cookies or an API key?** No. The link is the whole input.

**Can I send lots of links in one run?** Yes. They are downloaded one after another, and a short video
takes 5 to 10 seconds. The default run timeout is 30 minutes, so give a very big batch more.

**Will a smaller memory setting save money?** No. It doesn't change the price, and at 512 MB the same
batch took about 75% longer in testing.

**Where are the files?** In the run's key-value store. `mediaUrl` in each row is a direct link, and
`mediaKey` is the key if you'd rather fetch it through the API. How long the store is kept depends on
your Apify plan, so download what you need.

# Actor input Schema

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

One link per line: a Facebook video, watch or reel link. Each link gives one file. fb.watch short links usually don't come through, because Facebook asks for a login before it opens them: open one in your browser and paste the facebook.com address it lands on. Links from other sites are refused, with a pointer to the downloader that takes them.

## `quality` (type: `string`):

Measured on the short side of the picture, so 1080 means 1920x1080 for a landscape video and 1080x1920 for a vertical one. If a video doesn't come in that quality you get the closest one it has. You pay per megabyte, so a higher quality costs more.

## `audioOnly` (type: `boolean`):

Save just the video's sound, as a 128 kbit/s MP3, instead of the video.

## `convertToH264` (type: `boolean`):

Some Facebook reels only come as VP9 or AV1, which QuickTime and older iPhones may not play. Turn this on and those are re-encoded to H.264, which plays nearly everywhere. It takes a while, because every frame is encoded again: a 27-second 1080p reel took about a minute and a half at the default memory, and under a minute at 2048 MB. Videos Facebook already sends as H.264, and MP3s, are left as they are. The H.264 file is about 2 to 2.6 times the size of the original. Converting costs $0.03 for each started minute of video converted, on top of the megabytes of the H.264 file, so a 27-second reel counts as one minute.

## `maxMegabytes` (type: `integer`):

A video bigger than this is skipped before it is downloaded, and you are not charged for it. One run can hold files up to about 70% of its memory (716 MB at the default 1024 MB), so for anything bigger raise the run's memory as well.

## Actor input object example

```json
{
  "urls": [
    "https://www.facebook.com/reel/1195289147628387"
  ],
  "quality": "1080",
  "audioOnly": false,
  "convertToH264": false,
  "maxMegabytes": 500
}
```

# Actor output Schema

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

One row per delivered file: the link, title, author, duration, measured resolution, size, megabytes billed and a direct link to the file.

## `files` (type: `string`):

The MP4 and MP3 files themselves, in the run's key-value store.

## `errors` (type: `string`):

Each failed or refused link with the reason. These are not billed per megabyte.

# 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": [
        "https://www.facebook.com/reel/1195289147628387"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dami_studio/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 = { "urls": ["https://www.facebook.com/reel/1195289147628387"] }

# Run the Actor and wait for it to finish
run = client.actor("dami_studio/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 '{
  "urls": [
    "https://www.facebook.com/reel/1195289147628387"
  ]
}' |
apify call dami_studio/facebook-video-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,dami_studio/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/NsnFS2YrF41GdrXvE/builds/tPJL2lpI6oNanrlab/openapi.json
