# Facebook Comments Extractor 🗨️⚡: Data, Details & Analytics (`thedoor/facebook-comment-scraper`) Actor

💠 $0.5 / 1,000 results ·⚡ High-speed comment scraping for 100+ Facebook URLs per run — extract comments, replies, shared links, and images across Posts, Videos, Reels, and Groups.

- **URL**: https://apify.com/thedoor/facebook-comment-scraper.md
- **Developed by:** [TheDoor](https://apify.com/thedoor) (community)
- **Categories:** Developer tools, Automation, Social media
- **Stats:** 705 total users, 145 monthly users, 100.0% runs succeeded, 8 bookmarks
- **User rating**: 4.87 out of 5 stars

## Pricing

from $0.30 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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?

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 Comment Scraper — 100+ Post URLs in One Run

![Facebook comment scraping process](https://files.catbox.moe/whycon.png)

Scrape comments from **100+ Facebook URLs in one run** at high speed, including
replies, images, shared links, reaction totals, and author profiles. Supports
Posts, Videos, Reels, Groups, and almost every common Facebook URL format.
Built for AI agents, SaaS applications, and automation workflows.

### ⚡ Fast & Reliable

Built for high-volume comment collection in AI agents, SaaS apps, and automation workflows:

- **⚡ 100+ Facebook URLs in one run** with asynchronous bulk processing
- **🚀 Thousands of comments in minutes** with automatic retry on transient errors
- **🌐 Almost all common URL types** — posts, photos, videos, reels, groups, share links, and profile posts
- **🖼️ Rich comment data** — author profiles, profile pictures, comment images, media, and shared links
- **📊 Engagement data** — reaction totals, per-type reactions, replies, timestamps, and direct comment URLs

### Explore the full Facebook scraping toolkit

Need the posts before collecting comments? Use the [Facebook Group Post Scraper](https://apify.com/thedoor/facebook-group-post-scraper) for public group posts or the [Facebook Page Scraper](https://apify.com/thedoor/facebook-page-scraper) for page posts. Then send the resulting post URLs to this Actor to collect comments and replies.

***

### 📋 Supported URL Formats

| URL type | Example pattern | Accepted |
|---|---|:---:|
| Shared post link | `facebook.com/share/p/{share_id}/` | ✅ |
| Shared video link | `facebook.com/share/v/{share_id}/` | ✅ |
| Shared reel link | `facebook.com/share/r/{share_id}/` | ✅ |
| Reel | `facebook.com/reel/{reel_id}` | ✅ |
| Watch video | `facebook.com/watch/?v={video_id}` | ✅ |
| Page video | `facebook.com/{page}/videos/{video_id}` | ✅ |
| Group post | `facebook.com/groups/{group}/permalink/{post_id}/` | ✅ |
| Page post | `facebook.com/{page}/posts/{post_id}` | ✅ |
| Page post with pfbid | `facebook.com/{page}/posts/pfbid{...}` | ✅ |
| Legacy permalink | `facebook.com/permalink.php?story_fbid={post_id}&id={page_id}` | ✅ |
| Photo post | `facebook.com/photo/?fbid={photo_id}` | ✅ |

Shared links are automatically resolved to the underlying Facebook post before
comments are collected. Reel links are normalized to the equivalent Watch
surface when needed for reliable comment access.

***

### 📥 Input Configuration

#### Simple Input Example

##### Fixed Number of Comments

```json
{
    "postUrls": [
        "https://www.facebook.com/share/p/17UEMxPmxv/",
        "https://www.facebook.com/groups/n8n.automation/permalink/25205583905788653/",
        "https://www.facebook.com/watch/?v=1510975140138256"
    ],
    "orderingMode": "MOST_RELEVANT",
    "targetComments": 100,
    "includeReplies": true,
    "includeReactions": true
}
```

This collects up to 100 comments per Post URL.

##### All Available Comments

```json
{
    "postUrls": [
        "https://www.facebook.com/share/r/17SLmK3Z9c/"
    ],
    "orderingMode": "ALL",
    "targetComments": -1,
    "includeReplies": true,
    "includeReactions": true
}
```

Use `targetComments: -1` to collect **all available comments**. The Actor will
continue through every available comment page instead of stopping at a fixed
limit.

#### Input Options

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `postUrls` | List of Post URLs | Yes | - | Facebook Post URLs, including posts, videos, reels, photos, groups, and share links. Use an array even for one post |
| `orderingMode` | Text | No | `"MOST_RELEVANT"` | Comment order: `"MOST_RELEVANT"`, `"NEWEST"`, or `"ALL"` |
| `targetComments` | Number | No | `20` | Maximum comments per URL. Use `-1` to fetch **all available comments** |
| `includeReplies` | Boolean | No | `true` | When `true`, include nested replies; when `false`, return only top-level comments |
| `includeReactions` | Boolean | No | `true` | Include total reactions and reaction type counts |

`orderingMode` controls the order in which Facebook returns comments:

- `MOST_RELEVANT` — Facebook's ranked/relevant comments (default)
- `NEWEST` — newest comments first
- `ALL` — the unfiltered comments view

`targetComments` controls how many comments are collected per Post URL. Set it to
`-1` to fetch **all available comments**, regardless of the selected ordering
mode. This is recommended when completeness is more important than run time or
cost.

`includeReplies` controls reply collection. Set it to `true` to include the
complete nested reply tree, or `false` to return only top-level comments.
The Console displays this as a single on/off checkbox.

Each Post URL is checked before comment collection begins. Unavailable or restricted
posts are skipped, while other valid posts continue processing normally. Reel
links are automatically normalized when needed for reliable comment access.

`postUrls` must always be an array. For one URL, use for example:

```json
{
    "postUrls": [
        "https://www.facebook.com/share/r/17SLmK3Z9c/"
    ]
}
```

***

### 📤 Output Structure

#### Example Output

Each result represents one comment or reply. These examples show the main fields:

```json
{
    "post_url": "https://www.facebook.com/example-post-media",
    "text": "Example comment with an attached photo",
    "author_name": "Example User",
    "comment_url": "https://www.facebook.com/example-post-media?comment_id=.....",
    "media": [
        {
            "type": "Photo",
            "url": "https://cdn.example.com/example-photo.jpg"
        }
    ],
    "reactions_count": 128,
    "replies_count": 15
}
```

```json
{
    "post_url": "https://www.facebook.com/example-post-link",
    "text": "Example reply containing a shared link",
    "author_name": "Example Reply Author",
    "comment_url": "https://www.facebook.com/example-post-link?comment_id=.....",
    "media": [],
    "shared_post": null,
    "shared_link": "https://www.youtube.com/watch?v=example123",
    "reactions_count": 4,
    "replies_count": 2
}
```

#### Output Fields

| Field | Type | Description |
|-------|------|-------------|
| `post_url` | `string` | Source Facebook URL |
| `id` | `string` | Unique comment/reply ID |
| `comment_url` | `string` | Direct Facebook URL for the comment/reply |
| `text` | `string` | Comment text content |
| `timestamp` | `integer` | Unix timestamp (seconds) |
| `comment_time` | `string` | ISO 8601 datetime |
| `author_name` | `string` | Author display name |
| `author_id` | `string` | Author Facebook ID |
| `author_profile_picture` | `string` | Author profile picture URL (100% coverage) |
| `author_profile_url` | `string\|null` | Author profile URL (when available) |
| `image_url` | `string\|null` | Attached image URL (~4% of comments) |
| `media` | `array` | Attached comment media with ID, type, URI, URL, and thumbnail when available |
| `shared_post` | `object\|null` | Native Facebook post shared inside the comment, including URL, text, and media when available |
| `shared_link` | `string\|null` | Shared external link URL (~7% of comments) |
| `shared_link_title` | `string\|null` | Title of shared link |
| `shared_link_source` | `string\|null` | Source domain (e.g., "youtube.com") |
| `reactions_count` | `integer` | Total reaction count |
| `reaction_types` | `object` | Counts by type: `like`, `love`, `haha`, `wow`, `care`, `sad`, and `angry` |
| `replies_count` | `integer` | Number of direct replies |
| `is_reply` | `boolean` | `true` if this is a reply, `false` if top-level comment |
| `replyto_comment_id` | `string` | Parent comment ID (only for replies) |
| `depth` | `integer` | Nesting level (0 = top-level, 1+ = nested reply) |

#### Reaction Types

When reaction data is available, `reaction_types` contains the nonzero counts
returned by Facebook:

```json
{
    "like": 10,
    "love": 3,
    "haha": 2
}
```

Supported keys are `like`, `love`, `haha`, `wow`, `care`, `sad`, and `angry`.
Unknown Facebook reaction IDs are preserved as `unknown_<reaction_id>`.

***

### ✨ What You Get

#### Complete Comment Data

- 📝 Comment text and timestamps
- 👤 Author names and profile pictures
- 🖼️ Attached images (when available)
- 🔗 Shared links with titles (YouTube, articles, etc.)
- ❤️ Reaction counts (likes, loves, etc.)
- 💬 All replies and nested conversations

#### Easy to Use

- Just paste Facebook URLs and click "Start"
- Works with any public post, video, reel, or group
- Get results in minutes, not hours
- Download as JSON, CSV, Excel, or HTML
- No coding or technical skills needed

#### Reliable & Fast

- Automatically handles errors and retries
- Processes multiple URLs at once
- Extracts thousands of comments quickly
- Works with all Facebook URL formats

***

### 🚀 How to Use

#### Quick Start (No Coding Required)

1. **Open the actor** in Apify Console
2. **Paste Post URLs** - Copy and paste any Facebook post, video, reel, photo, or group URL
3. **Set options** (optional):
   - How many comments to get (default: 50, use -1 for all)
   - Include replies? (default: yes)
   - Sort by newest or most relevant
4. **Click "Start"** and wait for results
5. **Download data** - Get your results as JSON, CSV, Excel, or HTML

That's it! No technical knowledge needed.

### 💡 Use Cases

- **Market Research:** Analyze customer feedback and sentiment
- **Social Listening:** Monitor brand mentions and discussions
- **Content Analysis:** Study engagement patterns and trends
- **Lead Generation:** Find potential customers in relevant groups
- **Competitor Analysis:** Track competitor posts and engagement
- **Academic Research:** Collect data for social media studies

***

### 📜 Legal & Privacy

This scraper only collects publicly available data from Facebook. Users are responsible for:

- Complying with Facebook's Terms of Service
- Following data protection laws (GDPR, CCPA, etc.)
- Using scraped data ethically and legally
- Respecting user privacy

See [Apify's Terms of Service](https://apify.com/terms-of-service) for more information.

***

### ❓ FAQ

**Can I submit many URLs at once?**

Yes. Add all URLs to `postUrls`. The Actor can process **100+ URLs in one run**.

**Why did I receive fewer comments than requested?**

The post may contain fewer comments, comments may be restricted, or Facebook
may not expose the complete comment thread for that post.

**Can I collect every comment?**

Yes. Set `targetComments` to `-1`. The Actor will continue until no more
comments are available.

**Does `includeReplies` include nested replies?**

Yes. When enabled, replies and nested conversations are included. When disabled,
only top-level comments are returned.

**Are private or login-restricted posts supported?**

No. Public Facebook posts, videos, reels, photos, and group posts are supported.

**What happens if a URL is unavailable or has no comments?**

That URL is skipped and does not create an error record in the dataset. Other
valid URLs continue processing.

### 📞 Support

For bug reports, custom fields, or integration questions, contact
`tuananhhoangtran2010@gmail.com`.

# Actor input Schema

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

Enter one or more Facebook Post URLs. Use this list for a single post or 100+ posts in one run.

## `orderingMode` (type: `string`):

Comment ordering: MOST\_RELEVANT, NEWEST, or ALL

## `targetComments` (type: `integer`):

Number of comments to scrape per URL (-1 for all)

## `includeReplies` (type: `boolean`):

When enabled, include nested replies. When disabled, return only top-level comments.

## `includeReactions` (type: `boolean`):

Include total reactions and the available reaction type breakdown

## Actor input object example

```json
{
  "postUrls": [
    "https://www.facebook.com/share/p/1Bfb9bCnyH/",
    "https://www.facebook.com/share/v/1cWZPNC7k1/",
    "https://www.facebook.com/cnn/posts/pfbid0HhiQWrizKWmntpi9m1xzXQT4cC8iYLWqL4xbQDfXMRPhSeAymTXEqfQGP7memBvZl",
    "https://www.facebook.com/CNN/posts/1510975140138256",
    "https://www.facebook.com/CNN/videos/1510975140138256/",
    "https://www.facebook.com/groups/471031505578907/permalink/872874035394650",
    "https://www.facebook.com/permalink.php?story_fbid=1510975140138256&id=100064358273914",
    "https://www.facebook.com/photo/?fbid=2013556406001668&set=a.724234831600505",
    "https://www.facebook.com/watch/?v=1510975140138256",
    "https://www.facebook.com/reel/1397741784161219",
    "https://www.facebook.com/share/r/17SLmK3Z9c/"
  ],
  "orderingMode": "MOST_RELEVANT",
  "targetComments": 20,
  "includeReplies": true,
  "includeReactions": true
}
```

# Actor output Schema

## `allComments` (type: `string`):

Complete dataset with all comments and replies including nested threads, images, and shared links

## `topLevelComments` (type: `string`):

Only top-level comments (depth=0), excluding all replies

## `replies` (type: `string`):

Only replies to comments (depth>=1), excluding top-level comments

## `withImages` (type: `string`):

Only comments and replies that contain image attachments

## `withLinks` (type: `string`):

Only comments and replies that contain shared links

## `byAuthor` (type: `string`):

Comments grouped by author with engagement statistics

# 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 = {
    "postUrls": [
        "https://www.facebook.com/share/p/1Bfb9bCnyH/",
        "https://www.facebook.com/share/v/1cWZPNC7k1/",
        "https://www.facebook.com/cnn/posts/pfbid0HhiQWrizKWmntpi9m1xzXQT4cC8iYLWqL4xbQDfXMRPhSeAymTXEqfQGP7memBvZl",
        "https://www.facebook.com/CNN/posts/1510975140138256",
        "https://www.facebook.com/CNN/videos/1510975140138256/",
        "https://www.facebook.com/groups/471031505578907/permalink/872874035394650",
        "https://www.facebook.com/permalink.php?story_fbid=1510975140138256&id=100064358273914",
        "https://www.facebook.com/photo/?fbid=2013556406001668&set=a.724234831600505",
        "https://www.facebook.com/watch/?v=1510975140138256",
        "https://www.facebook.com/reel/1397741784161219",
        "https://www.facebook.com/share/r/17SLmK3Z9c/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thedoor/facebook-comment-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 = { "postUrls": [
        "https://www.facebook.com/share/p/1Bfb9bCnyH/",
        "https://www.facebook.com/share/v/1cWZPNC7k1/",
        "https://www.facebook.com/cnn/posts/pfbid0HhiQWrizKWmntpi9m1xzXQT4cC8iYLWqL4xbQDfXMRPhSeAymTXEqfQGP7memBvZl",
        "https://www.facebook.com/CNN/posts/1510975140138256",
        "https://www.facebook.com/CNN/videos/1510975140138256/",
        "https://www.facebook.com/groups/471031505578907/permalink/872874035394650",
        "https://www.facebook.com/permalink.php?story_fbid=1510975140138256&id=100064358273914",
        "https://www.facebook.com/photo/?fbid=2013556406001668&set=a.724234831600505",
        "https://www.facebook.com/watch/?v=1510975140138256",
        "https://www.facebook.com/reel/1397741784161219",
        "https://www.facebook.com/share/r/17SLmK3Z9c/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("thedoor/facebook-comment-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 '{
  "postUrls": [
    "https://www.facebook.com/share/p/1Bfb9bCnyH/",
    "https://www.facebook.com/share/v/1cWZPNC7k1/",
    "https://www.facebook.com/cnn/posts/pfbid0HhiQWrizKWmntpi9m1xzXQT4cC8iYLWqL4xbQDfXMRPhSeAymTXEqfQGP7memBvZl",
    "https://www.facebook.com/CNN/posts/1510975140138256",
    "https://www.facebook.com/CNN/videos/1510975140138256/",
    "https://www.facebook.com/groups/471031505578907/permalink/872874035394650",
    "https://www.facebook.com/permalink.php?story_fbid=1510975140138256&id=100064358273914",
    "https://www.facebook.com/photo/?fbid=2013556406001668&set=a.724234831600505",
    "https://www.facebook.com/watch/?v=1510975140138256",
    "https://www.facebook.com/reel/1397741784161219",
    "https://www.facebook.com/share/r/17SLmK3Z9c/"
  ]
}' |
apify call thedoor/facebook-comment-scraper --silent --output-dataset

```

## MCP server setup

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