# Facebook Posts, Reels & Comments Scraper (`karamelo/facebook-posts-reels-comments-scraper`) Actor

Scrape public Facebook posts, reels, metrics, and comment threads anonymously without cookies or login.

- **URL**: https://apify.com/karamelo/facebook-posts-reels-comments-scraper.md
- **Developed by:** [karamelo](https://apify.com/karamelo) (community)
- **Stats:** 3 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 posts

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?

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 & Comments Scraper

Facebook Posts, Reels & Comments Scraper extracts public engagement metrics, detailed reaction breakdowns (`like`, `love`, `care`, `haha`, `wow`, `sad`, `angry`), captions, author details, and paginated comment threads from Facebook posts, reels, and video links. Paste direct post URLs, reel links, video URLs, or share links (`/share/p/`, `/share/r/`, `/share/v/`) to collect structured records ready for export to JSON, CSV, Excel, or XML. Social media analysts, brand marketers, and researchers use this Actor to measure post performance, analyze emotional reaction polarity, and monitor community sentiment across public Facebook content without requiring cookies or account login.

***

### Key Capabilities

- **Post & Reel Engagement Metrics:** Collect exact total reaction counts (`reactionCount`), likes (`likes`), video/reel play counts (`views`), comment totals (`commentsCount`), and share counts (`sharesCount`).
- **Granular Reaction Breakdowns:** Extract per-type reaction counts (`like`, `love`, `care`, `haha`, `wow`, `sad`, `angry`) on both posts/reels and individual comments via the structured `reactions` array.
- **Paginated Comment Threads:** Scrape top-level comments on both standard posts and Facebook Reels, including comment ID, author display name, comment text, total reactions, per-reaction breakdown, and ISO 8601 creation timestamp.
- **Universal URL Resolution:** Automatically resolves mobile and desktop share links (`/share/r/...`, `/share/p/...`, `/share/v/...`, `fb.watch/...`), opaque `pfbid` post links, `/reel/` links, `/videos/` links, and `story.php` permalinks to their canonical URL and numeric post/reel ID.
- **No Cookies or Login Required:** Operates purely on publicly visible Facebook posts and reels without risking personal accounts or session cookies.

***

### Quick Start

1. Open **Facebook Posts, Reels & Comments Scraper** in the Apify Console.
2. In **Post or Reel URLs** (`startUrls`), paste one or more public Facebook post, reel, or video links.
3. Set **Max comments per post/reel** (`maxComments`, default: `20`, or set to `0` to extract post metrics and reactions only).
4. Click **Start** to run the Actor.
5. Preview your results in the **Storage > Dataset** tab and export the dataset in JSON, CSV, Excel, or XML format.

#### Input Example

```json
{
  "startUrls": [
    "https://www.facebook.com/reel/2141054613462232/",
    "https://www.facebook.com/share/p/18V6K8bL6F/"
  ],
  "maxComments": 20
}
```

***

### Input Parameters

Configure the scraper using the following input fields:

| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| `startUrls` | Array of strings | `[]` | Yes | List of public Facebook post, reel, video, or share URLs to scrape. |
| `maxComments` | Integer | `20` | No | Maximum number of comments to extract per post or reel (`0` to `10000`). Set to `0` to skip comment extraction and collect only post/reel metadata and reactions. |

#### Supported URL Formats

The Actor accepts all standard desktop, mobile, and share-sheet Facebook URL formats:

| Content Type | URL Pattern Examples |
|---|---|
| **Reel Share Links** | `https://www.facebook.com/share/r/2141054613462232/` |
| **Post Share Links** | `https://www.facebook.com/share/p/18V6K8bL6F/` |
| **Video Share Links** | `https://www.facebook.com/share/v/CODE/` |
| **Direct Reel URLs** | `https://www.facebook.com/reel/2141054613462232/` |
| **Page Video URLs** | `https://www.facebook.com/username/videos/2141054613462232/` |
| **Direct Post URLs** | `https://www.facebook.com/username/posts/10161472895690758/` |
| **Opaque `pfbid` Post URLs** | `https://www.facebook.com/humansofnewyork/posts/pfbid02j21mpxEygikxxqKh3AaQxsct5vByRpuZVTgpBMELoKArJT6oJjvek8Y3TdRdDgvYl` |
| **Story / Permalink URLs** | `https://www.facebook.com/story.php?story_fbid=10161472895690758&id=100050429952420` |
| **Short Watch Links** | `https://fb.watch/CODE/` |

***

### What Data You Get

Each dataset item represents one scraped Facebook post, reel, or video, containing post-level metadata, engagement counters, a `reactions` breakdown array, and a `comments` array where each comment also includes its own `reactionCount` and `reactions` breakdown.

#### Example 1: Scraped Facebook Post with Multi-Reaction Breakdown

```json
{
  "id": "10161472895690758",
  "postId": "10161472895690758",
  "url": "https://www.facebook.com/humansofnewyork/posts/10161472895690758",
  "originalUrl": "https://www.facebook.com/share/p/18V6K8bL6F/",
  "type": "post",
  "status": "available",
  "platform": "FACEBOOK",
  "author": "humansofnewyork",
  "authorName": "Humans of New York",
  "caption": "Today in Manhattan...",
  "thumbnailUrl": "https://scontent.xx.fbcdn.net/v/t39.30808-6/...",
  "views": 0,
  "likes": 4520,
  "reactionCount": 4520,
  "reactions": [
    { "type": "like", "count": 2850 },
    { "type": "love", "count": 1420 },
    { "type": "care", "count": 210 },
    { "type": "haha", "count": 30 },
    { "type": "wow", "count": 8 },
    { "type": "sad", "count": 2 }
  ],
  "commentsCount": 184,
  "sharesCount": 312,
  "datePosted": "2026-04-10T15:30:00.000Z",
  "commentsScraped": 2,
  "comments": [
    {
      "id": "134859201948102",
      "author": "Sarah Jenkins",
      "text": "Such a touching story. Thank you for sharing!",
      "reactionCount": 59,
      "reactions": [
        { "type": "like", "count": 48 },
        { "type": "love", "count": 10 },
        { "type": "care", "count": 1 }
      ],
      "createdTime": "2026-04-10T16:02:12.000Z"
    }
  ],
  "scrapedAt": "2026-10-16T12:00:00.000Z"
}
```

#### Example 2: Scraped Facebook Reel with Raw Engagement Counts

```json
{
  "id": "2141054613462232",
  "postId": "2141054613462232",
  "url": "https://web.facebook.com/humansofnewyork/videos/henry-might-be-the-nicest-shopkeeper-in-nyc-you-can-visit-his-army-and-navy-bags/2141054613462232/",
  "originalUrl": "https://www.facebook.com/reel/2141054613462232/",
  "type": "reel",
  "status": "available",
  "platform": "FACEBOOK",
  "author": "humansofnewyork",
  "authorName": "Humans of New York",
  "caption": "Henry might be the nicest shopkeeper in NYC. You can visit his Army and Navy Bags store at 177 E Houston.",
  "thumbnailUrl": "https://scontent.xx.fbcdn.net/v/t15.5256-10/...",
  "views": 750971,
  "playCount": 750971,
  "videoViewCount": 364822,
  "likes": 19575,
  "reactionCount": 19575,
  "reactions": [
    { "type": "like", "count": 12831 },
    { "type": "love", "count": 6304 },
    { "type": "care", "count": 429 },
    { "type": "haha", "count": 8 },
    { "type": "wow", "count": 3 }
  ],
  "commentsCount": 839,
  "sharesCount": 707,
  "datePosted": "2026-09-19T20:18:16.000Z",
  "commentsScraped": 20,
  "comments": [
    {
      "id": "120956384129001",
      "author": "Kenji Takahashi",
      "text": "Henry is an absolute legend in the neighborhood!",
      "reactionCount": 283,
      "reactions": [
        { "type": "like", "count": 222 },
        { "type": "love", "count": 33 },
        { "type": "haha", "count": 24 },
        { "type": "care", "count": 2 },
        { "type": "wow", "count": 2 }
      ],
      "createdTime": "2026-09-19T21:02:18.000Z"
    }
  ],
  "scrapedAt": "2026-10-16T12:00:05.000Z"
}
```

***

### Output Schema Reference

#### 1. Post & Reel Top-Level Fields

| Field | Type | Description |
|---|---|---|
| `id` | String | Unique numeric Facebook post or reel identifier. |
| `postId` | String | Resolved numeric ID of the post or reel. |
| `url` | String | Resolved canonical permalink URL of the post or reel. |
| `originalUrl` | String | Exact input URL supplied in `startUrls`. |
| `type` | String | Content classification: `post`, `reel`, or `video`. |
| `status` | String | Availability status (`available`). |
| `platform` | String | Always `FACEBOOK`. |
| `author` | String / Null | Page handle or author username when present in the canonical URL. |
| `authorName` | String / Null | Display name of the page or creator. |
| `caption` | String | Full text body of the post or caption of the reel/video. |
| `thumbnailUrl` | String / Null | Direct URL to the post image or video/reel cover thumbnail. |
| `views` | Integer | Total play / view count (prioritizes exact unrounded play and view counts). |
| `playCount` | Integer / Null | Exact unrounded play count reported by Facebook for videos and reels. |
| `videoViewCount` | Integer / Null | Exact unrounded video view count reported by Facebook for videos and reels. |
| `likes` | Integer | Total reactions / likes count (alias of `reactionCount` for backward compatibility). |
| `reactionCount` | Integer | Total number of reactions across all reaction types on the post or reel. |
| `reactions` | Array of Objects | Breakdown of reactions by type (`[{ "type": "like", "count": 1027 }, ...]`). |

| `commentsCount` | Integer | Total comment count reported by Facebook on the post or reel. |
| `sharesCount` | Integer | Total share count reported by Facebook on the post or reel. |
| `datePosted` | String / Null | ISO 8601 timestamp indicating when the post or reel was published. |
| `commentsScraped` | Integer | Total number of comments extracted in the `comments` array for this run. |
| `comments` | Array of Objects | Extracted comment objects up to `maxComments`. |
| `scrapedAt` | String | ISO 8601 timestamp when the record was scraped. |

#### 2. Reaction Object (`reactions[]`)

Both top-level items and individual comments include a `reactions` array containing objects with the following structure:

| Field | Type | Description |
|---|---|---|
| `type` | String | Normalized Facebook reaction name: `like`, `love`, `care`, `haha`, `wow`, `sad`, or `angry`. |
| `count` | Integer | Number of users who reacted with this specific reaction type. |

#### 3. Comment Object (`comments[]`)

Each entry inside the `comments` array has the following fields:

| Field | Type | Description |
|---|---|---|
| `id` | String / Null | Unique Facebook comment ID. |
| `author` | String / Null | Display name of the comment author. |
| `text` | String | Plain-text body of the comment. |
| `reactionCount` | Integer | Total number of reactions on this comment. |
| `reactions` | Array of Objects | Per-type reaction breakdown on this comment (`like`, `love`, `care`, `haha`, `wow`, `sad`, `angry`). |
| `createdTime` | String / Null | ISO 8601 timestamp when the comment was posted. |

***

### Practical Use Cases

- **Emotional & Sentiment Polarity Analysis:** Go beyond simple like counts by comparing positive reactions (`love`, `care`) against humor (`haha`), surprise (`wow`), or negative reactions (`sad`, `angry`) on announcements, product launches, and news posts.
- **Viral Reel & Video Benchmarking:** Track view-to-reaction and view-to-share conversion ratios across Facebook Reels and video campaigns.
- **Community & Audience Intelligence:** Export comment threads along with their reaction counts and breakdowns to identify the most endorsed customer feedback, questions, or objections.
- **Creator & Influencer Due Diligence:** Audit public posts and reels from prospective brand partners to verify authentic audience discussion and organic reaction distributions.
- **Competitive Content Tracking:** Monitor public posts and reels from industry peers to see which topics generate high share counts and active comment discussions.

***

### Programmatic Usage & Data Processing Examples

#### Node.js Example: Scraping Posts, Reels & Analyzing Reactions

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

const client = new ApifyClient({
    token: 'YOUR_APIFY_TOKEN',
});

const input = {
    startUrls: [
        'https://www.facebook.com/reel/2141054613462232/',
        'https://www.facebook.com/share/p/18V6K8bL6F/',
    ],
    maxComments: 25,
};

const run = await client.actor('karamelo/facebook-posts-reels-comments-scraper').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();

for (const item of items) {
    const reactionSummary = (item.reactions || [])
        .map(r => `${r.type}: ${r.count}`)
        .join(', ');

    console.log(`[${item.type.toUpperCase()}] ${item.url}`);
    console.log(`  Author: ${item.authorName} | Views: ${item.views} | Total Reactions: ${item.reactionCount} (${reactionSummary})`);
    console.log(`  Shares: ${item.sharesCount} | Total Comments: ${item.commentsCount} | Scraped: ${item.commentsScraped}`);

    // Find top-reacted comment
    const topComment = [...(item.comments || [])].sort((a, b) => b.reactionCount - a.reactionCount)[0];
    if (topComment) {
        console.log(`  Top Comment (${topComment.reactionCount} reactions): "${topComment.text}" — ${topComment.author}`);
    }
}
```

#### Python Example: Exporting Reaction Breakdowns & Comments to Pandas

```python
from apify_client import ApifyClient
import pandas as pd

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "startUrls": [
        "https://www.facebook.com/reel/2141054613462232/",
        "https://www.facebook.com/share/p/18V6K8bL6F/",
    ],
    "maxComments": 50,
}

