# Facebook Comments Scraper 🔥$0.25/1K: Posts, Reels, Videos (`thedoor/facebook-comment-scraper`) Actor

🔥 $0.25 per 1,000 comments, 10x cheaper, no cookies. Export comments & replies from posts, reels, videos & groups: author, profile link, date, reactions by type, photos & more.

- **URL**: https://apify.com/thedoor/facebook-comment-scraper.md
- **Developed by:** [TheDoor](https://apify.com/thedoor) (community)
- **Categories:** Developer tools, Automation, Social media
- **Features:** Limited permissions
- **Stats:** 1,441 total users, 280 monthly users, 100.0% runs succeeded, 8 bookmarks
- **User rating**: 4.95 out of 5 stars

## Pricing

from $0.24 / 1,000 results

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: Posts, Reels & Videos

**Export comments and replies from any public Facebook post, reel or video. $0.25 per 1,000 comments, about 10x cheaper than the usual price, no login or cookies.** Paste 1 or 100+ links and get one row per comment: author, profile link, text, exact time, reactions by type, reply count, photos and shared links.

**Reels, videos, share links, group posts and photos all work.** Download as CSV, Excel or JSON.

![Step 1: paste any reel, video or post link. Step 2: export comments and replies to CSV, Excel or JSON](https://api.apify.com/v2/key-value-stores/QBnx6BMReHweNTeDb/records/comment-hero-v1.png)

### Who uses it

| You want to | Example | What helps most |
|---|---|---|
| 🎯 **Find buyers and leads** | People asking "where can I buy this?" under a competitor's reel | `author_name` and `author_profile_url` on every comment |
| 📊 **Read what customers think** | Sentiment on your ad, launch post or a viral video | `reaction_types`, replies, **Only new comments** |
| 🎬 **Export reel and video comments** | Comments from trending reels for content research | `/reel/`, `/share/r/`, `/videos/`, `/watch/` and `fb.watch` links |
| 🎁 **Run giveaways and support threads** | Every new entry or question since the last check | **Only new comments** on a schedule |
| 🤖 **Feed an AI tool, a sheet or a CRM** | Daily comment summaries, auto replies, lead lists | JSON, CSV or Excel, API and MCP |

### What you get

| | |
|---|---|
| 🔗 **Works with** | **Reels, videos, posts, photos, group posts and share links**, from `www.`, `m.` and `web.` Facebook. See [every link format](#every-link-format-it-accepts). |
| 💯 **Links per run** | Paste **100+ links** of any type into one run, with no fixed cap. Up to 20 are read at the same time. A link that fails is skipped and the others keep going. |
| 💬 **Replies** | **Replies and replies to replies**, each as its own row, with the `id` of the comment it answers. See [how replies work](#comments-replies-and-replies-to-replies). |
| 📄 **Output** | One row per comment, plus one row per reply if you turn replies on |
| 📊 **Data** | Text, time, author name and profile link, **reactions by type**, reply count, photos, shared links and shared posts |
| ♾️ **How many** | **All the comments** Facebook shows a logged-out visitor: set Target comments to `-1` |
| ⚡ **Speed** | **24 links in 29 seconds** in our format test (12 November 2026). Up to 1,300 comments a minute across many links; 10,000+ comments from big posts in about 15 minutes. Measured at 2 GB memory. |
| 🔓 **Account needed** | **None.** Public content only. |
| 💰 **Price** | **$0.25 per 1,000 results** ($0.24 on Scale and Business plans). A reply counts as one result. Apify's free $5 a month covers about **20,000 results**. |

**Seven comments from a run on 6 November 2026**, showing the main columns, with names and profile links blurred:

![Facebook comments as rows in the Output tab](https://api.apify.com/v2/key-value-stores/AENRDIIcmkuSVMiuD/records/comment-output-table-v4.png)

### Every link format it accepts

Tested one by one on 12 November 2026. Every format below gave comments.

| Link type | Example |
|---|---|
| Reel | `https://www.facebook.com/reel/1081620267650247` |
| Reel with tracking | `https://www.facebook.com/reel/1081620267650247/?mibextid=...` |
| Reel share link | `https://www.facebook.com/share/r/1AbCdEfGh2/` |
| Video | `https://www.facebook.com/CNN/videos/1510975140138256/` |
| Watch link | `https://www.facebook.com/watch/?v=1510975140138256` |
| Short video link | `https://fb.watch/AbCdEfGh12/` |
| Video share link | `https://www.facebook.com/share/v/1AbCdEfGh2/` |
| Page post, number | `https://www.facebook.com/CNN/posts/1510975140138256` |
| Page post, pfbid | `https://www.facebook.com/cnn/posts/pfbid0HhiQWriz...` |
| Post share link | `https://www.facebook.com/share/p/1AbCdEfGh2/` |
| Permalink | `https://www.facebook.com/permalink.php?story_fbid=1510975140138256&id=100064358273914` |
| Story link | `https://www.facebook.com/story.php?story_fbid=1510975140138256&id=100064358273914` |
| Page id and post id | `https://www.facebook.com/100064358273914_1510975140138256` |
| Post id only | `https://www.facebook.com/1510975140138256` |
| Photo | `https://www.facebook.com/photo/?fbid=2013556406001668&set=a.724234831600505` |
| Old photo link | `https://www.facebook.com/photo.php?fbid=2013556406001668` |
| Group post | `https://www.facebook.com/groups/n8n.automation/posts/25205583905788653/` |
| Group permalink | `https://www.facebook.com/groups/n8n.automation/permalink/25205583905788653/` |
| Mobile and web links | `https://m.facebook.com/reel/...`, `https://web.facebook.com/share/v/...`, `https://facebook.com/reel/...` |

Paste links with `https://` at the start. A link that starts with `www.` and no `https://` gave no comments in our test.

### Comments, replies and replies to replies

![How comments, replies and replies to replies become rows](https://api.apify.com/v2/key-value-stores/QBnx6BMReHweNTeDb/records/comment-nested-v1.png)

- Turn on **Include Replies** and set **Max replies per comment**.
- Every comment and every reply is **one row**. Comments come first, then replies.
- `depth` says how deep a row sits: `0` a comment, `1` a reply, `2` a reply to a reply. Facebook shows at most 2 levels.
- `replyto_comment_id` is the `id` of the row it answers, so you can rebuild every thread in Excel or code.
- Each reply is one result, like a comment.

### How to use it

1. Paste your links into **Post URLs**, one per line. Reels, videos and posts can go in the same run.

2. Set **Target comments**, the number of comments per link. Start with 50 to see the data.

3. Turn on **Include Replies** if you want the answers under each comment.

4. Click **Start**. The status line at the top of the run shows each step:

   | Status line | What is happening |
   |---|---|
   | `Checking links: 3 of 10` | Each link is checked: is it public, and does it have comments? |
   | `Reading comments: 4 of 9 links done, 1,250 results so far` | Comments are being collected. Results appear in the Output tab as they arrive. |
   | `Done: 2,400 comments and 310 replies from 8 of 10 links. 1 link had no comments. 1 link could not be read fully...` | The run is finished, with what it got and why any link gave nothing. |

5. Download the results as JSON, CSV or Excel.

### Which Facebook scraper do you need?

| You have | Use | You get |
|---|---|---|
| Links to posts, reels or videos | **This Actor** | Every comment and reply, one row each |
| Facebook Pages or profiles | [Facebook Page & Profile Posts Scraper](https://apify.com/thedoor/facebook-page-scraper) | Their posts, with up to 100 comments per post inside each row |
| Public Facebook groups | [Facebook Group Posts & Comments Scraper](https://apify.com/thedoor/facebook-group-post-scraper) | Group posts, with up to 100 comments per post, and AI group search |

Need the post links first? Run the Page or Group scraper, then paste their post URLs here.

### How much does it cost?

You pay $0.25 for every 1,000 results on the Free and Starter plans, and $0.24 on Scale and Business.
Each comment is one result, and each reply is one result. The run start fee is $0.00005 per GB of
memory, which is almost nothing.

| You collect | Cost |
|---|---|
| 100 comments from each of 10 posts (1,000 results) | about $0.25 |
| 100 comments from each of 10 posts, each with up to 10 replies (at most 11,000 results) | at most $2.75 |
| 20,000 results, the amount Apify's free $5 a month covers | about $5 |

Three ways to keep the bill under control:

- **Target comments:** the top-level comments per link. `-1` reads the whole post, so check how many
  comments the post has first.
- **Max replies per comment:** replies are extra results on top of Target comments. The most one link can
  give is `targetComments x (1 + maxReplies)`.
- **Maximum cost per run:** set it in the run options (`maxTotalChargeUsd` in the API). The run stops
  there, and the results it already collected stay in your dataset.

### Follow a post and pay only for new comments

If you check the same post more than once, turn on **Only new comments for the next run**
(`onlyNewComments`). Without it, every run reads the post again and charges you again for comments you
already have. With it, the Actor remembers the newest comment you got from each post, and each run
returns only what came after it.

![Turn on Only new comments for the next run in the input form](https://api.apify.com/v2/key-value-stores/AENRDIIcmkuSVMiuD/records/only-new-comments-input-v4.png)

- **First run:** comments as usual, newest first.
- **Every next run:** only comments posted since your last run. Reading stops at the first comment you
  already have, so the run also ends sooner.
- **No new comments:** 0 results and no result fee, only the tiny run start fee. The status line says so.
- **A run fails partway:** your place is kept, so the next run still picks up those comments.

| One post with 2,000 comments, checked daily for 30 days, 50 new comments a day | Results | Cost |
|---|---|---|
| Normal runs, the whole post every day | 60,000 or more | $15 or more |
| With `onlyNewComments` | 3,450 | about $0.86 |

When it is worth using:

- **Your own ad or launch post:** answer new questions and complaints while the post is running.
- **A competitor's announcement:** collect new reactions day by day without paying for the old ones.
- **A viral or news post:** follow the conversation as it grows.
- **A giveaway or support thread:** pick up each new entry or question since the last check.
- **Sentiment over time:** add only the new results to your sheet, with no duplicates to clean.

To set it up:

1. Paste the post link and turn on **Only new comments for the next run**.
2. Set **Target comments** to `-1`.
3. Click **Save as a new task**, then add a [schedule](https://docs.apify.com/platform/schedules) to it.
   Hourly suits a viral post; daily or weekly suits a quiet one.

Good to know:

- **Turn it on from the first run.** Runs with the option off do not save your place.
- **A low Target comments loses nothing.** If a post gets 500 new comments and Target comments is 100,
  each run returns the next 100 from where the last one stopped. Comments newer than those wait until
  the backlog is done. Use `-1` to get everything new in one run.
- **New replies under old comments are not returned.** You get replies under new comments only.
- **Your place is saved per Apify account and per post.**
- **Your place is saved when a post finishes.** If the timeout or your cost limit stops a run in the
  middle of a post, the next run reads that post from the last saved place, so those comments come back
  and are charged again.
- **It works together with `commentsNewerThan`.** A comment must pass both.

### What you give it

```json
{
  "postUrls": [
    "https://www.facebook.com/CNN/posts/1510975140138256",
    "https://www.facebook.com/reel/787423957218284"
  ],
  "targetComments": 50,
  "includeReplies": true,
  "maxReplies": 10
}
```

| Field | Default | What it does |
|---|---|---|
| `postUrls` | required | Facebook links, always as a list, even for one link. |
| `targetComments` | `100` | Top-level comments per link, `1` or more. `-1` gets them all. `0` stops the run with an input error. Replies are not counted here. |
| `includeReplies` | off | Also get replies, including replies to replies. |
| `maxReplies` | `100` | Replies per top-level comment, all levels counted. `-1` gets them all, `0` gets none. |
| `orderingMode` | `ALL` | `ALL` is Facebook's order with every comment. `MOST_RELEVANT` is the same without comments Facebook hides as likely spam. `NEWEST` is newest first. |
| `includeReactions` | on | Add the reaction total and the count for each type. |
| `commentsNewerThan` | empty | Only comments from a recent period, counted back from when the run starts: `30 minutes`, `24 hours`, `7 days`. Leave it empty for all dates. The number must be above 0: `0 days` stops the run with an input error. For today's comments use `24 hours`. |
| `onlyNewComments` | off | Only comments posted since your last run on that post. See the section above. |

With `commentsNewerThan` or `onlyNewComments`, comments come newest first and `orderingMode` is ignored.

**Links it accepts:** reels, videos, posts, photos, group posts and share links. See [every link format it accepts](#every-link-format-it-accepts).

### What you get back

One row per comment or reply. This is a real row from a run on 6 November 2026, with the author's details hidden:

```json
{
  "post_url": "https://www.facebook.com/reel/787423957218284",
  "id": "1229229358963577",
  "comment_url": "https://www.facebook.com/reel/787423957218284?comment_id=1229229358963577",
  "text": "And i have to use paper straw...",
  "timestamp": 1760102853,
  "comment_time": "2025-10-10T13:27:33.000Z",
  "author_name": "...",
  "author_id": "...",
  "author_profile_picture": "...",
  "author_profile_url": "...",
  "image_url": null,
  "media": [],
  "shared_link": null,
  "shared_link_title": null,
  "shared_link_source": null,
  "shared_post": null,
  "reactions_count": 295,
  "reaction_types": { "like": 290, "haha": 5 },
  "replies_count": 10,
  "is_reply": false,
  "depth": 0
}
```

What each field means:

| Field | In plain words |
|---|---|
| `post_url` | The link you pasted, so you can see which post the comment came from. |
| `id` | The comment's unique number. Use it to spot the same comment across runs. |
| `comment_url` | A direct link that opens this comment on Facebook. |
| `text` | What the person wrote. |
| `comment_time` | When it was written, as a readable date and time in UTC. |
| `timestamp` | The same time as a number, handy for sorting in code. |
| `author_name` | The name of the person or Page that wrote it. |
| `author_id` | That author's Facebook id. |
| `author_profile_url` | A link to the author's profile. `null` when Facebook gives no public link. |
| `author_profile_picture` | A link to the author's profile picture. |
| `reactions_count` | All reactions on the comment added up. |
| `reaction_types` | The same reactions split by type: `like`, `love`, `haha`, `wow`, `care`, `sad`, `angry`. Only types with a count appear; `{}` means no reactions. |
| `replies_count` | How many direct replies the comment has. |
| `is_reply` | `false` for a comment, `true` for a reply. |
| `depth` | How deep it sits: `0` is a comment, `1` a reply, `2` a reply to a reply. Facebook shows at most 2 levels, so a reply to a level-2 reply is also `2`. |
| `replyto_comment_id` | On replies only: the `id` of the comment or reply it directly answers (its direct parent). |
| `image_url` | The photo attached to the comment, if any. |
| `media` | Everything attached to the comment: photos, videos or stickers. `[]` means nothing is attached. |
| `shared_link` | A link the person shared in the comment. |
| `shared_link_title`, `shared_link_source` | That link's title and its website, for example `youtube.com`. |
| `shared_post` | A Facebook post shared in the comment, with its link and text. |

`reactions_count` and `reaction_types` are left out when `includeReactions` is off. Other fields with no
value come back as `null`.

The Output tab also has ready views: top-level comments only, replies only, comments with images, and
comments with links.

### Coming from another scraper?

Most Facebook comment scrapers return the same data under other names. Rename these columns and your sheet or code keeps working:

| Name in other scrapers | Name here |
|---|---|
| `facebookUrl`, `inputUrl` | `post_url` |
| `commentUrl` | `comment_url` |
| `date` | `comment_time` (and `timestamp` as a number) |
| `profileName` | `author_name` |
| `profileUrl` | `author_profile_url` |
| `profileId` | `author_id` |
| `profilePicture` | `author_profile_picture` |
| `likesCount` | `reactions_count`, and by type in `reaction_types` |
| `commentsCount` | `replies_count` |
| `threadingDepth` | `depth` |

What you may get here that others charge extra for or do not have: reactions split by type, photos and shared links inside comments, only new comments on repeat runs, and about 10x lower price.

### When you get few or no results

The status line tells you how each link ended, and the **Log** tab lists the links under `COMPLETED`,
`NO_COMMENTS` and `FAILED`. Links that give nothing add no rows to your dataset and cost nothing.

| What you see | What it means | What to do |
|---|---|---|
| `Input error: Comments newer than cannot be 0...` | `0 days` or `0 weeks` would keep only comments from this very second. The run stops before reading, with no result fee. | Use a time such as `24 hours` or `7 days`, or leave the field empty for all dates. |
| `Input error: Target comments must be 1 or more...` | `0` or a number below `-1` asks for no comments. The run stops before reading. | Use `1` or more, or `-1` for all comments. |
| `Input error: Add at least one Facebook post link...` | The list of links is empty. | Paste at least one link. |
| `1 link had no comments` | The post is readable and has no comments. | Nothing to fix. |
| `1 link had no comments in your time frame` | Nothing was posted in the period you set, or the post has no comments. | Widen **Comments newer than**, or leave it empty. |
| `1 link had no new comments` | With `onlyNewComments`, nothing new since your last run. | Nothing to fix. |
| `1 link could not be read fully` | The post is private, deleted or blocked, or the link is not a post. Results read before the problem are kept. | Open the link in a private browser window. If you can see the post there, run it again. |
| Fewer comments than the post shows | Facebook's counter includes deleted comments and comments hidden from logged-out visitors. | Nothing to fix. |
| The run stopped early | It reached the run timeout or your maximum cost per run. | Raise the limit and run again. |

### What it does not do

- **Posts, not Pages.** A link to a whole Page or group is not accepted. Get the post links first with
  the scrapers above.
- **Public content only.** Private groups, friends-only posts and other restricted posts are skipped,
  and the other links still run.
- **It does not remove duplicates between links.** Two links to the same post, such as a `/posts/` link
  and a `/watch/` link, are read and charged twice.
- **Reply counts can be higher than the replies you get.** `replies_count` comes from Facebook and can
  include replies hidden from logged-out visitors.
- **A run has a time limit.** The default is 1 hour with 4 GB of memory. A very big post may need a longer
  timeout: at 400 to 700 comments a minute, one hour reads about 24,000 to 42,000 comments. If the
  timeout is reached, the results collected so far stay in your dataset.
- **No email or phone numbers.** Commenters' contact details are not returned.
- **It is not an official Facebook tool.** theDoor is independent and is not affiliated with or
  endorsed by Facebook or Meta.

### FAQ

**Can I export Facebook comments to Excel or CSV?**
Yes. Every run's results download as CSV, Excel or JSON from the Output tab, or through the API.

**Can I scrape comments from a Facebook reel or video?**
Yes. Paste `/reel/`, `/videos/`, `/watch/?v=`, `fb.watch` or `/share/r/` and `/share/v/` links. See
[every link format it accepts](#every-link-format-it-accepts).

**How do I get replies to comments?**
Turn on **Include Replies**. Each reply is its own row with `depth` and `replyto_comment_id`. See
[how replies work](#comments-replies-and-replies-to-replies).

**Why did I get fewer comments than the post shows?**
Facebook's counter also counts deleted comments and comments hidden from visitors who are not logged in.
You get the comments Facebook shows to a logged-out visitor. See [When you get few or no results](#when-you-get-few-or-no-results).

**Why did I get more rows than Target comments?**
Replies are extra rows on top of `targetComments`. Lower `maxReplies` or turn replies off.

**Can I get every comment?**
Set `targetComments` to `-1` to get all the comments Facebook shows a logged-out visitor.

**Can I call it from code, Make, n8n or an AI agent?**
Yes. The API tab has Python, JavaScript and HTTP examples. In Python:

```python
## pip install apify-client
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("thedoor/facebook-comment-scraper").call(
    run_input={
        "postUrls": ["https://www.facebook.com/CNN/posts/1510975140138256"],
        "targetComments": 50,
    },
    max_total_charge_usd=0.50,  # the most this run may spend
)
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["comment_time"], row.get("reactions_count"), (row.get("text") or "")[:80])
```

**Is it legal?**
It reads only public comments. Comments and author names are personal data under GDPR and similar
laws, so collect them only for a clear reason and keep only what you need.

### Using an AI agent?

| | |
|---|---|
| Actor | `thedoor/facebook-comment-scraper` |
| The one required field | `postUrls`, a list of post, reel or video links |
| Cap the bill | Set `maxTotalChargeUsd` on the run, for example `0.50` |
| Why a link gave nothing | Read the run's status message: it counts links with no comments and links that failed |
| MCP link | `https://mcp.apify.com/?tools=fetch-actor-details,thedoor/facebook-comment-scraper` |

### Support

Open the **Issues** tab and paste the link you used and the run ID.

# Actor input Schema

## `postUrls` (type: `array`):

Enter one or more Facebook Post URLs. Use this list for a single post or 100+ posts in one run.

## `onlyNewComments` (type: `boolean`):

A run with this on never returns comments you already got from this post in a previous run. Your first run gets comments as usual. Every next run on the same post returns only comments posted after your last run, so you don't pay for the same comments twice. Great for scheduled runs. With Include Replies on, replies to new comments are included; new replies to old comments are not. When on, comments are sorted Newest first and Ordering Mode is ignored.

## `orderingMode` (type: `string`):

Comment ordering: MOST_RELEVANT, NEWEST, or ALL

## `targetComments` (type: `integer`):

Number of comments to scrape per URL. Default 100. Use 1 or more, or -1 for all comments. 0 stops the run with an input error.

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

Turn on to also get replies to each comment. Off by default: only top-level comments are returned.

## `maxReplies` (type: `integer`):

Maximum replies to collect for each top-level comment, counting nested replies at every level. Works only when Include Replies is enabled; ignored otherwise. Example: Target comments 50 + Max replies 10 returns up to 50 comments, each with up to 10 replies. Default 100. Use -1 for all replies, 0 for none.

## `includeReactions` (type: `boolean`):

Include total reactions and the available reaction type breakdown

## `commentsNewerThan` (type: `string`):

Get only comments posted within this time, counted back from the moment the run starts, for example 7 days, 24 hours, or 30 minutes. Leave empty for all dates. The number must be above 0: 0 days stops the run with an input error. For today's comments use 24 hours. Works together with Target comments: -1 gets every comment in that time, 20 gets the newest 20. With Include Replies on, their replies are included too. When set, comments are sorted Newest first and Ordering Mode is ignored.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.facebook.com/MTP.Fan/posts/pfbid02pDbx7KyShTqS5fEP9cixHMq936QNmAhBTEgnHDQMSoYVGbCBLJpZCgULE7wL1GSzl",
    "https://www.facebook.com/reel/1081620267650247",
    "https://www.facebook.com/cnn/posts/pfbid0HhiQWrizKWmntpi9m1xzXQT4cC8iYLWqL4xbQDfXMRPhSeAymTXEqfQGP7memBvZl",
    "https://www.facebook.com/CNN/posts/1510975140138256",
    "https://www.facebook.com/CNN/videos/1510975140138256/",
    "https://www.facebook.com/groups/n8n.automation/permalink/25205583905788653/",
    "https://www.facebook.com/permalink.php?story_fbid=1510975140138256&id=100064358273914",
    "https://www.facebook.com/photo/?fbid=2013556406001668&set=a.724234831600505",
    "https://www.facebook.com/watch/?v=1510975140138256",
    "https://www.facebook.com/reel/1397741784161219",
    "https://www.facebook.com/reel/787423957218284"
  ],
  "onlyNewComments": false,
  "orderingMode": "ALL",
  "targetComments": 100,
  "includeReplies": false,
  "maxReplies": 100,
  "includeReactions": true
}
```

# Actor output Schema

## `allComments` (type: `string`):

Complete dataset with all comments and replies including nested threads, images, and shared links

## `topLevelComments` (type: `string`):

Only top-level comments (depth=0), excluding all replies

## `replies` (type: `string`):

Only replies to comments (depth>=1), excluding top-level comments

## `withImages` (type: `string`):

Only comments and replies that contain image attachments

## `withLinks` (type: `string`):

Only comments and replies that contain shared links

## `byAuthor` (type: `string`):

Comments grouped by author with engagement statistics

# 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 = {
    "postUrls": [
        "https://www.facebook.com/MTP.Fan/posts/pfbid02pDbx7KyShTqS5fEP9cixHMq936QNmAhBTEgnHDQMSoYVGbCBLJpZCgULE7wL1GSzl",
        "https://www.facebook.com/reel/1081620267650247",
        "https://www.facebook.com/cnn/posts/pfbid0HhiQWrizKWmntpi9m1xzXQT4cC8iYLWqL4xbQDfXMRPhSeAymTXEqfQGP7memBvZl",
        "https://www.facebook.com/CNN/posts/1510975140138256",
        "https://www.facebook.com/CNN/videos/1510975140138256/",
        "https://www.facebook.com/groups/n8n.automation/permalink/25205583905788653/",
        "https://www.facebook.com/permalink.php?story_fbid=1510975140138256&id=100064358273914",
        "https://www.facebook.com/photo/?fbid=2013556406001668&set=a.724234831600505",
        "https://www.facebook.com/watch/?v=1510975140138256",
        "https://www.facebook.com/reel/1397741784161219",
        "https://www.facebook.com/reel/787423957218284"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thedoor/facebook-comment-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 = { "postUrls": [
        "https://www.facebook.com/MTP.Fan/posts/pfbid02pDbx7KyShTqS5fEP9cixHMq936QNmAhBTEgnHDQMSoYVGbCBLJpZCgULE7wL1GSzl",
        "https://www.facebook.com/reel/1081620267650247",
        "https://www.facebook.com/cnn/posts/pfbid0HhiQWrizKWmntpi9m1xzXQT4cC8iYLWqL4xbQDfXMRPhSeAymTXEqfQGP7memBvZl",
        "https://www.facebook.com/CNN/posts/1510975140138256",
        "https://www.facebook.com/CNN/videos/1510975140138256/",
        "https://www.facebook.com/groups/n8n.automation/permalink/25205583905788653/",
        "https://www.facebook.com/permalink.php?story_fbid=1510975140138256&id=100064358273914",
        "https://www.facebook.com/photo/?fbid=2013556406001668&set=a.724234831600505",
        "https://www.facebook.com/watch/?v=1510975140138256",
        "https://www.facebook.com/reel/1397741784161219",
        "https://www.facebook.com/reel/787423957218284",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("thedoor/facebook-comment-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 '{
  "postUrls": [
    "https://www.facebook.com/MTP.Fan/posts/pfbid02pDbx7KyShTqS5fEP9cixHMq936QNmAhBTEgnHDQMSoYVGbCBLJpZCgULE7wL1GSzl",
    "https://www.facebook.com/reel/1081620267650247",
    "https://www.facebook.com/cnn/posts/pfbid0HhiQWrizKWmntpi9m1xzXQT4cC8iYLWqL4xbQDfXMRPhSeAymTXEqfQGP7memBvZl",
    "https://www.facebook.com/CNN/posts/1510975140138256",
    "https://www.facebook.com/CNN/videos/1510975140138256/",
    "https://www.facebook.com/groups/n8n.automation/permalink/25205583905788653/",
    "https://www.facebook.com/permalink.php?story_fbid=1510975140138256&id=100064358273914",
    "https://www.facebook.com/photo/?fbid=2013556406001668&set=a.724234831600505",
    "https://www.facebook.com/watch/?v=1510975140138256",
    "https://www.facebook.com/reel/1397741784161219",
    "https://www.facebook.com/reel/787423957218284"
  ]
}' |
apify call thedoor/facebook-comment-scraper --silent --output-dataset

```

## MCP server setup

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