# Facebook Media Downloader (`alpha-scraper/facebook-media-downloader`) Actor

\[ 1k/1.49$ ] Facebook Media Downloader resolves and optionally downloads media of public Facebook posts: best-resolution images and videos or reels as MP4 (HD or SD, with audio). Use post, reel, video or photo URLs, or Pages and usernames to process their latest posts. No login.

- **URL**: https://apify.com/alpha-scraper/facebook-media-downloader.md
- **Developed by:** [Alpha Scraper](https://apify.com/alpha-scraper) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-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

### Facebook Media Downloader

**Facebook Media Downloader** finds the photos, videos and reels inside public Facebook posts and, if you want, downloads the files for you. Give Facebook Media Downloader a post, reel, video or photo link, or a Facebook Page name, and it returns one record per media file with a direct file link, size, resolution and the post it came from.

Facebook Media Downloader reads publicly visible Facebook content only. You do not need a Facebook account or login, and you do not need to save files by hand: the downloaded files are stored in the run's storage and linked from the dataset.

> **📌 At a glance**
>
> - **Input:** Facebook Page usernames, Page URLs, and direct post, reel, video or photo URLs
> - **Output:** one dataset record per media file, plus one summary record
> - **Images:** full-size photos where Facebook serves them, otherwise the timeline version
> - **Videos:** progressive MP4 files with audio, in HD, SD or both
> - **Control:** file size limit, parallel downloads and a per-Page post limit

Marketing teams, researchers and social media managers use Facebook Media Downloader to build media libraries, keep copies of their own Facebook content and review the creative of public Pages. Every media file comes back in the same JSON structure.

### 🔹 Facebook Media Downloader – Key Features

Facebook Media Downloader is built around the details that matter when you collect Facebook photos and videos.

- **Photos, videos and reels:** one Actor handles Facebook photo posts, albums, video posts and reels.
- **Full-size photos:** Facebook Media Downloader can upgrade each photo from the timeline thumbnail to the full-size image.
- **Video quality choice:** pick HD, SD or both. HD falls back to SD when Facebook exposes no HD file.
- **Audio included:** videos are progressive MP4 files, so the downloaded Facebook video has sound.
- **Download or resolve only:** switch `download` off to get file links, sizes and content types without saving anything.
- **File integrity data:** downloaded files carry a size in bytes, a SHA-256 hash and a content type.
- **Size guard:** `maxFileSizeMB` drops any file that grows past your limit and reports it.
- **Duplicate removal:** Facebook Media Downloader returns a photo found in several posts once.

> **✅ Why use this Actor**
>
> Facebook Media Downloader replaces right-click saving and screen recording. It walks through the Facebook posts for you, saves the right file version and records the result in a clean dataset.

### 🔍 What Data Does Facebook Media Downloader Extract?

Each dataset item describes one media file. The table groups the fields by purpose.

| Group | Fields | What you get |
|---|---|---|
| Media | `mediaType`, `mediaId`, `quality`, `sourceUrl` | Image or video, its id, the version and the file link |
| Size | `width`, `height`, `durationSeconds`, `sourceWidth`, `sourceHeight` | Resolution and video length |
| Text | `caption`, `pageUrl`, `createdTime` | Caption or alt text, the media page and creation time |
| Post | `postId`, `postUrl`, `postTime`, `owner`, `postType` | The Facebook post that holds the file |
| Video extras | `thumbnailUrl`, `captionsUrl`, `dashManifestUrl`, `note` | Preview image, caption file, stream manifest and remarks |
| File | `contentType`, `sizeBytes`, `downloaded`, `httpStatus` | What the file link returned |
| Saved file | `filename`, `path`, `sha256`, `audioTrackDetected`, `error` | Stored file details when `download` is on |
| Source | `facebookUrl`, `number`, `recordType`, `scrapedAt` | The Facebook source, position and collection time |

A final record with `recordType` set to `summary` counts the posts processed, files found, files downloaded and any failures.

### 🚀 How to Use Facebook Media Downloader

Running Facebook Media Downloader takes a few steps in Apify Console.

- **Step 1 – Open the Actor:** start Facebook Media Downloader from the Apify Store and go to the Input tab.
- **Step 2 – Add your sources:** enter Page names in `usernames`, Page or post links in `startUrls`, or direct media links in `postUrls`.
- **Step 3 – Choose the media:** keep `images` and `videos` on, or turn one off to collect only photos or only videos.
- **Step 4 – Pick quality:** set `videoQuality` to `hd`, `sd` or `both`.
- **Step 5 – Decide on downloading:** leave `download` on to save the files, or turn it off to only list the Facebook file links.
- **Step 6 – Run and export:** start Facebook Media Downloader, then export the dataset as JSON, CSV or Excel, or open the stored files.

> **💡 Tip:** the `usernames` field is prefilled with a sample Page. If you only want your own links, clear it before you run Facebook Media Downloader.

### 📥 Facebook Media Downloader Input

Facebook Media Downloader has eleven input fields. All of them are optional, but you need at least one username or link.

| Field | Type | Description |
|---|---|---|
| `usernames` | array | Facebook Page usernames or numeric ids. The latest posts of each Page are processed. Prefilled with `natgeo`. |
| `startUrls` | array | Page URLs and post, reel, watch, video, photo or share URLs, in any mix. Default is empty. |
| `postUrls` | array | Direct post, reel, video or photo URLs. A Page URL here is treated like a username. Default is empty. |
| `download` | boolean | Save the files and record size, SHA-256 and content type. Off means links only. Default `true`. |
| `videoQuality` | string | `hd`, `sd` or `both`. HD falls back to SD when no HD file exists. Default `hd`. |
| `fullSizePhotos` | boolean | Upgrade photos from the timeline thumbnail to the full-size image. Default `true`. |
| `images` | boolean | Return and download photos from the posts. Default `true`. |
| `videos` | boolean | Return and download videos and reels from the posts. Default `true`. |
| `maxFileSizeMB` | integer | Largest file to download, in MB. Minimum 1, default 100. Only used when `download` is on. |
| `maxItems` | integer | Latest posts read per Page. Minimum 1, default 30. Direct post links are not affected. |
| `concurrency` | integer | Files downloaded in parallel, from 1 to 4. Default 3. |

Every Page in `usernames` and `startUrls` gets its own `maxItems` limit, so three Pages with `maxItems` set to 10 read up to 30 Facebook posts.

Here is a sample input that downloads HD videos and photos from the latest posts of one Facebook Page:

```json
{
  "usernames": ["natgeo"],
  "startUrls": [],
  "postUrls": [],
  "download": true,
  "videoQuality": "hd",
  "fullSizePhotos": true,
  "images": true,
  "videos": true,
  "maxFileSizeMB": 100,
  "maxItems": 10,
  "concurrency": 3
}
```

### 📤 Facebook Media Downloader Output

Facebook Media Downloader writes one `media` record per file and one `summary` record to the default dataset.

Here is a photo record from a run with `download` switched off:

```json
{
  "mediaType": "image",
  "mediaId": "1713458673484889",
  "quality": "original",
  "sourceUrl": "https://scontent.xx.fbcdn.net/v/sample_photo.jpg?oe=EXAMPLE",
  "width": 2048,
  "height": 1362,
  "caption": "May be an image of a turtle and text",
  "pageUrl": "https://www.facebook.com/photo/?fbid=1713458673484889",
  "createdTime": "2026-11-06T11:00:00.000Z",
  "postId": "1713458710151552",
  "postUrl": "https://www.facebook.com/samplepage/posts/pfbid0ExampleSamplePostId",
  "postTime": "2026-11-06T11:00:00.000Z",
  "owner": "Sample Page",
  "postType": "photo",
  "facebookUrl": "https://www.facebook.com/samplepage",
  "contentType": "image/jpeg",
  "sizeBytes": 270645,
  "downloaded": false,
  "httpStatus": 200,
  "number": 1,
  "recordType": "media",
  "scrapedAt": "2026-11-06T17:50:20.000Z"
}
```

A downloaded video record from Facebook Media Downloader adds the stored file details:

```json
{
  "mediaType": "video",
  "mediaId": "1656166716019087",
  "width": 720,
  "height": 1280,
  "durationSeconds": 28,
  "thumbnailUrl": "https://scontent.xx.fbcdn.net/v/sample_thumb.jpg?oe=EXAMPLE",
  "dashManifestUrl": null,
  "captionsUrl": null,
  "pageUrl": "https://www.facebook.com/reel/1656166716019087",
  "caption": "Sunrise over the harbor",
  "quality": "hd",
  "sourceUrl": "https://video.xx.fbcdn.net/v/sample_video.mp4?oe=EXAMPLE",
  "sourceWidth": 720,
  "sourceHeight": 1280,
  "postId": "1656166716019087",
  "postUrl": "https://www.facebook.com/reel/1656166716019087",
  "postTime": "2026-11-05T09:15:00.000Z",
  "owner": "Sample Page",
  "postType": "reel",
  "facebookUrl": "https://www.facebook.com/reel/1656166716019087",
  "filename": "https://api.apify.com/v2/key-value-stores/EXAMPLE/records/facebook-media-downloader_downloads__Sample_Page_1656166716019087_1656166716019087_hd.mp4?signature=EXAMPLE",
  "path": "https://api.apify.com/v2/key-value-stores/EXAMPLE/records/facebook-media-downloader_downloads__Sample_Page_1656166716019087_1656166716019087_hd.mp4?signature=EXAMPLE",
  "sizeBytes": 4820113,
  "sha256": "9f2c1d0e5b7a4c3d8e6f1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f",
  "contentType": "video/mp4",
  "downloaded": true,
  "audioTrackDetected": true,
  "number": 2,
  "recordType": "media",
  "scrapedAt": "2026-11-06T17:50:41.000Z"
}
```

The summary record closes every run:

```json
{
  "recordType": "summary",
  "postsProcessed": 4,
  "mediaFound": 4,
  "images": 3,
  "videos": 1,
  "downloadEnabled": true,
  "filesDownloaded": 4,
  "totalBytes": 6120450,
  "failed": null,
  "downloadFolder": "facebook-media-downloader_downloads",
  "caveats": ["CDN urls are signed and expire (oe= parameter)"],
  "scrapedAt": "2026-11-06T17:50:45.000Z"
}
```

#### 🧾 Facebook Media Downloader output field guide

- `mediaType` is `image` or `video`, and `quality` tells you which version you got: `timeline` or `original` for photos, `hd` or `sd` for videos.
- `sourceUrl` is the direct file link. It is signed and expires, so download soon after a resolve-only run.
- `width`, `height` and `durationSeconds` describe the file. SD videos keep `null` sizes, and `sourceWidth` and `sourceHeight` hold the original video size.
- `postId`, `postUrl`, `postTime`, `owner` and `postType` identify the Facebook post.
- `filename`, `path`, `sizeBytes`, `sha256` and `contentType` describe a downloaded file, and `filename` and `path` both hold the public storage link of the stored copy.
- `audioTrackDetected` shows whether a downloaded video contains sound.
- `error` appears when a file could not be saved, for example when it passes `maxFileSizeMB`. The summary lists it under `failed`.
- `note` explains a video that has no downloadable MP4. `dashManifestUrl` is only reported, never downloaded.
- `facebookUrl`, `number`, `recordType` and `scrapedAt` tell you the source, order, record type and time.

### 📥 How to Download Facebook Videos and Reels with Facebook Media Downloader

To download Facebook videos, paste the reel or video link into `postUrls` and keep `videos` on. Set `videoQuality` to `hd`, or to `both` for an HD and an SD copy of every Facebook video.

Facebook Media Downloader downloads progressive MP4 files that contain audio. Streams that split picture and sound are only reported through `dashManifestUrl`, and a post without a usable MP4 gets a `note` instead of a file.

### 🖼️ How to Download Full-Size Facebook Photos with Facebook Media Downloader

Leave `fullSizePhotos` on and Facebook Media Downloader opens each photo to find the largest version Facebook shows logged-out. Those records have `quality` set to `original`. Turn it off for faster runs with the timeline image.

For a whole Page, enter its name in `usernames`, set `videos` to `false` and raise `maxItems` to collect the photos of its latest Facebook posts.

### 🎯 Facebook Media Downloader Use Cases

Facebook Media Downloader fits many workflows that depend on public Facebook media.

- **Content archiving:** keep local copies of the photos and videos your own Facebook Page published.
- **Creative research:** review the images and videos competitors use in their Facebook posts.
- **Asset collection:** gather media for reports, presentations or moodboards, with the original post linked.
- **Dataset building:** collect Facebook images and videos with captions for analysis or machine learning projects.
- **Link auditing:** run with `download` off to check which Facebook media links resolve and how large they are.

### 💰 Pricing

Facebook Media Downloader runs on the Apify platform. The current pricing is shown on the Actor page in the Apify Store, and your cost depends on the number of results and the resources used by the run.

> **💡 Cost tip:** start with a small `maxItems` such as 5 and a low `maxFileSizeMB`. Check the records, then raise the limits once the files look right.

### 💡 Tips and Best Practices

- **Start small:** a short run confirms the Page name and shows the record fields before a large download.
- **Download soon:** links from Facebook Media Downloader are signed and expire, so use `download` instead of saving links for later.
- **Limit big videos:** lower `maxFileSizeMB` to skip very large videos, then check `failed` in the summary.
- **Expect public data only:** Facebook Media Downloader returns what a logged-out visitor can open. Some posts show fewer files or no HD version.
- **Check nulls:** a `null` field means the value was not shown, not that Facebook Media Downloader failed.
- **Schedule runs:** use Apify schedules to collect new Facebook media from a Page on a regular basis.

> **⚠️ Important:** only download media you are allowed to use. Facebook photos and videos can contain personal data and are often protected by copyright, so follow Facebook's terms and the rules that apply to you, such as GDPR. This Actor is not affiliated with or endorsed by Meta.

### ❓ Frequently Asked Questions

#### 🔎 What is Facebook Media Downloader?

Facebook Media Downloader is an Apify Actor that finds and downloads the photos, videos and reels of public Facebook posts. It returns file links, sizes, resolutions and post details in a structured format.

#### 🧭 How do I download Facebook videos?

Paste the video or reel link into `postUrls`, keep `download` and `videos` on, and start Facebook Media Downloader. The MP4 file is stored in the run's storage and linked from the dataset.

#### 🖼️ Can I download full-size Facebook photos?

Yes. With `fullSizePhotos` on, Facebook Media Downloader returns the full-size image when Facebook serves it, and marks the record with `quality` set to `original`.

#### 📄 Can I download all media from a Facebook Page?

Yes. Add the Page to `usernames` or `startUrls` and set `maxItems`. Facebook Media Downloader processes that many of the latest Facebook posts and collects every photo and video in them.

#### 🔐 Does Facebook Media Downloader need a Facebook login?

No. Facebook Media Downloader reads publicly visible content, so no account or cookies are required.

#### 🎞️ Do downloaded Facebook videos have sound?

Yes. Facebook Media Downloader saves progressive MP4 files with audio, and `audioTrackDetected` confirms it for each saved file.

#### 🔗 Can I get only the file links without downloading?

Yes. Set `download` to `false`. Facebook Media Downloader then returns each link with its size and content type. Links expire, so download them soon.

#### 📏 What happens to very large files?

Facebook Media Downloader drops a file that grows past `maxFileSizeMB` while downloading, marks it with `error` and lists it in the summary under `failed`.

#### 🚫 Can I download media from private profiles or groups?

No. Facebook Media Downloader only works with public Facebook posts, Pages and public profiles. Private content is not available.

#### ⚖️ Is it legal to download Facebook media?

Facebook Media Downloader collects public Facebook content only. You are responsible for how you use the files, so check copyright, Facebook's terms and privacy rules before you store or share them.

### 📞 Support

If you have questions, ideas for new fields or a Facebook post where Facebook Media Downloader misses files, send the link and the input you used.

- Contact me by email: alphascraper69@gmail.com

# Actor input Schema

## `usernames` (type: `array`):

Page usernames or numeric ids. The latest posts of each Page are processed (see 'Max items').

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

Page URLs and / or post, permalink, reel, /watch/?v=, /<page>/videos/<id>, /photo.php?fbid= or /share/ URLs, in any mix.

## `postUrls` (type: `array`):

Direct post, reel, video or photo URLs, e.g. https://www.facebook.com/reel/1656166716019087. A Page URL given here is treated like a username.

## `download` (type: `boolean`):

Download the media files and record their size, SHA-256 and content type. When off, only the file URLs are resolved and their size and content type are read with a HEAD request. CDN URLs are signed and expire, so download soon after they are resolved.

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

Which progressive MP4 to return for each video. HD falls back to SD when no HD file is exposed. DASH streams are only reported (their tracks are video-only or audio-only), never downloaded.

## `fullSizePhotos` (type: `boolean`):

Upgrade each photo from the ~960px timeline thumbnail to the full-size image through the photo viewer. Costs one extra request per photo.

## `images` (type: `boolean`):

Return (and download) photos from the posts.

## `videos` (type: `boolean`):

Return (and download) videos and reels from the posts.

## `maxFileSizeMB` (type: `integer`):

Largest file to download, in MB. A file that grows past this limit while downloading is dropped and reported with an error. Only applies when 'Download files' is on.

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

Maximum number of latest posts read per Page - every Page from 'Usernames' and 'Start URLs' gets its own limit. Direct post URLs are not affected. Each post can yield several media files.

## `concurrency` (type: `integer`):

Number of files downloaded in parallel (1 to 4).

## Actor input object example

```json
{
  "usernames": [
    "Cristiano"
  ],
  "startUrls": [],
  "postUrls": [],
  "download": true,
  "videoQuality": "hd",
  "fullSizePhotos": false,
  "images": false,
  "videos": true,
  "maxFileSizeMB": 100,
  "maxItems": 15,
  "concurrency": 3
}
```

# Actor output Schema

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

Structured records extracted by Facebook Media Downloader and stored in the run's default dataset.

# 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 = {
    "usernames": [
        "Cristiano"
    ],
    "maxItems": 15
};

// Run the Actor and wait for it to finish
const run = await client.actor("alpha-scraper/facebook-media-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 = {
    "usernames": ["Cristiano"],
    "maxItems": 15,
}

# Run the Actor and wait for it to finish
run = client.actor("alpha-scraper/facebook-media-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 '{
  "usernames": [
    "Cristiano"
  ],
  "maxItems": 15
}' |
apify call alpha-scraper/facebook-media-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alpha-scraper/facebook-media-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/ZRC4St4EATcfYMR7R/builds/MjirQXnhJ3u1fvAsl/openapi.json
