# Facebook Comments Scraper: Public Posts (`earlytern/facebook-comments-scraper`) Actor

Collect comments from public Facebook posts, videos and Reels with author, text, time, reactions and replies. No login or cookies.

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

## Pricing

from $0.60 / 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.
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 Scraper: Public Posts

Collect comments from public Facebook posts without logging in. Get each comment's text, time, author's public name and profile link, reaction and reply counts, attached images, and, if you want them, the replies Facebook shows under each comment. Export the dataset as JSON, CSV, or Excel.

Use it to read audience reactions to a brand or competitor post, gather feedback on a product launch, monitor discussion on news posts, or build a research dataset from public conversations.

### What does Facebook Comments Scraper do?

- Reads the comments of one or more **public** Facebook posts, videos, reels, and photos.
- Pages through the comment list until your maximum per post is reached or no more comments are shown.
- Lets you choose the comment order: newest first, most relevant, or all comments.
- Optionally adds replies, including nested replies, with a link to the parent comment.
- Returns one row per comment, and a free row for a post that cannot be read.

### How many comments can it reach?

Facebook shows visitors who are not logged in only part of a post's comments. In our tests on large public page posts, the Actor reached about **35% to 50% of the top-level comments** Facebook counts for the post, and only some of the replies. The share depends on the post and can change at any time, so treat the results as a sample of the public discussion, not a complete export. `newest` is best for monitoring recent activity; `relevant` follows the order Facebook shows by default.

### Quick start

```json
{
  "urls": ["https://www.facebook.com/nike/posts/pfbid025EPsHxsGF3hbBUpfDCB5km6pcxt8exmDvHYGCqoXcKXnEsd7rkcJxzeF6SsyTk4Cl"],
  "maxComments": 50,
  "sort": "newest",
  "includeReplies": false
}
```

### Input

| Field | Meaning | Default |
|---|---|---|
| `urls` | 1–100 public post addresses: page posts, `permalink.php` links, videos, `/watch/?v=` links, reels, photos, or posts in public groups | Required |
| `maxComments` | Maximum comments per post, replies included, from 1 to 10,000 | 50 |
| `sort` | `newest`, `relevant`, or `all` | `newest` |
| `includeReplies` | Also collect the replies shown under each comment | `false` |
| `proxyCountry` | Two-letter connection country | US |

Page, profile, and group home addresses are refused: give the address of a single post. Short share links (`fb.watch`, `/share/`) are not supported; open them in a browser and copy the full post address.

Hosted runs use Apify residential proxy connections. The Actor sends no cookies, does not keep response cookies, and does not log in. When Facebook limits comment requests, the Actor waits, switches to a new connection, and tries again up to three times. If the limit does not clear, the post gets a free `blocked` row and the run continues with the next post.

### Output

Each `ok` row contains:

- `postUrl` and `postId` for the post the comment belongs to.
- `commentId`, `commentUrl`, `text`, and `publishedAt`.
- `authorName` and `authorUrl` for the public commenter when available.
- `reactions` (total reactions) and `replies` (the reply count Facebook shows).
- `images`: addresses of images or stickers attached to the comment. They may expire.
- `depth`: `0` for a comment, `1` for a reply, `2` for a reply to a reply, and `parentCommentId` for replies.
- `fetchedAt`: when the row was collected.

Example from a public news post, with author details removed and the text shortened (counts change over time):

```json
{
  "postUrl": "https://www.facebook.com/cnn/posts/pfbid0en5nov8BWSSE9uAcPwfJcfGW8xfj96aEr54P1UQZJSSceUspELf899dx61Py1gMml",
  "postId": "1542780811047898",
  "status": "ok",
  "reason": null,
  "commentId": "1798572965607942",
  "commentUrl": "https://www.facebook.com/cnn/posts/pfbid0en5nov8BWSSE9uAcPwfJcfGW8xfj96aEr54P1UQZJSSceUspELf899dx61Py1gMml?comment_id=1798572965607942",
  "parentCommentId": null,
  "depth": 0,
  "text": "Humanity matters more than power, land, or profit.",
  "publishedAt": "2026-11-21T04:33:43.000Z",
  "reactions": 7,
  "replies": 0,
  "images": []
}
```

