# Facebook Comments Scraper (`parseforge/facebook-comments-scraper`) Actor

Collect public Facebook post comments at scale. Export author name, profile link, comment text, timestamp, reaction counts, reply threads, verified badges, attached media, mentions and language. Pass any post URL and pull thousands of comments into clean JSON, CSV or Excel files.

- **URL**: https://apify.com/parseforge/facebook-comments-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Social media, Lead generation, Marketing
- **Stats:** 32 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#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

![ParseForge Banner](https://github.com/ParseForge/apify-assets/blob/ad35ccc13ddd068b9d6cba33f323962e39aed5b2/banner.jpg?raw=true)

## 💬 Facebook Comments Scraper

> 🚀 **Pull every public comment from any Facebook post.** Export threaded replies, author profiles, reaction counts, timestamps, mentions, attachments and language detection into clean JSON, CSV or Excel.

The **Facebook Comments Scraper** visits any public Facebook post and returns a full tree of comments, replies, reactions and author metadata. Each record carries the comment text, author name, author profile URL and profile picture, timestamp, reaction totals broken down by type, reply threads, attachment type and URL (sticker, GIF, image, video), verified badge, edited flag, mentions tagged in the comment, detected language and the parent comment id for replies.

The scraper paginates through comment sections the same way the native UI does, so popular posts with tens of thousands of comments export end to end. You pass one or more post URLs, set a cap per post, and the dataset lands ready for downstream sentiment analysis, audience research, review mining or lead scoring.

| 🎯 Target Audience | 💡 Primary Use Cases |
|---|---|
| Social media analysts, brand monitoring teams, marketing researchers, product managers, customer support leads, agencies | Sentiment tracking, audience feedback mining, crisis detection, competitor monitoring, influencer identification, UGC analysis |

### 📋 What the Facebook Comments Scraper does

Five common workflows in a single run:

- 💬 **Full comment thread export.** Every top-level comment plus nested replies, with parent pointers that rebuild the tree on your side.
- 👥 **Author metadata.** Name, profile URL, profile picture, and a verified-badge flag where Facebook exposes it.
- ❤️ **Reaction intelligence.** Total reaction count plus a breakdown across love, laugh, wow, sad, angry and like.
- 🧵 **Attachments and mentions.** Sticker, GIF, image and video attachments with source URLs, plus a mentions array with @-tagged profile names and ids.
- 🌐 **Language detection.** Each comment tagged with its detected two-letter language code for multilingual filtering.

> 💡 **Why it matters:** Facebook's native export tools strip almost every field you actually need for analysis. Rebuilding a parser yourself means handling GraphQL pagination, reaction breakdown decoding, and reply-depth tracking by hand. This Actor gives you the full comment graph, typed and cleaned, on every run.

### 📊 Data fields

Each record includes: `attachmentType`, `attachmentUrl`, `authorId`, `authorName`, `authorPicUrl`, `authorUrl`, `commentId`, `isAuthorVerified`, `isEdited`, `language`, `mentions`, `parentCommentId`, `postId`, `postUrl`, `reactionBreakdown`, `reactionsCount`, `replies`, `repliesCount`, `scrapedAt`, `text`, `timestamp`. All 21 field names come from a real production run, so what you see here is what lands in your dataset.

### 🚀 How to use

1. Copy a Facebook post URL from your browser.
2. Paste it into the `startUrls` field.
3. Set `maxItems` to your budget, and toggle `includeReplies` if you want nested threads.
4. Run the Actor and download JSON, CSV or Excel from the dataset tab.

### 🔗 Recommended Actors

| Actor | What it does |
|---|---|
| [Facebook Groups Scraper](https://apify.com/parseforge/facebook-groups-scraper) | Pulls member count, privacy, rules and admin info from public Facebook groups. |
| [Facebook Marketplace Scraper](https://apify.com/parseforge/facebook-marketplace-scraper) | Exports listings, prices and sellers from Facebook Marketplace by city and query. |
| [Instagram Scraper](https://apify.com/parseforge/instagram-scraper) | Posts, reels and profile data from public Instagram accounts. |
| [TikTok Comments Scraper](https://apify.com/parseforge/tiktok-comments-scraper) | Same depth of comment extraction for TikTok videos. |
| [YouTube Transcript Scraper](https://apify.com/parseforge/youtube-transcript-scraper) | Turn YouTube videos into searchable transcripts and metadata. |

### 💡 Tips

- Start with `maxItems=10` on a single URL to confirm field coverage before scaling.
- Posts with millions of comments will paginate for a while; run during off-hours and keep `maxCommentsPerPost` set so one post doesn't exhaust your budget.
- Save the JSON output alongside the `postUrl` and `scrapedAt` fields so you can diff reaction counts over time.

### ⚠️ Disclaimer

This Actor collects only publicly accessible data. You are responsible for complying with Facebook's Terms of Service, local data-protection laws, and any applicable research or journalism ethics. We recommend reviewing your use case against GDPR, CCPA and Facebook's Platform Policy before archiving or redistributing personal data.

### 🆘 Need Help?

If you hit a bug, have questions about setup, or need a scraper we haven't built yet, open our [contact form](https://tally.so/r/BzdKgA) or write to parseforge@protonmail.com. We also take on paid custom data projects.

For faster answers, join our [Discord](https://parseforge.co/discord). It's the best place to get support and suggest new actors.

# Actor input Schema

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

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

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

List of Facebook post URLs to scrape comments from. Supported formats: https://www.facebook.com/{user}/posts/{id}, https://www.facebook.com/permalink.php?story\_fbid=..., https://www.facebook.com/groups/{id}/posts/{id}.

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

Maximum number of comments to scrape per post. Leave empty to use maxItems as the global limit.

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

Include nested replies for each comment. When enabled, replies array is populated (billed as premium reply-included event).

## `proxyConfiguration` (type: `object`):

Residential proxies recommended for reliable extraction.

## Actor input object example

```json
{
  "maxItems": 10,
  "startUrls": [
    {
      "url": "https://www.facebook.com/MrBeast/posts/pfbid0PYGe82yNLYiwuKb3xHUbSqkr3nNoKsYT77zevBMd5nUn51ewN5mbLxNLCFkeaTxul"
    }
  ],
  "maxComments": 50,
  "includeReplies": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Dataset with scraped Facebook comments

# 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 = {
    "maxItems": 10,
    "startUrls": [
        {
            "url": "https://www.facebook.com/MrBeast/posts/pfbid0PYGe82yNLYiwuKb3xHUbSqkr3nNoKsYT77zevBMd5nUn51ewN5mbLxNLCFkeaTxul"
        }
    ],
    "maxComments": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/facebook-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 = {
    "maxItems": 10,
    "startUrls": [{ "url": "https://www.facebook.com/MrBeast/posts/pfbid0PYGe82yNLYiwuKb3xHUbSqkr3nNoKsYT77zevBMd5nUn51ewN5mbLxNLCFkeaTxul" }],
    "maxComments": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/facebook-comments-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 10,
  "startUrls": [
    {
      "url": "https://www.facebook.com/MrBeast/posts/pfbid0PYGe82yNLYiwuKb3xHUbSqkr3nNoKsYT77zevBMd5nUn51ewN5mbLxNLCFkeaTxul"
    }
  ],
  "maxComments": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call parseforge/facebook-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/facebook-comments-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/Ob40pPCUlyUqTfkn4/builds/36Dghog9EMcR9UleM/openapi.json
