# Facebook Comments Scraper: With Replies (`luzivanlt/facebook-comments-scraper`) Actor

Comments and replies from public Facebook posts, reels and videos, with reactions by type. $0.25 per 1,000 comments. Newest first, back to a date you choose.

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

## Pricing

from $0.17 / 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: With Replies

Get the comments of public Facebook posts, reels and videos, with their
replies and the replies to those, threaded. Every row carries the text, the
time it was posted, the reactions by type (like, love, haha and the rest),
the reply count, mentions and attachments such as GIFs, and the commenter's id, name,
profile link and picture, plus the post's own text and counts. Newest first,
back to a date you choose. No Facebook account, login or cookies needed.

Tested daily. Latest checks: 1,295 comments and replies from a Page post, a
group post and a video in under 3.5 minutes; 1,076 from the last 12 hours of
one post, newest first.

### What does this Actor do?

You give it links to Facebook posts. For each post it reads the post's page,
then its comments, newest first (or in the order you choose), and, if you
ask, the replies under each comment. It saves one row per comment or reply
until it reaches your limit, your date, or the end of the list.

Each row comes with:

- the comment's text, the time it was posted (UTC), whether it was edited and
  its language
- its reactions: the total and the count of each type
- its number of replies, and for a reply: the comment it sits under, the
  comment or reply it answers, and that person's name
- people and pages mentioned in it, and attachments such as GIFs, with their
  links
- the commenter's id, name, profile link (when public), picture and verified
  badge
- the post, as its page shows it: its owner, text, author (with link and
  picture), time and link, its reactions by type, comment and share counts,
  photos and videos, hashtags, mentions and links, the post it shares, and a
  group sale's item

### Why use it?

- **Replies included, threaded.** Turn on replies and each one links back to
  its comment and to the reply it answers, so you can rebuild every
  conversation.
- **Reactions by type.** See which comments got laughs and which got anger,
  not just a total.
- **Only what's new.** Give a date or a period ("6 hours") and the Actor reads
  newest first and stops at it, so a daily run reads only the newest comments.
- **Posts, reels and videos.** Page and group posts, reels and videos, and
  `permalink.php` links.
- **Use the data anywhere.** Download as JSON, CSV or Excel, or send it to
  your own tools through Apify's API and integrations.

### How to use it

1. Paste one or more post links into **Post links**.
2. Optionally set **Max comments per post**, turn on **Include replies**,
   pick an **Order**, or fill in **Only comments newer than**.
3. Click **Start**. When the run ends, open the **Output** tab to view the
   comments or download them.

#### Links that work

A post's own link, as in your browser's address bar after you open the post:

- a Page post: `https://www.facebook.com/NASA/posts/pfbid02oiNe…`
- a group post: `https://www.facebook.com/groups/1007033107457891/posts/1234567890123456/`
- a reel: `https://www.facebook.com/reel/1557618349384047/`
- a video: `https://www.facebook.com/watch/?v=1557618349384047`
- `permalink.php?story_fbid=…&id=…` links

A Page, profile or group link on its own is not a post: open the post and
paste its link. Posts in private groups, and posts only friends can see, are
not supported.

### Input

