# Facebook Comments & Replies Scraper (`data-slayer/facebook-comments-scraper`) Actor

Extract public Facebook comments and replies from known post, Reel, video, photo, permalink, or supported share URLs. Export thread relationships, text, timestamps, public author details, engagement counts, and attachments to JSON or CSV.

- **URL**: https://apify.com/data-slayer/facebook-comments-scraper.md
- **Developed by:** [Data Slayer](https://apify.com/data-slayer) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 facebook comment or replies

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

## Facebook Comments & Replies Scraper

Turn known public Facebook post, Reel, video, photo, permalink, or supported share URLs into clean comment and reply rows with stable thread relationships.

### Watch the demo

YouTube video coming soon.

### What this Actor does

Use this Actor for audience research, brand monitoring, customer-feedback analysis, creator research, and comment data pipelines when you already know the Facebook content to inspect.

Every available public comment becomes one dataset row. Turn on reply expansion to save replies as separate rows with their parent and root comment IDs. The Actor does not search Facebook for posts and does not treat status messages as paid results.

### Input

| Field | Type | Required | Default | Limits | Purpose |
| --- | --- | --- | --- | --- | --- |
| `postUrlsOrIds` | array of strings | yes | example URL | 1–20 entries; each at most 500 characters | Direct public post, Reel, video, photo, permalink, supported share URL, or numeric post ID. |
| `maxCommentsPerPost` | integer | no | `500` | 1–5,000 | Maximum combined comment and reply rows saved for each input. |
| `includeReplies` | boolean | no | `false` | — | Save public replies as paid rows when their parent is also saved. |

```json
{
  "postUrlsOrIds": ["https://www.facebook.com/example/posts/123456789012345"],
  "maxCommentsPerPost": 500,
  "includeReplies": false
}
```

Page, profile, feed, search, and group home URLs are not content inputs. Duplicate inputs are processed once.

### Output

Each unique delivered comment or reply creates one paid row.

| Field | Type | Nullable | Description |
| --- | --- | --- | --- |
| `postId`, `postUrl` | string | yes | Source content identity when available. |
| `commentId` | string | no | Stable comment or reply identity and deduplication key. |
| `commentUrl` | string | yes | Public comment link when available. |
| `parentCommentId` | string | yes | Direct saved parent for a reply; `null` for top-level comments. |
| `rootCommentId` | string | no | Saved top-level root for rebuilding a thread. |
| `depth` | integer | no | `0` for top-level comments; positive for replies. |
| `isReply` | boolean | no | Whether the row is a reply. |
| `text`, `publishedAt` | string | yes | Public text and exact timestamp when exposed. |
| `likeCount`, `reactionCount`, `replyCount` | integer | yes | Public counts when exposed; missing values stay `null`. |
| `author` | object | no | Public author ID, name, URL, and profile picture when exposed. |
| `attachments` | array | no | Public comment media metadata when exposed. |
| `requestedInput` | string | no | First submitted value that produced the row. |
| `retrievedAt` | string | no | UTC collection time. |

```json
[
  {
    "postId": "123456789012345",
    "postUrl": "https://www.facebook.com/example/posts/123456789012345",
    "commentId": "900000000000001",
    "commentUrl": "https://www.facebook.com/example/posts/123456789012345?comment_id=900000000000001",
    "parentCommentId": null,
    "rootCommentId": "900000000000001",
    "depth": 0,
    "isReply": false,
    "text": "A public comment used to illustrate the output contract.",
    "publishedAt": "2026-09-20T10:00:00Z",
    "likeCount": 3,
    "reactionCount": 4,
    "replyCount": 1,
    "author": {"id": "author-42", "name": "Example Person", "url": "https://www.facebook.com/example.person", "profileImageUrl": null},
    "attachments": [],
    "requestedInput": "https://www.facebook.com/example/posts/123456789012345",
    "retrievedAt": "2026-09-21T00:00:00.000Z"
  }
]
```

The example is illustrative and schema-validated locally; it is not a live result claim.

### Empty, unavailable, partial, and failed runs

Invalid input stops before retrieval. Private, deleted, unsupported, unavailable, confirmed-empty, and duplicate items do not become dataset rows and are not charged as comment results. Their safe outcomes remain in the free `RUN_SUMMARY` key-value record.

The summary distinguishes `succeeded`, `partial`, `empty`, `failed`, `charge_limit_reached`, `billing_uncertain`, and `cancelled`. It reports posts processed, requests made, unique rows delivered and charged, comments versus replies, duplicates, repeated pagination, safety-budget stops, and functional errors.

If a storage response fails after a write may have completed, the Actor stops with `billing_uncertain` and does not retry that row.

### Pricing

Pay per event: one small Actor-start event and one `facebook-comment` event for each unique public comment or reply successfully delivered.

| Plan | Actor start | Per row | 100 rows | 1,000 rows |
| --- | ---: | ---: | ---: | ---: |
| Free | $0.0050 | $0.0018 | $0.1850 | $1.8050 |
| Bronze | $0.0050 | $0.0016 | $0.1650 | $1.6050 |
| Silver | $0.0050 | $0.0014 | $0.1450 | $1.4050 |
| Gold | $0.0050 | $0.0012 | $0.1250 | $1.2050 |
| Platinum | $0.0050 | $0.0012 | $0.1250 | $1.2050 |
| Diamond | $0.0050 | $0.0012 | $0.1250 | $1.2050 |

Replies use the same row price and count toward `maxCommentsPerPost`. Platform compute usage, if any, is shown separately by Apify.

### Reliability and limits

- Transient rate-limit, server, and timeout failures use bounded retries and honor a short `Retry-After` value when available.
- Pagination, request count, runtime, per-post row count, and duplicate IDs are bounded.
- Public Facebook comment availability can differ by content type, region, viewer state, sorting, moderation, deletion, and visibility settings.
- The requested maximum is a cap, not a completeness promise. The Actor does not promise every comment shown in Facebook counters or every historical reply.
- Replies are saved only when the Actor can also save their parent and root rows.
- Timestamps, reaction counts, author links, profile pictures, and attachments may be missing or change later. Missing values stay `null`.
- Public media URLs can expire. Store only data you have a lawful reason to process.

### Use from the API

After publication, call the Actor with your Apify token:

```bash
curl "https://api.apify.com/v2/acts/data-slayer~facebook-comments-scraper/runs?token=<YOUR_APIFY_TOKEN>" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"postUrlsOrIds":["https://www.facebook.com/example/posts/123456789012345"],"maxCommentsPerPost":500,"includeReplies":false}'
```

The proposed slug is not live yet. This endpoint becomes valid only after an authorized release.

### FAQ

**How much does it cost to run this Actor?**
Pricing is listed in the Pricing section above, charged per row returned. You only pay for the rows
the Actor actually produces, so a small test run costs cents.

**Do I need cookies or a login?**
No. This Actor reads public data only - no cookies, no account, no browser automation.

**Can I schedule it?**
Yes. Run it from the Apify API, on a schedule, or via a webhook, and export results as JSON, CSV or Excel.

**What if I need a slightly different output?**
Open an issue on the Actor's Issues tab describing the shape you need.

### Related actors

More Facebook actors from the same portfolio. Apify only auto-recommends actors in the same category, so here are the rest of ours:

| Actor |
|---|
| [Facebook Ads Library Scraper](https://apify.com/data-slayer/facebook-ads-library-scraper) |
| [Facebook Events Scraper · No Cookies](https://apify.com/data-slayer/facebook-search-events) |
| [Facebook Group Posts Scraper · No Cookies](https://apify.com/data-slayer/facebook-group-posts) |
| [Facebook Keyword Post Search · Public Posts](https://apify.com/data-slayer/facebook-post-search) |
| [Facebook Marketplace Listing Scraper · No Cookies](https://apify.com/data-slayer/facebook-marketplace-details) |
| [Facebook Page Details Scraper · No Cookies](https://apify.com/data-slayer/facebook-page-details) |
| [Facebook Page Posts Scraper · No Cookies](https://apify.com/data-slayer/facebook-page-posts) |
| [Facebook Page Reviews Scraper · No Cookies](https://apify.com/data-slayer/facebook-page-reviews) |
| [Facebook Page Search Scraper · No Cookies](https://apify.com/data-slayer/facebook-search-pages) |
| [Facebook People Search Scraper · No Cookies](https://apify.com/data-slayer/facebook-search-people) |
| [Facebook Public Profile Scraper · People Lookup by URL or ID](https://apify.com/data-slayer/facebook-profile-scraper) |

# Actor input Schema

## `postUrlsOrIds` (type: `array`):

Add 1–20 direct public Facebook content URLs or numeric post IDs. Page, profile, feed, search, and group home URLs are not content inputs.

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

Maximum combined comment and reply rows saved for each input. Public availability can end before this limit.

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

Save public replies as separate paid rows when their parent comment is also saved. Reply expansion can increase the row count and runtime.

## Actor input object example

```json
{
  "postUrlsOrIds": [
    "https://www.facebook.com/example/posts/123456789012345"
  ],
  "maxCommentsPerPost": 500,
  "includeReplies": false
}
```

# Actor output Schema

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

One paid row per unique public comment or reply delivered to the dataset.

## `runSummary` (type: `string`):

Free outcome, post/request counts, stop reasons, safe errors, and billing reconciliation.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("data-slayer/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 = {}

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

```

## MCP server setup

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