run = client.actor("karamelo/facebook-posts-reels-comments-scraper").call(run_input=run_input)
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())

## Build a flat DataFrame of posts/reels with individual reaction columns
rows = []
for item in items:
    reaction_map = {r["type"]: r["count"] for r in item.get("reactions", [])}
    rows.append({
        "id": item.get("id"),
        "type": item.get("type"),
        "author": item.get("authorName"),
        "views": item.get("views"),
        "reactionCount": item.get("reactionCount"),
        "like": reaction_map.get("like", 0),
        "love": reaction_map.get("love", 0),
        "care": reaction_map.get("care", 0),
        "haha": reaction_map.get("haha", 0),
        "wow": reaction_map.get("wow", 0),
        "sad": reaction_map.get("sad", 0),
        "angry": reaction_map.get("angry", 0),
        "sharesCount": item.get("sharesCount"),
        "commentsCount": item.get("commentsCount"),
        "url": item.get("url"),
    })

df = pd.DataFrame(rows)
print(df.to_string(index=False))
```

***

### Limitations & Fair Use

- **Public Content Only:** The Actor extracts data exclusively from publicly accessible Facebook posts, reels, and videos. Content restricted to logged-in users, private profiles, secret/closed groups, or age/country-gated pages cannot be accessed.
- **Reel Reaction Display:** On Facebook Reels, Facebook's Reel player displays a unified reaction counter for the video itself (`like`), while individual comments on the reel expose full multi-type reaction breakdowns (`like`, `love`, `haha`, `care`, `wow`, `sad`, `angry`). Standard Facebook posts expose full multi-type reaction breakdowns on both the post and its comments.
- **Comment Volume & Run Time:** Posts or reels with thousands of comments require multiple pagination requests. Adjust `maxComments` to balance depth of extraction with run speed.

***

### Troubleshooting & FAQ

| Observable Symptom | Possible Cause | Recommended Resolution |
|---|---|---|
| Target URL cannot be scraped | The post or reel was deleted, set to Friends-only, or restricted by age/country settings. | Open the URL in an incognito browser window to confirm it is publicly viewable without logging in. |
| `comments` array is empty (`[]`) | The post has no public comments, comments are disabled, or `maxComments` is set to `0`. | Verify that `maxComments` is greater than `0` and that comments are visible publicly on the target post. |
| `views` is `0` on a photo or text post | Facebook only reports video play counts (`views`) on video posts and reels. | Use `reactionCount`, `commentsCount`, and `sharesCount` to measure engagement on text and image posts. |
| Large batch run approaches timeout | Scraping many URLs with a high `maxComments` limit takes longer than the default run timeout. | Increase the Actor run timeout in Run Options or reduce `maxComments` per URL. |

# Actor input Schema

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

List of Facebook post or reel URLs to scrape. Supports /posts/, /reel/, /videos/, /share/p/, /share/r/, etc.

## `maxComments` (type: `integer`):

Maximum number of comments to extract per post or reel. Set to 0 to skip comments.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.facebook.com/reel/2141054613462232/"
  ],
  "maxComments": 20
}
```

# Actor output Schema

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

View the scraped Facebook posts, reels, and comments 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 = {
    "startUrls": [
        "https://www.facebook.com/reel/2141054613462232/"
    ]
};

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

# Run the Actor and wait for it to finish
run = client.actor("karamelo/facebook-posts-reels-comments-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 '{
  "startUrls": [
    "https://www.facebook.com/reel/2141054613462232/"
  ]
}' |
apify call karamelo/facebook-posts-reels-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,karamelo/facebook-posts-reels-comments-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/fZbZB2eEj4Wh2w8az/builds/jIW4n1VenJF8PMIsm/openapi.json
