# Facebook Public Post Comments (`automation-lab/facebook-public-post-comments`) Actor

Export public comments and replies from Facebook post, photo, video and reel links: text, author, date, likes, reply counts and threading. No login, no cookies.

- **URL**: https://apify.com/automation-lab/facebook-public-post-comments.md
- **Developed by:** [Automation Lab](https://apify.com/automation-lab) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 13 total users, 1 monthly users, 44.4% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.72 / 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 Public Post Comments

Export the public comments and replies from any public Facebook post, photo, video or reel. Paste the links, get one clean row per comment: text, author, date, likes, reply count, threading and attachments. No Facebook account, cookies or login needed.

### What does Facebook Public Post Comments do?

It opens each post link you give it the way a logged-out visitor sees it, then pages through the post's full comment list with Facebook's own comment loader. Every comment becomes one dataset row. Turn on **Include replies** and the replies under each comment (up to 3 levels deep) are exported too, each with its depth and the comment it answers.

- Works with post permalinks (`/posts/pfbid...`, `/<page>/posts/<id>`), photos (`/photo/?fbid=`, `/<page>/photos/<id>`), videos (`/watch/?v=`, `/<page>/videos/<id>`) and reels (`/reel/<id>`), plus `permalink.php?story_fbid=` / `story.php` links and "Copy link" share links (`/share/p/`, `/share/r/`, `/share/v/`).
- Three comment orders: all comments, newest first, or Facebook's "most relevant".
- Date cut-off: keep only comments newer than a date or a span such as `7 days`.
- Fast plain HTTP, no browser: hundreds of comments per minute.

### Who is it for?

- **Brand and social media teams** tracking what people say under their own and their competitors' posts.
- **Campaign and community managers** who export the comments of an ad, giveaway or announcement post.
- **Researchers and analysts** who need comment text for sentiment, topic or discourse analysis.
- **Agencies** that report audience reactions to clients every week.

### Why use this Facebook comments scraper?

- **No login and no cookies**: nothing of yours is put at risk, and runs keep working without a session to renew.
- **Replies included on request**, with `threadingDepth` and `replyToCommentId` so you can rebuild the threads.
- **Stable ids** (`commentId`) to de-duplicate across recurring runs.
- **Pay only for comments saved**: a link that cannot be read costs nothing.

### How to scrape Facebook post comments

1. Open the Actor and paste one or more Facebook post links into **Facebook post URLs**.
2. Set **Max comments per post** (replies count towards it).
3. Optionally turn on **Include replies**, choose a **Comment order** and a **newer than** cut-off.
4. Click **Start**. Download the comments as JSON, CSV, Excel or HTML, or read them through the API.

### Input

| Field | Type | Description |
|---|---|---|
| `startUrls` | array | Public Facebook post, photo, video or reel links. |
| `resultsLimit` | integer | Max rows per post, replies included. Default 50. |
| `includeNestedComments` | boolean | Also export replies (up to 3 levels). Default off. |
| `viewOption` | string | `RANKED_UNFILTERED` (all comments, default), `RECENT_ACTIVITY` (newest first) or `RANKED_THREADED` (most relevant). |
| `onlyCommentsNewerThan` | string | Optional: `2026-01-31`, `2026-01-31T18:00:00Z`, `7 days`, `24h`, `yesterday`. |

Example:

```json
{
    "startUrls": [
        { "url": "https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl" },
        { "url": "https://www.facebook.com/watch/?v=1056346190744779" }
    ],
    "resultsLimit": 200,
    "includeNestedComments": true,
    "viewOption": "RECENT_ACTIVITY",
    "onlyCommentsNewerThan": "7 days"
}
```

### Output

One row per comment or reply:

```json
{
    "facebookUrl": "https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl",
    "postId": "1685704526258250",
    "postTitle": "Teth... - NASA - National Aeronautics and Space Administration",
    "commentId": "1790717046388865",
    "commentNodeId": "Y29tbWVudDoxNjg1NzA0NTI2MjU4MjUwXzE3OTA3MTcwNDYzODg4NjU=",
    "commentUrl": "https://www.facebook.com/NASA/posts/pfbid02wE2...?comment_id=2332508050921595&reply_comment_id=1790717046388865",
    "text": "Moslim Oskanov IKR?!",
    "date": "2026-11-12T22:09:48.000Z",
    "timestamp": 1794521388,
    "likesCount": 0,
    "likesCountText": "0",
    "commentsCount": 0,
    "threadingDepth": 1,
    "replyToCommentId": "2332508050921595",
    "profileName": "Shelley Louise Greenaway",
    "profileId": "pfbid0TGb2BmZzZ7ZeHBzFux5FG...",
    "profileUrl": null,
    "profilePicture": "https://scontent.xx.fbcdn.net/v/t39.30808-1/...jpg",
    "isVerified": false,
    "attachments": [],
    "scrapedAt": "2026-11-14T07:12:14.122Z"
}
```

| Field | Meaning |
|---|---|
| `facebookUrl` | The post link you supplied. |
| `postId`, `postTitle` | The post's numeric id and page title. |
| `commentId`, `commentNodeId`, `feedbackId` | Comment ids: numeric, encoded node id, encoded feedback id. |
| `commentUrl` | Direct link to the comment. |
| `text` | Comment text. |
| `date`, `timestamp` | When it was written (ISO 8601 and Unix seconds). |
| `likesCount`, `likesCountText` | Reactions on the comment, as a number and as shown (e.g. `1.2K`). |
| `commentsCount` | Replies under the comment. |
| `threadingDepth`, `replyToCommentId` | 0 for a comment on the post, 1-3 for replies, and the comment a reply answers. |
| `profileName`, `profileId`, `profileUrl`, `profilePicture`, `isVerified` | The writer. People with private profiles have an encoded id and no profile link. |
| `attachments` | Photos, GIFs, stickers and links in the comment (`type`, `url`, `imageUrl`). |

### How much does it cost to scrape Facebook comments?

You pay a small fee per run plus a price per saved comment or reply. Platform usage is included.

| Plan | Per run | Per 1,000 comments |
|---|---:|---:|
| Free | $0.001 | $0.90 |
| Bronze (Starter) | $0.001 | $0.90 |
| Silver (Scale) | $0.001 | $0.81 |
| Gold and above (Business) | $0.001 | $0.72 |

Examples on the Free plan: 100 comments cost about $0.09; 1,000 comments about $0.90. The free $5 monthly credit covers about 5,500 comments. Set **Maximum charge per run** in the run options to cap any run.

### Tips

- For weekly monitoring use **Newest first** with **Only comments newer than** `7 days`: the run stops reading as soon as it reaches older comments.
- Use `commentId` as the key when you merge results of recurring runs.
- "All comments" returns more than "Most relevant", which lets Facebook hide some comments.
- The comment total Facebook shows counts replies too, so without replies you get fewer rows than that number.

### Use it through the API

Start a run and get the comments with cURL:

```bash
curl -X POST "https://api.apify.com/v2/acts/automation-lab~facebook-public-post-comments/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": [{"url": "https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl"}], "resultsLimit": 50}'
```

Or with Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("automation-lab/facebook-public-post-comments").call(run_input={
    "startUrls": [{"url": "https://www.facebook.com/watch/?v=1056346190744779"}],
    "resultsLimit": 200,
    "includeNestedComments": True,
})
for comment in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(comment["profileName"], comment["date"], comment["text"])
```

Or with JavaScript:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('automation-lab/facebook-public-post-comments').call({
    startUrls: [{ url: 'https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl' }],
    resultsLimit: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, 'comments');
```

### Use with AI agents through MCP

Connect the Actor to Claude, Cursor or another MCP client with the Apify MCP server. For Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/facebook-public-post-comments"
```

**Claude Desktop**: open Settings → Developer → Edit Config and add:

```json
{
    "mcpServers": {
        "apify": {
            "url": "https://mcp.apify.com?tools=automation-lab/facebook-public-post-comments"
        }
    }
}
```

**Cursor**: add the same `mcpServers` block to `~/.cursor/mcp.json` (or the project's `.cursor/mcp.json`).

**VS Code**: add the server to `.vscode/mcp.json`:

```json
{
    "servers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com?tools=automation-lab/facebook-public-post-comments"
        }
    }
}
```

Example prompts:

- "Export the newest 200 comments on this Facebook post and summarise the main complaints."
- "Get all comments and replies under our last campaign video and list the questions people asked."
- "Compare sentiment in the comments of these three competitor posts."

### Integrations

Send the comments to Google Sheets, Slack, Airtable, Make, Zapier, n8n or your own webhook with Apify integrations, and schedule runs to monitor posts every day or week.

### Is it legal to scrape Facebook comments?

This Actor reads only what Facebook shows to any logged-out visitor; it does not log in or get around privacy settings. Comments contain personal data (names, profile pictures, opinions), so you are responsible for having a lawful basis under GDPR, CCPA and similar laws, for keeping only what you need, and for following Facebook's terms. This Actor is not affiliated with, endorsed by or sponsored by Meta or Facebook. If unsure, ask a lawyer.

When a run or a post fails, the Actor sends sanitized diagnostic data (the exception, your input with secret fields and URL query strings removed, and the Actor, build and run IDs) to our private GlitchTip error-tracking service so we can repair it. Reports are retained for 30 days.

### FAQ

**Why do I get fewer comments than the count Facebook shows?** Facebook's count includes replies and comments it hides from logged-out visitors. Turn on **Include replies** and choose **All comments** to get the most.

**Can I scrape comments from Facebook groups?** Only from posts that Facebook shows to logged-out visitors. Posts in private or members-only groups and on private profiles are refused with a clear message and cost nothing.

**A link failed with "shows this post only to logged-in users". What now?** The post is not public. Check that it opens in a private browser window without logging in. A link that is not a Facebook post link is skipped and named in the run status; the other links still run.

**Does it download comment photos?** It returns the image and link URLs in `attachments`; it does not store files.

### Related Actors

- [Facebook Pages Posts Scraper](https://apify.com/automation-lab/facebook-pages-posts-scraper): timeline posts from Pages, to find post links to feed in here
- [Facebook Post Keyword Search](https://apify.com/automation-lab/facebook-public-post-keyword-search-scraper): find public posts by keyword
- [Facebook Reels Scraper](https://apify.com/automation-lab/facebook-reels-scraper): reels from a profile or Page
- [Facebook Pages Scraper](https://apify.com/automation-lab/facebook-pages-scraper): Page details and contacts

### Support

Found a bug or need another field? Open an issue on the Actor's **Issues** tab and we will help.

# Changelog

This Actor's version history is a separate document: https://apify.com/automation-lab/facebook-public-post-comments/changelog.md

# Actor input Schema

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

Public Facebook post, photo, video or reel permalinks, for example https://www.facebook.com/NASA/posts/pfbid0... or https://www.facebook.com/watch/?v=123. Each link gives its own comments. Posts in private groups and private profiles cannot be read.

## `resultsLimit` (type: `integer`):

Stop after this many rows for each post. Replies count towards it. Keep it low while you test: you pay per comment.

## `includeNestedComments` (type: `boolean`):

Also export the replies under each comment, up to 3 levels deep. Every reply is its own row with threadingDepth and replyToCommentId.

## `viewOption` (type: `string`):

How Facebook orders the comments before they are read. "All comments" returns the most, "Newest first" is best with a date cut-off.

## `onlyCommentsNewerThan` (type: `string`):

Optional cut-off: a date (2026-01-31), a full timestamp (2026-01-31T18:00:00Z) or a span such as 7 days, 2 weeks, 24h, yesterday.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl"
    }
  ],
  "resultsLimit": 20,
  "includeNestedComments": false,
  "viewOption": "RANKED_UNFILTERED"
}
```

# Actor output Schema

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

Table of comments and replies: author, text, date, likes, replies, depth and links.

## `all` (type: `string`):

Every field of every comment and reply, including ids, author details and attachments.

# 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/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl"
        }
    ],
    "resultsLimit": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/facebook-public-post-comments").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/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl" }],
    "resultsLimit": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/facebook-public-post-comments").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/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl"
    }
  ],
  "resultsLimit": 20
}' |
apify call automation-lab/facebook-public-post-comments --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/facebook-public-post-comments"
        }
    }
}
```

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/Xp6XyV78SsOc5toLF/builds/sePptwed6QlPtOKZn/openapi.json