A missing value is returned as `null` and is never replaced by zero. A `blocked`, `empty`, or `error` row explains a post that could not return comments, with the reason in `reason`. These rows are free. A post may return some comments followed by a free row if a later request is blocked.

### Price

**$0.75 per 1,000 comments on Free**, $0.70 on Bronze, $0.65 on Silver, and $0.60 on Gold and above. Each run also has a **$0.02 start fee** on every plan. Replies count as comments. Rows for private, removed, blocked, or empty posts have no charge. The Actor stops collecting at your maximum cost per run. Your Apify plan may separately account for compute and proxy usage.

### Limits and reliability

Facebook controls which comments visitors can see without login, so results are incomplete (see above) and this is not an archive guarantee. The Actor reads posts one at a time, pauses between requests, removes duplicate comments within a post, and stops a post if Facebook repeats a page. Very large requests can reach the run timeout before every post is read. Restarting a run may return comments already saved in a previous run.

The comment requests are discovered from the scripts Facebook serves with its pages. If Facebook changes its comment format, the Actor may need maintenance. Do not provide passwords, cookies, or private post addresses.

### Responsible use

Comments and commenter names are personal data. You are responsible for having a lawful basis to collect and process them (for example under the GDPR or other applicable privacy laws), respecting Facebook's terms, limiting retention, and honoring rights requests such as deletion. Public availability does not itself establish a lawful basis. This Actor does not collect private posts, private profiles, or anything behind a login. It is not affiliated with or endorsed by Meta or Facebook.

### Related Actors

Use [Facebook Posts Scraper](https://apify.com/earlytern/facebook-posts-scraper) to find public page posts and their addresses, then pass those addresses here. [Facebook Pages Scraper](https://apify.com/earlytern/facebook-pages-scraper) returns page details.

### FAQ

**Why did I get fewer comments than the post shows?** Facebook shows only part of the comments to visitors who are not logged in. The count on the post includes comments the Actor cannot see.

**Can I read comments on a private post or a private group?** No. Only posts anyone can see without login are supported. Others return a free `blocked` row.

**Does `maxComments` apply to the whole run?** No, it applies to each post. Use the maximum cost per run to cap the total.

**How do I keep only comments?** Filter the dataset for `status: "ok"`. Use `depth: 0` to drop replies.

# Changelog

This Actor's version history is a separate document: https://apify.com/earlytern/facebook-comments-scraper/changelog.md

# Actor input Schema

## `urls` (type: `array`):

Public Facebook posts, videos or Reels whose comments anyone can see without login. Posts that cannot be read return a free row.

## `maxComments` (type: `integer`):

The most comments to return for each post. Replies count toward this number.

## `sort` (type: `string`):

Newest first usually returns the most comments. Most relevant matches what visitors see first. All comments includes comments Facebook would otherwise hide.

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

Also return replies to comments. Facebook shows only some replies to visitors, so some may be missing.

## `proxyCountry` (type: `string`):

Country used to read public posts, such as US or GB.

## Actor input object example

```json
{
  "urls": [
    "https://www.facebook.com/nike/posts/pfbid025EPsHxsGF3hbBUpfDCB5km6pcxt8exmDvHYGCqoXcKXnEsd7rkcJxzeF6SsyTk4Cl"
  ],
  "maxComments": 10,
  "sort": "newest",
  "includeReplies": false,
  "proxyCountry": "US"
}
```

# 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 = {
    "urls": [
        "https://www.facebook.com/nike/posts/pfbid025EPsHxsGF3hbBUpfDCB5km6pcxt8exmDvHYGCqoXcKXnEsd7rkcJxzeF6SsyTk4Cl"
    ],
    "maxComments": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("earlytern/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 = {
    "urls": ["https://www.facebook.com/nike/posts/pfbid025EPsHxsGF3hbBUpfDCB5km6pcxt8exmDvHYGCqoXcKXnEsd7rkcJxzeF6SsyTk4Cl"],
    "maxComments": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("earlytern/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 '{
  "urls": [
    "https://www.facebook.com/nike/posts/pfbid025EPsHxsGF3hbBUpfDCB5km6pcxt8exmDvHYGCqoXcKXnEsd7rkcJxzeF6SsyTk4Cl"
  ],
  "maxComments": 10
}' |
apify call earlytern/facebook-comments-scraper --silent --output-dataset

```

## MCP server setup

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