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

Export public Facebook post comments for social listening, moderation analysis, campaign reporting, and creator intelligence workflows.

- **URL**: https://apify.com/fetch\_cat/facebook-comments-scraper.md
- **Developed by:** [Hanna Nosova](https://apify.com/fetch_cat) (community)
- **Categories:** Social media, Marketing, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.23 / 1,000 comment extracteds

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

## Facebook Comments Scraper

Export public Facebook post comments into a structured dataset for social listening, creator intelligence, moderation review, campaign reporting, and brand monitoring.

Use this Actor when you need a repeatable way to collect visible public comments from one or more Facebook post URLs, download them as CSV/JSON/Excel, or call them from a workflow as a Facebook comments API alternative.

### At a glance

- **Primary job**: Export Facebook comments data from public post URLs.
- **Input**: One or more public Facebook post URLs plus a per-post comment limit.
- **Output**: One dataset row per saved comment with author name, comment text, relative date, likes, source post URL, raw visible text, and scrape timestamp.
- **Best for**: Social listening, engagement analysis, moderation triage, creator intelligence, dashboards, alerts, and research exports.

### Who is it for?

- **Social listening teams** tracking public reactions to brand, creator, media, or campaign posts.
- **Moderation and community teams** reviewing public comment text, authors, and source URLs in downstream tools.
- **Analysts and researchers** building repeatable Facebook comments exports for dashboards, notebooks, alerts, or archives.

### Common workflows

- **Brand monitoring**: Schedule repeat runs for campaign or announcement posts and compare newly visible comments over time.
- **Creator intelligence**: Export audience replies from public creator posts for topic, sentiment, or engagement analysis.
- **Moderation review**: Send comment text, author names, and source URLs to review queues or BI tools.
- **Automation**: Use the Apify API, webhooks, MCP, or dataset exports to feed alerts, warehouses, notebooks, and reporting workflows.

### Ready-to-run examples

- [Scrape Facebook Comments From a Public Post](https://apify.com/fetch_cat/facebook-comments-scraper/examples/scrape-facebook-comments-from-public-post) exports visible comments from one public post.
- [Export Facebook Comments Data](https://apify.com/fetch_cat/facebook-comments-scraper/examples/export-facebook-comments-data) creates a small CSV-, JSON-, Excel-, and API-ready dataset.
- [Monitor Public Facebook Post Comments](https://apify.com/fetch_cat/facebook-comments-scraper/examples/monitor-public-facebook-post-comments) provides a bounded input for recurring social-listening runs.
- [Compare Facebook Comments Across Posts](https://apify.com/fetch_cat/facebook-comments-scraper/examples/compare-facebook-comments-across-posts) processes several public posts for campaign or creator comparisons.
- [Facebook Comments API Example](https://apify.com/fetch_cat/facebook-comments-scraper/examples/facebook-comments-api-example) shows the saved input for an API-driven comments export.

### What data can you extract?

| Field | Description |
| --- | --- |
| `commentId` | Stable ID generated for the source post/comment row. |
| `sourcePostUrl` | Facebook post URL that produced the comment. |
| `postTitle` | Visible post/page label or title captured from the public page. |
| `authorName` | Publicly visible comment author name. |
| `authorUrl` | Public author/profile URL when Facebook exposes it in the logged-out view. |
| `commentText` | Cleaned visible comment text. |
| `relativeDate` | Visible Facebook relative date label, such as `2w` or `1y`. |
| `likeCount` | Visible comment-like count when present. |
| `replyDiagnostics` | Visible reply count/label when present. |
| `commentPermalink` | Comment permalink when Facebook exposes it publicly. |
| `rawText` | Raw visible row text used for audit and parser diagnostics. |
| `scrapedAt` | ISO timestamp when the row was saved. |

### Input configuration

| Setting | JSON key | Use it for | Example |
| --- | --- | --- | --- |
| Public Facebook post URLs | `startUrls` | Post URLs to process. Private, deleted, or login-only posts return diagnostics instead of guessed data. | `[{"url":"https://www.facebook.com/humansofnewyork/posts/..."}]` |
| Maximum comments per post | `maxCommentsPerPost` | Cap saved comments per post and control spend. | `20` |
| Legacy alias | `maxItems` | Backward-compatible alias for older integrations. Prefer `maxCommentsPerPost`. | `20` |

### Example input

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl"
    }
  ],
  "maxCommentsPerPost": 20
}
```

### Example output

```json
{
  "commentId": "a1b2c3d4e5f6",
  "sourcePostUrl": "https://www.facebook.com/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl",
  "postTitle": "Humans of New York",
  "authorName": "Jane Doe",
  "authorUrl": null,
  "commentText": "This story is beautiful.",
  "relativeDate": "2w",
  "likeCount": 12,
  "replyDiagnostics": "1 reply",
  "commentPermalink": null,
  "rawText": "Jane Doe 2w This story is beautiful. 12 1 reply",
  "scrapedAt": "2026-07-31T18:42:04.000Z"
}
```

### Pricing

This Actor uses pay-per-event pricing:

- **Run started**: charged once when a run starts to cover fixed startup work.
- **Comment extracted**: charged for each public Facebook comment row saved to the dataset.

Current rates and account-tier discounts are shown on the live [Apify Pricing tab](https://apify.com/fetch_cat/facebook-comments-scraper/pricing). Check that tab before running large jobs.

### Tips for best results

- Use public Facebook post URLs that load without being logged in.
- Start with a low `maxCommentsPerPost` value, review the dataset, then scale scheduled runs.
- Split very large monitoring jobs into smaller batches so one blocked or private post does not delay unrelated posts.
- Keep source post URLs in your downstream database so repeat exports can be deduplicated by `commentId` and `sourcePostUrl`.

### API usage

Node.js:

```js
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor("fetch_cat/facebook-comments-scraper").call({
  startUrls: [
    { url: "https://www.facebook.com/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl" }
  ],
  maxCommentsPerPost: 20
});
console.log(run.defaultDatasetId);
```

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("fetch_cat/facebook-comments-scraper").call(run_input={
    "startUrls": [
        {"url": "https://www.facebook.com/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl"}
    ],
    "maxCommentsPerPost": 20,
})
print(run["defaultDatasetId"])
```

cURL:

```bash
curl -X POST "https://api.apify.com/v2/acts/fetch_cat~facebook-comments-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":[{"url":"https://www.facebook.com/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl"}],"maxCommentsPerPost":20}'
```

### MCP and AI agents

Use this Actor from MCP-compatible tools through the official Apify MCP Server.

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=fetch_cat/facebook-comments-scraper"
```

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=fetch_cat/facebook-comments-scraper"
    }
  }
}
```

Example prompt: "Run Facebook Comments Scraper for this public post URL and summarize the most common customer complaints in the exported comments."

### Limits and caveats

- The Actor runs against public, visible Facebook post pages. It does not log in, bypass privacy settings, or return private comments.
- Facebook can hide, reorder, or limit comments in public views; the dataset reflects what was visible during the run.
- Some optional fields, especially author URLs and comment permalinks, are only saved when Facebook exposes them publicly.
- Relative dates are captured as displayed by Facebook. Use `scrapedAt` with `relativeDate` for freshness analysis.
- Process only public data you are allowed to access, and follow applicable terms and laws.

### Related actors

#### More Facebook scrapers

- [Facebook Ads Library Scraper](https://apify.com/fetch_cat/facebook-ads-library-scraper)
- [Facebook Events Scraper](https://apify.com/fetch_cat/facebook-events-scraper)
- [Facebook Marketplace Scraper](https://apify.com/fetch_cat/facebook-marketplace-scraper)
- [Facebook Pages Scraper](https://apify.com/fetch_cat/facebook-pages-scraper)
- [Facebook Reels Scraper](https://apify.com/fetch_cat/facebook-reels-scraper)

### FAQ

#### What data can I export with Facebook Comments Scraper?

You can export visible public comment text, author names, source post URLs, relative dates, likes when shown, reply labels when shown, raw visible text, and scrape timestamps.

#### Can I run Facebook Comments Scraper through an API, schedule, or MCP client?

Yes. You can call the Actor through the Apify API, schedule repeat monitoring runs, connect webhooks, or use the Apify MCP Server from compatible AI tools.

#### How much does it cost to use Facebook Comments Scraper?

The Actor charges a small run-start event and a per-comment event for each saved dataset row. Check the live Apify Pricing tab for current tier prices before running large jobs.

#### How do I export Facebook comments data to CSV or Excel?

Run the Actor with public post URLs, open the default dataset, and choose CSV, Excel, JSON, XML, RSS, or API export from Apify.

#### Why are some author URLs or comment links empty?

Facebook does not always expose profile links or comment permalinks in logged-out public views. The Actor leaves unavailable optional fields empty instead of guessing.

#### Can it scrape private groups or comments behind login?

No. The first version is limited to visible public post comments and does not use user accounts or private permissions.

### Support

Open an issue from the Actor page if a run fails or output looks wrong. Include the run ID or run URL, input JSON, expected output, actual output, and one reproducible public Facebook post URL.

# Actor input Schema

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

One or more public facebook.com post URLs. The actor runs logged out, so private posts or login-only comments return diagnostics instead of data.

## `maxCommentsPerPost` (type: `integer`):

Maximum number of visible public comments to save from each post URL.

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

Backward-compatible alias. Use maxCommentsPerPost for new integrations.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl"
    }
  ],
  "maxCommentsPerPost": 20
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `runSummary` (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": [
        {
            "url": "https://www.facebook.com/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl"
        }
    ]
};

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

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

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/bqj6x0kXn3kG4tR2s/builds/agUt9G3g8zOZluvE6/openapi.json
