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

💬 Scrape high-quality comments from public Facebook posts with detailed metrics like 👍 likes, 💬 reply count & ⏱ timestamps. Perfect for sentiment analysis, research, influencer tracking & social trend analysis. Export results as JSON, CSV, Excel, or HTML!

- **URL**: https://apify.com/powerful_bachelor/facebook-comments-scraper.md
- **Developed by:** [Powerful Bachelor](https://apify.com/powerful_bachelor) (community)
- **Categories:** Social media, Developer tools, Other
- **Stats:** 49 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.40 / 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?

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

![Instagram Tagged & Mentions Posts Scraper PPR](https://apify.com/actor-badge?actor=powerful_bachelor/Facebook-Comments-Scraper-ppr)

## 📘 Facebook **Comments** Scraper

### 🚀 Overview

**Facebook Comments Scraper** is a lightweight but powerful Apify actor that pulls high-signal discussion data from **public Facebook posts**.

It extracts every top-level comment — along with detailed engagement metrics like 👍 likes, 💬 replies, and ⏱ timestamps — allowing you to convert unstructured social conversations into actionable insights.

Whether you're a **marketer**, **researcher**, **developer**, or **data analyst**, this tool helps you stay ahead by providing real-time visibility into audience reactions, emerging trends, and content performance.

It’s especially useful for:

- 🧠 **Product & Brand Sentiment Analysis**: Understand how users are reacting to your products, ads, or brand mentions in public Facebook posts.
- 📣 **Influencer Campaign Monitoring**: Track how well influencer posts are engaging audiences across different regions or demographics.
- 📊 **Market Research**: Spot behavioral patterns and collect qualitative data for targeted surveys or segmentation.
- 🏛 **Political & Social Research**: Scrape comment sections on political or policy-related posts to monitor public opinion and voter sentiment.
- 🚨 **Misinformation & Content Moderation Studies**: Detect engagement patterns around false claims or toxic discussions.
- 🎓 **Academic Studies**: Use as a dataset generator for NLP models, opinion mining, or social media discourse analysis.

This actor enables **automated**, **scalable**, and **repeatable** comment extraction — no browser automation, no manual effort.

***

### 🛠 Key Features

| 🔹 Feature              | 💡 What you get                                                                                    |
| ----------------------- | -------------------------------------------------------------------------------------------------- |
| 📝 **Comment body**     | Full text, emoji and all.                                                                          |
| 🙋 **Author info**      | Commenter ID and profile link (when public).                                                       |
| 🕒 **Timestamps**       | Exact UNIX time to analyse activity peaks.                                                         |
| 📈 **Engagement**       | <br>• `likes_count` (integer) 👍<br>• `reply_count` (integer) 💬<br>• `is_live_video_comment` flag |
| 📦 **Multiple formats** | JSON, CSV, Excel, XML or HTML via Apify storage.                                                   |

***

### ⚡ Quick Start

1. 🔁 **Clone** / fork the actor or install from Apify Store
2. 🌐 **Put your post URLs** in `storage/key_value_stores/default/INPUT.json`
3. ▶️ Click **“Save & Start”**

***

### 🧾 Input Parameters

```json
{
    "maxResults": 40,
    "startUrls": ["https://www.facebook.com/Cristiano/posts/10161345601032164"]
}
```

### 📤 Output Example

Each output item includes:

```json{
    "comment_id": "17938403948273912",
    "feedback_id": "1837320198273947",
    "commentor_id": "1000123456789",
    "comment_text": "This goal was insane 🔥",
    "author": {
        "name": "John Doe",
        "url": "https://facebook.com/johndoe"
    },
    "created_time": 1719814023,
    "is_live_video_comment": false,
    "likes_count": 235,
    "reply_count": 12
}
```

- 📁 Data is stored in Apify's dataset — export it as JSON, CSV, Excel, or HTML.

### 💬 Feedback & Support

We appreciate your support and contributions! 🤝

#### 🐛 Found a bug? 💡 Want a feature added?

1. Open an Issue in the GitHub issues tab.
2. Include the run ID or error message, if available.
3. We aim to respond within 24 hours ⏳

# Actor input Schema

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

Enter the Facebook post URLs you want to scrape comments from.

## `maxResults` (type: `integer`):

Select the number of comments you want to scrape.If this limit is not set, by default 15 comments will be returned

## `filter` (type: `string`):

Choose the way the comments are sorted

## Actor input object example

```json
{
  "startUrls": [
    "https://www.facebook.com/NASA/posts/pfbid02uEeubA7rvs7vuNJYJFALz21974HCr3yj9NKv7iNLN8sNMKDRAK5fPmbyEFkp6irl"
  ],
  "maxResults": 15,
  "filter": "mostRelevant"
}
```

# Actor output Schema

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

No description

# 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/NASA/posts/pfbid02uEeubA7rvs7vuNJYJFALz21974HCr3yj9NKv7iNLN8sNMKDRAK5fPmbyEFkp6irl"
    ]
};

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

# Run the Actor and wait for it to finish
run = client.actor("powerful_bachelor/facebook-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/NASA/posts/pfbid02uEeubA7rvs7vuNJYJFALz21974HCr3yj9NKv7iNLN8sNMKDRAK5fPmbyEFkp6irl"
  ]
}' |
apify call powerful_bachelor/facebook-comments-scraper --silent --output-dataset

```

## MCP server setup

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