# Facebook Reels Scraper (`codenest/facebook-reels-scraper`) Actor

Extract unlimited Facebook reels with complete page or profile metadata - bios, follower counts, profile photos, plus downloadable video URLs, view counts, descriptions, creation dates, and durations from any public page or profile.

- **URL**: https://apify.com/codenest/facebook-reels-scraper.md
- **Developed by:** [CodeNest](https://apify.com/codenest) (community)
- **Categories:** Social media, Videos, Developer tools
- **Features:** Limited permissions
- **Stats:** 7 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 reel scrapeds

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 Posts & Reels Scraper (Direct URLs, Pages & Hashtags)

> **The all-in-one, dual-engine Facebook scraper for Apify.** Scrape direct post URLs (photos, multi-image albums, videos, reels, metrics, and comments) or extract bulk Reels from Facebook Pages, Profiles, and Hashtags with direct HD video download links and creator attribution.

***

### 🌟 Why Choose This Scraper?

- ⚡ **Dual-Engine Flexibility**:
  - **Mode 1 (Direct Post URLs)**: Lightning-fast TLS fingerprint bypass (curl_cffi + yt-dlp) to scrape public Facebook posts, photo albums, videos, and reels with full engagement metrics and recent comments.
  - **Mode 2 (Page & Hashtag Reels)**: Automated Playwright browser engine to scroll and collect bulk Reels from any Facebook Page, Creator profile, or Hashtag feed (e.g. `#comedy`, `#sports`, `#wildlife`).
- 🎬 **Direct HD Media Downloads**: Extracts original high-resolution MP4 video URLs (CDN) and full-size JPG/PNG photo URLs.
- 👤 **Creator & Uploader Attribution**: Automatically identifies the creator/channel (`uploader`, `uploader_id`, `uploader_url`) for every single Reel—especially crucial for hashtag feeds where each video comes from a different creator.
- ✨ **Clean, Pristine Captions**: Automatically strips raw HTML entity garbage (e.g., `&#xb7;`, `&#x1f602;`), removes messy view/reaction prefixes, and extracts authentic hashtags without fake artifacts.
- 📊 **Numeric & Formatted Metrics**: Provides both human-readable (`"1.3M"`, `"45K"`) and clean integer metrics (`views_count`, `likes_count`, `comments_count`, `shares_count`) for instant filtering in Excel, CSV, Google Sheets, or BI tools.
- 🛡️ **Anti-Ban & Proxy Ready**: Built-in support for Apify Residential Proxies with smart session handling to bypass Facebook login walls and rate limits.

***

### 🎯 Supported Scraping Modes

#### 1️⃣ Mode 1: Direct Post URLs

Pass a list of specific Facebook links under `urls`:

- Photos & Single Images (e.g. `https://www.facebook.com/share/p/...`)
- Multi-Photo Albums & Carousels
- Watch Videos (e.g. `https://www.facebook.com/watch/?v=...`)
- Direct Reels (e.g. `https://www.facebook.com/reel/...`)
- Optional **Recent Comments Extraction** with authors and timestamps.

#### 2️⃣ Mode 2: Bulk Reels from Pages & Profiles

Pass one or more Facebook Page or Creator profile URLs under `pageUrls`:

- Automatically navigates to the Page's Reels timeline.
- Smoothly scrolls to collect up to your specified `maxPosts` limit.
- Fallback enrichment extracts 100% accurate GraphQL feedback data, HD MP4 links, durations, and creator details.

#### 3️⃣ Mode 3: Bulk Reels from Hashtags

Pass hashtag names under `hashtags` (e.g. `["comedy", "wildlife", "travel"]`) or full URLs:

- Searches and scrolls through the hashtag feed.
- Discovers trending community Reels across hundreds of independent creators.
- Captures each creator's unique name, profile ID, and video link.

***

### ⚙️ Input Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `urls` | Array of Objects | ❌ Optional | `[]` | **Mode 1**: Direct Facebook post, photo, video, or reel URLs. |
| `pageUrls` | Array of Strings | ❌ Optional | `[]` | **Mode 2**: Facebook Page or Profile URLs to scrape bulk reels from. |
| `hashtags` | Array of Strings | ❌ Optional | `[]` | **Mode 2**: Facebook hashtags to scrape (e.g. `["comedy", "news"]`). |
| `maxPosts` | Integer | ❌ Optional | `50` | Maximum number of reels to collect per page/hashtag (5 to 1000). |
| `include_comments`| Boolean | ❌ Optional | `false` | Enable to extract recent comments for direct posts (Mode 1). |
| `max_comments` | Integer | ❌ Optional | `25` | Maximum recent comments to extract per post. |
| `flattenOutput` | Boolean | ❌ Optional | `false` | Flatten output into single rows for clean Excel / CSV export. |
| `maxConcurrency` | Integer | ❌ Optional | `10` | Parallel concurrent workers for high-speed metadata enrichment. |
| `headless` | Boolean | ❌ Optional | `true` | Run browser in headless mode. |
| `proxy` | Object | ❌ Optional | `RESIDENTIAL` | Apify Proxy configuration (Residential proxy recommended). |
| `cookie_header` | String | ❌ Optional | `""` | Optional Facebook session cookies (`c_user=...; xs=...`) for restricted content. |

***

### 📝 Input Examples

#### Example A: Scraping Facebook Pages & Hashtags (Bulk Reels)

```json
{
  "pageUrls": [
    "https://www.facebook.com/MundoAnimalHistorias"
  ],
  "hashtags": [
    "comedy"
  ],
  "maxPosts": 50,
  "flattenOutput": true,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

#### Example B: Scraping Direct Post URLs (Photos, Reels, Videos)

```json
{
  "urls": [
    { "url": "https://web.facebook.com/share/p/1DVg2qCC9Y/" },
    { "url": "https://www.facebook.com/reel/2605277543319794/" }
  ],
  "include_comments": true,
  "max_comments": 20
}
```

***

### 📤 Output Format

The actor delivers clean, standardized JSON objects directly to the Apify dataset:

#### Sample Reel Output (Mode 2 — Page & Hashtag)

```json
{
  "target": "https://www.facebook.com/hashtag/comedy",
  "target_title": "#comedy",
  "post_number": 1,
  "post_url": "https://www.facebook.com/reel/2139373990037087/",
  "post_id": "2139373990037087",
  "post_type": "video",
  "uploader": "Paola Ruíz",
  "uploader_id": "100044567891234",
  "uploader_url": "https://www.facebook.com/100044567891234",
  "caption": "ESPERA EL DISFRAZ ‼️😂 Jamás creí ponerme esto ….\n•\n• #comedy #humor #halloween",
  "description": "ESPERA EL DISFRAZ ‼️😂 Jamás creí ponerme esto ….\n•\n• #comedy #humor #halloween",
  "creation_time": "27 October 2026 at 22:02",
  "timestamp": 1793138554,
  "downloadable_url": "https://video.fbtr1-1.fna.fbcdn.net/o1/v/t2/f2/m367/...mp4",
  "duration_seconds": 8.57,
  "thumbnail_url": "https://scontent.fbtr1-1.fna.fbcdn.net/v/...jpg",
  "hashtags": [
    "#comedy",
    "#humor",
    "#halloween"
  ],
  "likes": "1M",
  "likes_count": 1021309,
  "comments": "7294",
  "comments_count": 7294,
  "shares": "46K",
  "shares_count": 46000,
  "views": "6M",
  "views_count": 6000000,
  "mentions": [],
  "recent_comments": []
}
```

#### Sample Direct Post Output (Mode 1 — Photos & Albums)

```json
{
  "url": "https://www.facebook.com/100075450447536/posts/1130794772778860/",
  "input_url": "https://web.facebook.com/share/p/1DVg2qCC9Y/",
  "post_id": "1130794772778860",
  "title": "# Hrithik Roshan's Family ❤️",
  "caption": "# Hrithik Roshan's Family ❤️\n\nHrithik Roshan is one of Bollywood's most admired actors...",
  "description": "# Hrithik Roshan's Family ❤️\n\nHrithik Roshan is one of Bollywood's most admired actors...",
  "post_type": "photo",
  "uploader": "ताजा खबर ऑनलाइन",
  "uploader_id": "100075450447536",
  "uploader_url": "https://www.facebook.com/100075450447536",
  "post_date": "2026-11-02 15:34:40 UTC",
  "likes": 9500,
  "like_count": "9.5K",
  "shares_count": 66,
  "images_count": 1,
  "photo_download_url": "https://scontent-ord5-1.xx.fbcdn.net/v/...jpg",
  "thumbnail_url": "https://scontent-ord5-1.xx.fbcdn.net/v/...jpg",
  "hashtags": []
}
```

***

### 📋 Complete Field Reference

| Field | Type | Description |
|---|---|---|
| `uploader` | String | **Creator / Page name** that uploaded the post/reel. |
| `uploader_id` | String | Unique numeric Facebook ID of the uploader (when available). |
| `uploader_url` | String | Direct Facebook profile or page link of the creator. |
| `post_url` / `url` | String | Canonical link to the Facebook post or reel. |
| `post_id` | String | Facebook numeric content identifier. |
| `post_type` | String | Content category: `video`, `photo`, `album`, or `reel`. |
| `caption` | String | Full post caption with HTML entities decoded and metrics stripped. |
| `description` | String | Full description text matching caption. |
| `downloadable_url` | String | Direct CDN URL to download the high-resolution MP4 or JPG file. |
| `thumbnail_url` | String | High-resolution thumbnail image URL. |
| `duration_seconds` | Float | Video duration in seconds (e.g. `18.33`). |
| `creation_time` | String | Formatted publication date (e.g. `02 November 2026 at 20:55`). |
| `timestamp` | Integer | Unix epoch timestamp of when the content was published. |
| `views` | String | Formatted view count (e.g. `"175K"`, `"1.3M"`). |
| `views_count` | Integer | Numeric view count integer (e.g. `175000`). |
| `likes` | String / Int | Formatted like/reaction count (e.g. `"4.5K"`). |
| `likes_count` | Integer | Numeric like count integer (e.g. `4526`). |
| `comments_count` | Integer | Total comment count integer. |
| `shares_count` | Integer | Total share count integer. |
| `hashtags` | Array | Clean hashtags list (e.g. `["#comedy", "#viral"]`). |
| `recent_comments` | Array | Structured list of recent comments (author, text, time). |

***

### 💡 Performance & Memory Best Practices

- **Recommended Memory**: **2048 MB** (Default). This ensures smooth Playwright browser execution without out-of-memory risks while minimizing Apify CU consumption.
- **Proxies**: Facebook aggressively rate-limits datacenter IPs. Using **Apify Residential Proxies** (`RESIDENTIAL`) guarantees 99.9% extraction success.
- **Concurrency**: The default concurrency is set to `10`. For large runs (500+ posts), keep concurrency between `5` and `15` to maintain optimal throughput.

***

### ❓ Frequently Asked Questions

**Q: Do I need a Facebook account or cookies to use this?**\
A: No! Public posts, public pages, public hashtag feeds, and reels can be scraped completely anonymously without logging in. Session cookies are only required if you need to scrape age-restricted or country-locked content.

**Q: Can I download the videos directly from the dataset?**\
A: Yes! Every video and reel record contains `downloadable_url`, pointing directly to the Facebook CDN progressive MP4 stream. You can download it directly using any HTTP client or browser.

**Q: How do I export data to Excel or Google Sheets?**\
A: Set `"flattenOutput": true`. In the Apify Console Dataset tab, click **Export** and choose **CSV** or **Excel**.

***

### 📧 Support & Custom Features

Need custom scrapers, dedicated enterprise proxies, or specific field extractions?\
Contact: **<codenest2.0@gmail.com>**

# Actor input Schema

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

Optional: List of direct Facebook post URLs (photos, multi-image albums, videos, or reels). Examples: https://www.facebook.com/reel/123 or https://www.facebook.com/watch/?v=123

## `pageUrls` (type: `array`):

Optional: Enter one or more Facebook page URLs to scrape reels from. Example: https://www.facebook.com/ExamplePage/

## `hashtags` (type: `array`):

Optional: Enter Facebook hashtags to scrape reels from (e.g. \['comedy', 'sports', 'news']).

## `maxPosts` (type: `integer`):

Maximum number of reels to scrape per page/hashtag. The scraper scrolls until this target is met. Default is 50. Free users are limited to 5.

## `include_comments` (type: `boolean`):

Toggle ON to extract recent comments for each direct post (charges additional pay-per-event fee).

## `max_comments` (type: `integer`):

Maximum number of recent comments to extract per post (applicable when Include Comments is ON).

## `flattenOutput` (type: `boolean`):

If checked, pushes each reel as an individual dataset row instead of grouping by page.

## `maxConcurrency` (type: `integer`):

Maximum number of post video/media URLs to fetch in parallel. Default is 10.

## `headless` (type: `boolean`):

Run Playwright browser in headless mode. Default is true.

## `proxy` (type: `object`):

Optional: Apify Proxy configuration. Recommended to prevent Facebook IP rate limits.

## `cookie_header` (type: `string`):

Optional: Facebook session cookies string or raw cookie header. Enables scraping behind login walls.

## Actor input object example

```json
{
  "pageUrls": [],
  "hashtags": [],
  "maxPosts": 50,
  "include_comments": false,
  "max_comments": 25,
  "flattenOutput": false,
  "maxConcurrency": 10,
  "headless": true,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "cookie_header": ""
}
```

# Actor output Schema

## `allResults` (type: `string`):

Complete dataset containing full metadata, downloads, and engagement metrics.

## `outputRecord` (type: `string`):

Consolidated JSON array of all scraped items stored in the default Key-Value Store.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("codenest/facebook-reels-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("codenest/facebook-reels-scraper").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 '{}' |
apify call codenest/facebook-reels-scraper --silent --output-dataset

```

## MCP server setup

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

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/CqwhT1Mb9KLywSMfE/builds/UfIAbnL6b1d0a3Syf/openapi.json
