# Facebook Comments Scraper — Posts, Reels & Replies (`apivault_labs/facebook-comments-scraper`) Actor

Export public Facebook text comments and optional direct replies from posts, videos and Reels to JSON or CSV. No login or external API key. Anonymous coverage can be smaller than Facebook's total count.

- **URL**: https://apify.com/apivault_labs/facebook-comments-scraper.md
- **Developed by:** [Apivault Labs](https://apify.com/apivault_labs) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.25 / 1,000 text comment or direct replies

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Scraper

Export public Facebook **posts, videos and Reels** to a JSON/CSV dataset of
text comments and optional **direct replies**. Review audience questions,
campaign feedback and discussions from several posts in one run.

| At a glance | What you get |
|---|---|
| Price | **$0.25 / 1,000 delivered comments or replies + Apify platform usage** |
| Extra fees | **No Actor start fee, reply add-on or CSV-export fee** |
| Access | **No Facebook login, cookies or external API key required** |
| Limits | Up to **10 direct post/video/Reel URLs** and **100 total output rows** |
| Replies | Optional direct text replies; each reply counts toward the total limit |
| Downloads | Dataset JSON/CSV, `COMMENTS.csv` and coverage/error `SUMMARY` |

**Coverage:** Facebook chooses the comments visible without login. This
selection can be **much smaller than the total count shown on the post**.
Full coverage and chronological ordering are not guaranteed. Direct replies
are depth 1; deeper discussion trees are excluded.

![Facebook Comments Scraper: public comments and replies, JSON/CSV export](https://api.apify.com/v2/key-value-stores/VNpTAXVVg4foI3jxY/records/readme-cover-production-f7d2cb1f16c5.png)

### Start in under a minute

Paste a direct public Facebook URL, set your result limit and run:

```json
{
  "startUrls": [{"url": "https://www.facebook.com/NASA/videos/1139406561931708/"}],
  "maxItems": 10,
  "includeReplies": false
}
```

Open **Dataset > Export** for JSON/CSV, or use the output links for
`COMMENTS.csv` and `SUMMARY`. Ten delivered rows have a **$0.0025 result fee**,
plus Apify platform resources. Fewer comments may be available than requested.

### Include direct replies

Enable `includeReplies` to collect text replies under collected comments:

```json
{
  "startUrls": [{"url": "https://www.facebook.com/reel/813381761171953/"}],
  "maxItems": 25,
  "includeReplies": true
}
```

Both top-level comments and replies count toward `maxItems`. Each reply has
`depth: 1` and a `parentCommentId` pointing to a delivered top-level comment.
Facebook may report more replies than are accessible without login.

### Collect from several posts

```json
{
  "startUrls": [
    {"url": "https://www.facebook.com/NASA/videos/1139406561931708/"},
    {"url": "https://www.facebook.com/reel/813381761171953/"}
  ],
  "maxItems": 20,
  "includeReplies": false
}
```

URLs run in input order with **one shared output limit**. The first source can
use the entire limit. Duplicate input identities and comment IDs are removed.
Use separate runs when you need a specific result allowance for each source.

### Input reference

| Input | Default | Behavior |
|---|---|---|
| `startUrls` | Example URL in the form | Up to 10 direct HTTPS Facebook post, video or Reel URLs |
| `maxItems` | `10` | Total output ceiling, 1–100, including replies |
| `includeReplies` | `false` | Include direct text replies to collected top-level comments |
| `proxyConfiguration` | No proxy | Optional user-configured Apify proxy; proxy coverage/reliability is unverified and proxy costs may apply |

Use the direct link to a specific post, video or Reel. Page/profile URLs,
share-link discovery, keyword/reaction filters, date filters, newest ordering,
monitoring, sentiment and deeper reply trees are unsupported in this version.
Cookies, credentials and external API keys are not accepted.

### Output fields

| Field | Meaning |
|---|---|
| `sourceId`, `postUrl` | Source identity and permalink; an alias may resolve to its canonical source |
| `commentId`, `commentUrl` | Comment ID and source-provided permalink, when available |
| `text`, `createdAt` | Comment text and source timestamp in ISO format |
| `authorName`, `authorUrl` | Public author metadata, when available |
| `reactionCount` | Reported reaction count, when available |
| `parentCommentId`, `depth` | Top-level: `null` / `0`; direct reply: parent ID / `1` |
| `replyCount` | Reported count, which may exceed the replies accessible without login |

Unknown metadata stays `null`. The standalone `COMMENTS.csv` mirrors
acknowledged deliveries and escapes spreadsheet formulas. `SUMMARY` records
page/request counts, per-source row counts, remaining-page flags and errors.

### Coverage, partial results and errors

`sourceComplete=false` always identifies the anonymous coverage limitation.
When Facebook finishes serving its selected connection, that does not mean
every comment on Facebook was collected.

If a later request fails, already delivered rows remain available and `SUMMARY`
reports partial success. An unavailable source produces a diagnostic, never
a paid error row. A run with no useful rows because all sources failed is
marked failed. Intentionally empty input is a successful empty run.

Collection is bounded by **16 requests per source, 6 MB per response,
65 seconds per source and 120 seconds per run**, plus three redirects.
Private, hidden, deleted, login-only and non-text comments are excluded.
Source availability and anonymous coverage can vary by region and time.

### Pricing and automation

Each distinct delivered text comment or direct reply counts as **one paid
result** at **$0.25 per 1,000 results**, plus Apify platform usage. There is no
Actor start fee, reply add-on or extra result charge for CSV export.
Errors and empty collections have no result charge; resources can still cost
money. The run's result spending limit and `maxItems` can stop output early.

Run this Actor from the Apify API or an integration using the same JSON input.
Keep the Apify API token in your integration's credential store. After the run,
read `defaultDatasetId` for rows and `defaultKeyValueStoreId` for SUMMARY/CSV.
A useful workflow is to collect public Reel URLs first, then pass selected URLs
here to review audience feedback. Check the **Pricing** tab for the effective
tariff before a large batch.

# Actor input Schema

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

Up to 10 public URLs. Facebook selects the comments visible without login; its total comment count can be larger than the accessible selection.

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

Total output ceiling across all URLs, including direct replies. Fewer public text comments may be available.

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

Include text replies directly under collected top-level comments. Replies count toward maxItems. Deeper discussion trees are excluded.

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

Optional user-configured Apify proxy. Proxy access, reliability and cost have not been verified for this prototype.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/NASA/videos/1139406561931708/"
    }
  ],
  "maxItems": 10,
  "includeReplies": false
}
```

# Actor output Schema

## `comments` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `csv` (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/NASA/videos/1139406561931708/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("apivault_labs/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/NASA/videos/1139406561931708/" }] }

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

```

## MCP server setup

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