| Field                                                  | What it does                                                     | Default       |
| ------------------------------------------------------ | ---------------------------------------------------------------- | ------------- |
| **Post links** (`startUrls`)                           | The posts to read. Required.                                     | —             |
| **Max comments per post** (`maxCommentsPerPost`)       | Stop after this many rows per post, replies included (to 50,000) | `100`         |
| **Include replies** (`includeReplies`)                 | Also save the replies to each comment                            | `false`       |
| **Order** (`sortOrder`)                                | `newest`, `relevant` (Facebook's default view) or `all`          | `newest`      |
| **Only comments newer than** (`onlyCommentsNewerThan`) | A date, a time or a period such as `2 days`                      | every comment |

Example input:

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/NASA/posts/pfbid02oiNe7Qv1J9vDhhYw6bLqyVpF5fmy28wisVPKGgo3mMEh1HzBburWxYM48ppR3WQgl"
    }
  ],
  "maxCommentsPerPost": 1000,
  "includeReplies": true,
  "onlyCommentsNewerThan": "1 day"
}
```

### Output

One row per comment or reply. An example, with made-up values:

```json
{
  "comment_id": "1234567890123456",
  "post_id": "1658876782274358",
  "post_url": "https://www.facebook.com/NASA/posts/pfbid02oiNe7Qv1J9vDhhYw6bLqyVpF5fmy28wisVPKGgo3mMEh1HzBburWxYM48ppR3WQgl/",
  "url": "https://www.facebook.com/NASA/posts/pfbid02oiNe7Qv1J9vDhhYw6bLqyVpF5fmy28wisVPKGgo3mMEh1HzBburWxYM48ppR3WQgl?comment_id=1234567890123456",
  "text": "Beautiful shot!",
  "created_at": "2026-10-17T05:18:46.000Z",
  "depth": 0,
  "thread_comment_id": null,
  "parent_comment_id": null,
  "reply_to_author_id": null,
  "reply_to_author_name": null,
  "author_id": "pfbid0AbCdEfGhIjKlMnOpQrStUv…",
  "author_name": "Jane Doe",
  "author_url": "https://www.facebook.com/people/Jane-Doe/pfbid0AbCdEfGhIjKlMnOpQrStUv…/",
  "author_picture_url": "https://scontent.xx.fbcdn.net/…",
  "author_type": "User",
  "author_is_verified": false,
  "reaction_count": 4,
  "reactions": {
    "like": 3,
    "love": 1,
    "care": 0,
    "haha": 0,
    "wow": 0,
    "sad": 0,
    "angry": 0,
    "other": 0
  },
  "reply_count": 2,
  "reply_count_visible": 2,
  "edited": false,
  "language": "en_XX",
  "mentions": [],
  "attachments": [],
  "during_live_video": false,
  "video_offset_seconds": null,
  "post_owner_id": "100044561550831",
  "post_owner_name": "NASA - National Aeronautics and Space Administration",
  "post_text": "…",
  "post_author_id": "100044561550831",
  "post_author_name": "NASA - National Aeronautics and Space Administration",
  "post_author_url": "https://www.facebook.com/NASA",
  "post_author_picture_url": "https://scontent.xx.fbcdn.net/…",
  "post_created_at": "2026-10-16T19:25:02.000Z",
  "post_permalink": "https://www.facebook.com/NASA/posts/pfbid02oiNe7Qv1J9vDhhYw6bLqyVpF5fmy28wisVPKGgo3mMEh1HzBburWxYM48ppR3WQgl",
  "post_comment_count": 1361,
  "post_reaction_count": 122081,
  "post_reactions": {
    "like": 98000,
    "love": 21000,
    "wow": 2100,
    "care": 600,
    "haha": 300,
    "sad": 50,
    "angry": 31
  },
  "post_share_count": 7801,
  "post_shared_text": null,
  "post_shared_post": null,
  "post_media": [
    {
      "type": "photo",
      "id": "1234567890",
      "url": "https://scontent.xx.fbcdn.net/…",
      "width": 1080,
      "height": 1350,
      "image_text": "…"
    }
  ],
  "post_photo_count": 3,
  "post_hashtags": [],
  "post_mentions": [],
  "post_links": [],
  "post_sale": null,
  "post_page_ad_library": { "id": "100044561550831", "is_business_page_active": false }
}
```

| Field                     | What it holds                                                    |
| ------------------------- | ---------------------------------------------------------------- |
| `comment_id`              | Facebook's id for the comment or reply                           |
| `post_id`                 | The post's id                                                    |
| `post_url`                | The post link the Actor read                                     |
| `url`                     | A link to the comment                                            |
| `text`                    | The text (empty for a GIF- or sticker-only comment)              |
| `created_at`              | When it was posted, in UTC                                       |
| `depth`                   | 0 for a comment, 1 for a reply, 2 for a reply to a reply         |
| `thread_comment_id`       | For a reply: the comment its thread sits under                   |
| `parent_comment_id`       | For a reply: the comment or reply it answers                     |
| `reply_to_author_id`      | For a reply: the id of the person it answers                     |
| `reply_to_author_name`    | … their name                                                     |
| `author_id`               | The commenter's id                                               |
| `author_name`             | The commenter's name                                             |
| `author_url`              | The commenter's profile link (empty when it is not public)       |
| `author_picture_url`      | The commenter's profile picture (the link expires after a while) |
| `author_type`             | `User` or `Page`                                                 |
| `author_is_verified`      | Whether the commenter has a verified badge                       |
| `reaction_count`          | Reactions to the comment                                         |
| `reactions`               | Reactions by type                                                |
| `reply_count`             | Replies to the comment, as Facebook counts them                  |
| `reply_count_visible`     | Replies Facebook shows to visitors                               |
| `edited`                  | Whether the comment was edited                                   |
| `language`                | The comment's language, as Facebook detects it                   |
| `mentions`                | People, Pages and links tagged in the text, with their position  |
| `attachments`             | Attachments such as GIFs, with their links                       |
| `during_live_video`       | Whether it was written during a live video                       |
| `video_offset_seconds`    | On a video: the moment of the video the comment was written at   |
| `post_owner_id`           | The id of the Page, profile or group the post belongs to         |
| `post_owner_name`         | … its name                                                       |
| `post_text`               | The post's text                                                  |
| `post_author_id`          | The post's author                                                |
| `post_author_name`        | … their name                                                     |
| `post_author_url`         | … their profile or Page link                                     |
| `post_author_picture_url` | … their picture                                                  |
| `post_created_at`         | When the post was posted, in UTC                                 |
| `post_permalink`          | The post's own link, as Facebook gives it                        |
| `post_comment_count`      | The post's comment count as Facebook shows it, replies included  |
| `post_reaction_count`     | The post's reactions                                             |
| `post_reactions`          | The post's reactions by type                                     |
| `post_share_count`        | The post's shares                                                |
| `post_shared_text`        | The text of the post this one shares                             |
| `post_shared_post`        | The post this one shares: its id, link, time, author and media   |
| `post_media`              | The post's photos and videos, with their links and sizes         |
| `post_photo_count`        | How many photos and videos the post has                          |
| `post_hashtags`           | Hashtags in the post                                             |
| `post_mentions`           | People and Pages tagged in the post                              |
| `post_links`              | Links written in the post                                        |
| `post_sale`               | A group sale post's item: title, price, currency, sold or not    |
| `post_page_ad_library`    | The poster's Ad Library record: its id and whether it is active  |

Not included: who reacted, the commenter's friends or followers, and profile
details beyond the above.

### How much does it cost?

You pay for what you get:

- **$0.25 per 1,000 comments** ($0.00025 a comment). A reply counts as a comment. Each is charged once per run.
- No start fee, and nothing per post.

So 1,000 comments and replies from each of 4 posts cost $1. If you set a maximum cost for a run, the Actor stops when it reaches it and keeps every comment saved so far.

### How long does a run take?

Expect about 350 comments and replies a minute. In testing, 1,295 rows from
three posts took under 3.5 minutes, and 111 rows from two posts 25 seconds.

### Good to know

- **You may get fewer comments than the post's count.** Facebook's count
  includes replies and comments it does not show to visitors (hidden,
  filtered or deleted). Newest first reaches the most.
- **Replies: what visitors see.** Facebook shows visitors most replies, and
  replies to replies inside the same thread. `reply_count` is Facebook's
  count, `reply_count_visible` what it shows.
- **Picture links expire.** Profile pictures and attachments are signed
  links that stop working after some time. Download them soon after the run
  if you need them.
- **Post details vary by post kind.** A regular post brings all of the
  post's fields; a reel or a video brings its text, author, time and, for a
  video, its counts. Fields a post's page does not show are empty.
- **Check your links first.** A link that is not a Facebook post link stops
  the run before anything is read, and the message names it.
- **One post that cannot be read does not stop the run.** The other posts
  carry on, and the run's status lists the posts that could not be read. The
  run fails only when no post could be read.
- **A date window sees new comments, not new replies under older ones.**
  With **Only comments newer than**, the walk stops at the first older
  comment, so a reply posted today under last week's comment is not read.
- **One post under two links is read once.** Its comments are saved under the
  first link; the second reads nothing new.
- **No comments is not an error.** A post with no comments, or none newer
  than your date, saves nothing.

### FAQ

**Do I need a Facebook account or cookies?**
No. The Actor reads the comments anyone can see on the post.

**Can I get the posts of a Page or group?**
Not with this Actor: it reads the comments of the posts you give it.

**Can I run it from my own code, on a schedule, or with other apps?**
Yes. Like any Apify Actor, you can start it through the Apify API, run it on a
schedule, and connect it to other apps with Apify's integrations and webhooks.

### Is it legal to scrape Facebook?

This Actor reads only comments that anyone can see without logging in. The
results include commenters' names, ids, profile links and pictures,
which are personal data protected by laws such as the GDPR. Only collect
personal data when you have a legitimate reason to, and check Facebook's
terms and the laws that apply to you. If you are unsure, ask a lawyer.

### Support

Found a problem or missing a feature? Open an issue on the **Issues** tab and
include the run's link.

***

This Actor is not affiliated with, endorsed by or sponsored by Facebook or Meta.

# Actor input Schema

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

Links to public Facebook posts: Page and group posts, reels and videos, as in your browser's address bar (https://www.facebook.com/…/posts/…). A Page, profile or group link on its own is not a post: open the post and paste its link.

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

Stop reading a post after this many comments, replies included.

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

Also save the replies to each comment, and the replies to those replies, each marked with the comment it answers.

## `sortOrder` (type: `string`):

Newest first reaches the most comments. Most relevant is Facebook's default view; All comments is Facebook's unfiltered ranking.

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

Leave empty for every comment. A date (2026-10-01, UTC), a time (2026-10-17T08:00:00Z) or a period back from now ("3 hours", "2 days", "1 week"). Comments are then read newest first, and the post ends at its first older comment (new replies under older comments are not read).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/NASA/posts/pfbid02oiNe7Qv1J9vDhhYw6bLqyVpF5fmy28wisVPKGgo3mMEh1HzBburWxYM48ppR3WQgl"
    },
    {
      "url": "https://www.facebook.com/reel/1557618349384047/"
    }
  ],
  "maxCommentsPerPost": 100,
  "includeReplies": false,
  "sortOrder": "newest"
}
```

# Actor output Schema

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

Every comment and reply the run saved, one row each.

# 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/pfbid02oiNe7Qv1J9vDhhYw6bLqyVpF5fmy28wisVPKGgo3mMEh1HzBburWxYM48ppR3WQgl"
        },
        {
            "url": "https://www.facebook.com/reel/1557618349384047/"
        }
    ],
    "maxCommentsPerPost": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("luzivanlt/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/posts/pfbid02oiNe7Qv1J9vDhhYw6bLqyVpF5fmy28wisVPKGgo3mMEh1HzBburWxYM48ppR3WQgl" },
        { "url": "https://www.facebook.com/reel/1557618349384047/" },
    ],
    "maxCommentsPerPost": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("luzivanlt/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/posts/pfbid02oiNe7Qv1J9vDhhYw6bLqyVpF5fmy28wisVPKGgo3mMEh1HzBburWxYM48ppR3WQgl"
    },
    {
      "url": "https://www.facebook.com/reel/1557618349384047/"
    }
  ],
  "maxCommentsPerPost": 100
}' |
apify call luzivanlt/facebook-comments-scraper --silent --output-dataset

```

## MCP server setup

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