# Facebook Comments Scraper (PPR)💬 (`powerful_bachelor/facebook-comments-scraper-ppr`) 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-ppr.md
- **Developed by:** [Powerful Bachelor](https://apify.com/powerful_bachelor) (community)
- **Categories:** Developer tools, Social media, Other
- **Stats:** 135 total users, 5 monthly users, 100.0% runs succeeded, 7 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 comments

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/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

![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-ppr").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-ppr").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 '{
  "startUrls": [
    "https://www.facebook.com/NASA/posts/pfbid02uEeubA7rvs7vuNJYJFALz21974HCr3yj9NKv7iNLN8sNMKDRAK5fPmbyEFkp6irl"
  ]
}' |
apify call powerful_bachelor/facebook-comments-scraper-ppr --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9oveaInC5qnv0Aw82/builds/UHe6AEM8J8fWUqrgn/openapi.json
