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

Facebook comments scraper for posts, reels, photos and videos. Export comments, replies, reactions, authors and dates to CSV, Excel or JSON. Bulk URLs, newest-first order, date filter, no Facebook login.

- **URL**: https://apify.com/lofomachines/facebook-comments-replies-scraper.md
- **Developed by:** [Lofomachines](https://apify.com/lofomachines) (community)
- **Categories:** Social media, Automation
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.16 / 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 & Replies

**Read in:** [English](#english) · [简体中文](#chinese-simplified) · [繁體中文](#chinese-traditional) · [Italiano](#italiano)

### English

Export public Facebook comments and replies from posts, reels, photos and videos into a dataset you can use immediately. This Facebook comments scraper accepts bulk URLs, finds the associated post, and returns comment text, dates, author details, reactions and parent comment IDs. Get the newest comments first within each post, then download CSV, Excel or JSON.

**No Facebook login. No browser extension to install. Four simple input fields.**

#### Why use this Facebook comments scraper?

| What you need | What you get |
| --- | --- |
| Export Facebook post comments | Comment text, timestamps, source links and public author metadata |
| Scrape Facebook reel comments | Reel URLs resolved to their public conversations |
| Download Facebook photo comments | Automatic resolution from a photo link to its associated post |
| Collect comment replies | Reply records linked to parent comment IDs |
| Process many links | Paste one URL per line to process posts in parallel |
| Focus on recent conversations | Newest-first collection and an optional calendar date filter |
| Analyze engagement | Reaction counts and types where Facebook exposes them |
| Feed a spreadsheet or AI workflow | Structured JSON, CSV and Excel exports with consistent field names |

#### Start in three steps

1. Paste your **Facebook links**. Click **Bulk edit** to add one URL per line.
2. Choose **Include replies**, set **Maximum comments per post**, and optionally select **Comments since** using the calendar.
3. Click **Start**, open your results, and export your data.

The Actor handles supported link formats and resource settings automatically. Duplicate input links are skipped. If different links resolve to the same post, its results are exported once. An unavailable link does not stop the remaining posts.

#### Supported Facebook links

Use public post permalinks, `/posts/`, `/reel/`, `/videos/`, Watch links, `photo/?fbid=...`, `photo.php?fbid=...`, story/permalink links, or supported mobile and shared URLs. Shared links and photo permalinks must be resolvable without a Facebook login.

For a public group, paste the individual post link in either `/groups/<group>/permalink/<post>/` or `/groups/<group>/posts/<post>/` format. When Facebook exposes only a preview, the post report flags partial coverage. Comments with an image or sticker can have an empty text field.

This tool collects conversations from supplied content URLs. It does not search Facebook by keyword, crawl entire pages or groups, download whole albums, access private content, or collect Ads Library results. A photo ID is not assumed to be the same as its associated post ID.

#### Input guide

| Input | Default | Meaning |
| --- | --- | --- |
| `startUrls` | Your Facebook links | List of Facebook URLs. Paste one per line in the bulk editor. |
| `includeReplies` | `true` | Include publicly accessible replies and their parent IDs. |
| `maxComments` | `0` | Maximum **main comments inspected per post**. Replies are additional. `0` removes your chosen cap, subject to automatic safeguards. |
| `commentsSince` | Empty | Earliest creation date to include, at 00:00 UTC. Select a calendar date or pass `YYYY-MM-DD`. |

The maximum applies before date filtering. With replies enabled, older main comments are checked for newer replies, within the selected maximum. A recent reply can appear without its older parent in the filtered export.

#### Input examples

Collect available comments and replies from a reel and a photo:

```json
{
  "startUrls": [
    "https://www.facebook.com/reel/1609243394332725/",
    "https://www.facebook.com/photo/?fbid=1733123065145336&set=a.819778736479778"
  ],
  "includeReplies": true,
  "maxComments": 0
}
```

Collect a smaller recent sample:

```json
{
  "startUrls": [
    "https://www.facebook.com/reel/1609243394332725/"
  ],
  "includeReplies": true,
  "maxComments": 100,
  "commentsSince": "2026-11-01"
}
```

For existing integrations, a single `postUrl` remains supported when `startUrls` is omitted. Use `startUrls` for new workflows. Infrastructure controls are managed automatically.

#### Output: one comment or reply per row

Each post's rows are sorted by creation date, newest first. Posts are grouped in completion order. A multi-post dataset is **not globally sorted across posts**.

| Data group | Fields |
| --- | --- |
| Source | `inputUrl`, `postUrl`, `postId`, `postTitle`, `commentUrl` |
| Conversation | `commentId`, `parentCommentId`, `type`, `depth` |
| Content | `text`, `createdAt`, `mentions`, `attachments`, `videoTimestampSeconds` |
| Public author | `authorId`, `authorName`, `authorUrl`, `authorPictureUrl`, `authorVerified`, `badges` |
| Engagement | `reactionCount`, `reactionCountDisplay`, `knownReactionCount`, `reactions`, `replyCount`, `availableReplyCount` |
| Collection | `collectedAt` |

Missing metadata remains `null` or an empty list. Comment text stays in its original language. Abbreviated counts are not converted into invented exact totals. IDs remain strings to avoid rounding.

Illustrative output with fictional identifiers and names:

```json
{
  "inputUrl": "https://www.facebook.com/reel/123456789/",
  "postUrl": "https://www.facebook.com/example/posts/987654321/",
  "postId": "987654321",
  "commentId": "555000111",
  "parentCommentId": null,
  "type": "comment",
  "text": "A useful update, thank you!",
  "createdAt": "2026-11-03T10:30:00.000Z",
  "authorName": "Example Author",
  "reactionCount": 12,
  "replyCount": 2
}
```

Use **Run summary** for totals and the outcome of every link, **Post details** for collection limits, and **Resolved post links** to inspect the permalink found. These reports are separate from comment rows.

#### Use cases

- **Social listening:** compare audience reactions across campaign posts and reels.
- **Customer feedback:** identify recurring questions, objections and product requests.
- **Competitive research:** study publicly visible discussions under competitor content.
- **Campaign reporting:** export comment activity and exposed reactions to a reporting workflow.
- **Community analysis:** retain reply relationships to understand conversation context.
- **AI and sentiment workflows:** supply original comment text and source links to your own analysis tools. Sentiment scoring and translation are not included.

#### Use with AI agents, Claude, Codex and MCP

This Actor fits tasks where an agent already has public Facebook content URLs and needs their comments, replies or engagement metadata. It does not discover posts from keywords or retrieve private discussions.

With an authorized Apify connection, an MCP-capable client can inspect and run `lofomachines/facebook-comments-replies-scraper`. A Grok-based application can use the same Actor through its own Apify API or MCP integration; a built-in Grok connector is not assumed.

[Configure the Apify MCP connection](https://mcp.apify.com/?tools=lofomachines/facebook-comments-replies-scraper). No Facebook credentials are needed.

Example request to your connected assistant:

> Use lofomachines/facebook-comments-replies-scraper to collect up to 100 main comments per post from these Facebook URLs. Include replies, keep comments created on or after 2026-11-01, and return the dataset link with the coverage summary.

The input and dataset examples above describe the tool's contract. Consult the [Apify MCP documentation](https://docs.apify.com/mcp) for connection instructions and supported clients.

#### Frequently asked questions

**Can this export every comment in Facebook's counter?**\
No. It collects publicly accessible comments and replies within your input limits and automatic safeguards. Hidden, restricted, deleted or otherwise unavailable comments may not be exposed. A completed pagination sequence does not prove Facebook's counter can be matched.

**Does the date include comments before or after the selected day?**\
On or after the selected day at 00:00 UTC. Collection starts with the newest comments and works back toward that date.

**Is a Facebook account required?**\
No. This Actor does not use Facebook login cookies. An Apify account or another authorized Apify access method is still needed to run it.

**Is this an official Meta Graph API product?**\
No. It is an independent public-data collection tool by lofomachines, not a Meta product.

**Can I schedule recurring exports?**\
Yes. Use Apify schedules, API calls or your automation platform. Each run creates its own dataset; deduplication is within a run, not across historical runs.

**Does the Chinese documentation translate comments?**\
No. The documentation is multilingual; collected text remains unchanged.

Build your next research workflow with [more Actors by lofomachines](https://apify.com/lofomachines).

***

### Chinese Simplified

#### Facebook 评论采集器：批量导出帖子、Reels、图片和视频评论

将公开 Facebook 内容中的评论和回复整理为可直接分析的数据。输入一个或多个链接，即可获取评论原文、发布时间、公开作者信息、表情反应和父评论 ID，并导出为 Excel、CSV 或 JSON。适合跨境电商品牌、出海营销团队、市场研究人员和社交媒体运营团队。

**无需 Facebook 登录或 Cookie；支持批量链接、回复采集和日历日期筛选。**

#### 三步开始采集

1. 在 **Facebook links** 中添加链接。点击 **Bulk edit**，每行粘贴一个 URL。
2. 用 **Include replies** 选择是否采集回复；在 **Maximum comments per post** 中设置每个帖子的主评论上限；通过 **Comments since** 日历选择起始日期。
3. 点击 **Start**，运行结束后查看结果并下载 Excel、CSV 或 JSON。

支持公开帖子、Reels、视频、Watch、照片链接，以及能够公开解析的手机端和分享链接。照片链接会自动解析到对应帖子。不同帖子并行处理；重复链接会跳过，多个链接指向同一帖子时只导出一次。单个链接不可访问不会阻止其他帖子的采集。

#### 参数含义

| 参数 | 说明 |
| --- | --- |
| `startUrls` | 要处理的 Facebook 内容链接列表。 |
| `includeReplies` | 默认 `true`，包含公开可访问的回复及父评论 ID。 |
| `maxComments` | 每个帖子检查的主评论数量上限，回复另计。`0` 表示不设置用户数量上限，但仍受自动保护限制。 |
| `commentsSince` | 可选起始日期，格式为 `YYYY-MM-DD`，包含当天 UTC 00:00 及之后发布的评论。 |

数量上限在日期过滤之前生效。启用回复时，会在数量上限内检查较早的主评论，以寻找较新的回复。因此，筛选结果中可能有回复而没有其较早的父评论。

#### 输入示例

```json
{
  "startUrls": ["https://www.facebook.com/reel/1609243394332725/"],
  "includeReplies": true,
  "maxComments": 100,
  "commentsSince": "2026-11-01"
}
```

每行结果是一条评论或回复，包含 `text`、`createdAt`、`authorName`、`reactionCount`、`commentId`、`parentCommentId` 和来源链接等字段。完整字段和输出示例见 [英文说明](#english)。每个帖子的结果按时间从新到旧排列；多个帖子按处理完成顺序分组，不是跨帖子全局排序。评论原文不会自动翻译。

#### 使用场景

可用于品牌舆情监测、竞品评论分析、跨境电商用户反馈、营销活动复盘，以及为自己的情感分析或 AI 工作流提供数据。本工具不自带情感评分或翻译功能。

#### 常见问题

**能获取 Facebook 显示的全部评论吗？**\
不能保证。公开接口可能不提供隐藏、受限、已删除或其他不可访问的评论。运行也受数量、时间和资源限制。

**能搜索关键词、抓取整个主页或私密群组吗？**\
不能。本 Actor 从你提供的公开内容链接开始，不负责关键词找帖、整个主页采集、私密群组或广告资料库采集。

**可以连接 Claude、Codex 或其他 AI 助手吗？**\
支持通过已授权的 Apify MCP 或 API 集成使用。连接方法见 [AI agent 说明](#use-with-ai-agents-claude-codex-and-mcp)。

[查看 lofomachines 的更多数据采集与自动化工具](https://apify.com/lofomachines)。

***

### Chinese Traditional

#### Facebook 留言擷取工具：批次匯出貼文、Reels、相片與影片留言

將公開 Facebook 內容中的留言與回覆轉成可分析的資料。提供內容連結，即可取得留言原文、發布時間、公開作者資訊、表情反應及上層留言 ID，並匯出 Excel、CSV 或 JSON。適合品牌輿情追蹤、跨境電商、社群經營、競品分析與市場研究。

**不需登入 Facebook；支援批次連結、回覆擷取與日曆日期篩選。**

#### 使用方式

1. 在 **Facebook links** 加入連結，或按 **Bulk edit**，每行貼上一個 URL。
2. 以 **Include replies** 選擇是否擷取回覆；設定 **Maximum comments per post**，並視需要在 **Comments since** 日曆選擇起始日期。
3. 按 **Start**，完成後查看資料並下載所需格式。

支援公開貼文、Reels、影片、Watch、相片及能在未登入狀態下解析的行動版和分享連結。相片連結會自動尋找對應貼文。不同貼文平行處理；重複連結會略過，同一貼文不會重複匯出。單一連結無法存取時，其餘貼文仍會繼續處理。

#### 輸入設定

| 欄位 | 用途 |
| --- | --- |
| `startUrls` | 要處理的 Facebook 內容連結清單。 |
| `includeReplies` | 預設 `true`，包含公開可存取的回覆與上層留言 ID。 |
| `maxComments` | 每篇貼文檢查的主要留言數上限；回覆另計。`0` 取消使用者設定的數量上限，仍受自動保護限制。 |
| `commentsSince` | 選填，`YYYY-MM-DD`。包含該日 UTC 00:00 起發布的留言。 |

數量上限先於日期篩選生效。啟用回覆時，會在上限範圍內檢查較早的主要留言，以找出較新的回覆，因此結果可能包含回覆而不包含較早的上層留言。

#### 輸入範例

```json
{
  "startUrls": ["https://www.facebook.com/reel/1609243394332725/"],
  "includeReplies": true,
  "maxComments": 100,
  "commentsSince": "2026-11-01"
}
```

每筆資料是一則留言或回覆，提供 `text`、`createdAt`、`authorName`、`reactionCount`、`commentId`、`parentCommentId` 及來源網址等欄位。完整欄位與輸出範例見 [英文說明](#english)。每篇貼文內依發布時間由新到舊排列；多篇貼文依完成順序分組，並非全域時間排序。原文不會自動翻譯。

#### 常見問題

**是否保證取得 Facebook 顯示的全部留言？**\
不保證。隱藏、受限、已刪除或其他無法公開存取的內容可能不會提供，執行也受時間與資源限制。

**可以擷取私密社團、整個粉絲專頁或用關鍵字搜尋嗎？**\
不可以。本工具從指定公開內容連結擷取留言，不提供這些功能，也不是 Meta 官方產品。

**能搭配 AI 工作流程嗎？**\
可以透過已授權的 Apify MCP 或 API 連接相容的應用程式。你可將原始留言交給自己的情感分析工具。本 Actor 不附帶翻譯或情感評分。

[探索 lofomachines 的更多資料擷取與自動化工具](https://apify.com/lofomachines)。

***

### Italiano

#### Esporta commenti e risposte Facebook da post, reel, foto e video

Raccogli conversazioni pubbliche Facebook in un dataset pronto per analisi, report e fogli di calcolo. Inserisci uno o più link e ottieni testo originale, date, informazioni pubbliche sugli autori, reazioni e collegamenti tra risposte e commenti principali. Esporta tutto in CSV, Excel o JSON, senza effettuare il login a Facebook.

#### Come iniziare

1. Inserisci i **Facebook links**, oppure usa **Bulk edit** per incollare un link per riga.
2. Scegli se includere le risposte con **Include replies**, imposta **Maximum comments per post** e, se serve, seleziona una data nel calendario **Comments since**.
3. Premi **Start** e scarica i risultati al termine della raccolta.

Sono supportati post pubblici, reel, video, Watch, foto e link mobili o condivisi risolvibili senza login. Per le foto viene individuato automaticamente il post associato. I post sono elaborati in parallelo; i link duplicati vengono saltati e lo stesso post viene esportato una sola volta. Un link non accessibile non blocca gli altri.

Per i gruppi pubblici, incolla il link al singolo post nel formato `/groups/<gruppo>/permalink/<post>/` oppure `/groups/<gruppo>/posts/<post>/`. Il report del post segnala quando Facebook rende disponibile soltanto un’anteprima. Un commento con un adesivo o un’immagine può avere il campo testo vuoto.

#### Significato dei parametri

| Campo | Funzione |
| --- | --- |
| `startUrls` | Elenco degli URL Facebook da elaborare. |
| `includeReplies` | `true` per includere le risposte pubblicamente accessibili e gli ID dei commenti padre. |
| `maxComments` | Massimo di commenti principali esaminati per ciascun post. Le risposte sono aggiuntive. `0` rimuove il limite scelto dall’utente, mantenendo le protezioni automatiche. |
| `commentsSince` | Data iniziale facoltativa: include i commenti pubblicati da quel giorno alle 00:00 UTC in avanti. |

Il massimo viene applicato prima del filtro data. Con le risposte attive vengono controllati anche commenti principali più vecchi, entro il massimo scelto, per trovare risposte recenti. Una risposta può quindi comparire senza il proprio commento padre nel dataset filtrato.

#### Esempio di input

```json
{
  "startUrls": ["https://www.facebook.com/reel/1609243394332725/"],
  "includeReplies": true,
  "maxComments": 100,
  "commentsSince": "2026-11-01"
}
```

Ogni riga contiene un commento o una risposta, con campi come `text`, `createdAt`, `authorName`, `reactionCount`, `commentId`, `parentCommentId` e i link di origine. La [sezione inglese](#english) include tutti i campi e un esempio di output. L’ordine è dal più recente all’interno di ciascun post; i post sono raggruppati per ordine di completamento. Il testo dei commenti non viene tradotto.

#### Utilizzi

Usalo per social listening, analisi dei feedback, studio dei concorrenti, report sulle campagne e preparazione dei dati per i tuoi strumenti AI. L’Actor non calcola sentiment e non traduce automaticamente il contenuto.

#### Domande frequenti

**Raccoglie tutti i commenti indicati dal contatore Facebook?**\
Non è garantito. Alcuni commenti possono essere nascosti, limitati, eliminati o non esposti pubblicamente. Si applicano anche limiti automatici di tempo, richieste e memoria.

**Può cercare post per parola chiave o raccogliere intere pagine e gruppi privati?**\
No. Parte da URL di contenuti pubblici già individuati e non raccoglie Ads Library, intere pagine, album o discussioni private.

**Funziona con Claude, Codex e altri agenti?**\
Può essere usato tramite una connessione autorizzata all’API Apify o a un client MCP compatibile. Un’applicazione basata su Grok può integrarlo allo stesso modo; non è richiesto né dichiarato un connettore Grok nativo.

**Posso pianificare raccolte ricorrenti?**\
Sì, tramite Apify o il tuo sistema di automazione. Ogni run crea un dataset separato; la deduplicazione non si estende automaticamente alle esecuzioni precedenti.

[Scopri gli altri Actor di lofomachines](https://apify.com/lofomachines).

### Facebook comments API: get results in one request

Connect public Facebook conversations to dashboards, AI assistants, Make or n8n. The **Server** interface returns comments and available replies directly as JSON. Use it for quick post checks, customer feedback workflows and on-demand conversation analysis. For large exports or multiple posts, keep using the **Input** tab.

#### Try it without code

1. Open **Server**, expand **POST /scrape**, and select **Try it out**.
2. Paste one public Facebook post link into `startUrls`. Choose how many main comments to inspect and whether to include available replies.
3. Select **Execute**. Read `data.comments`, the counts, and the collection notes in `coverage`.

#### Example request

Copy the service URL from the Server tab. External tools use `Authorization: Bearer YOUR_APIFY_TOKEN` and `Content-Type: application/json`.

```json
{
  "startUrls": [
    "https://www.facebook.com/reel/1609243394332725/"
  ],
  "maxComments": 10,
  "includeReplies": true
}
```

#### Example response

Illustrative empty response; nonempty `data.comments` contains the same comment and reply records documented above.

```json
{
  "requestId": "example-request",
  "status": "ok",
  "counts": { "total": 0, "comments": 0, "replies": 0 },
  "data": { "comments": [] },
  "coverage": { "totalRows": 0, "issues": [] }
}
```

`ok` means the request was processed. It does **not** promise every comment was accessible: read `coverage.issues`. Private, hidden, removed or login-only comments cannot be recovered. Facebook counters may include comments or replies it does not expose publicly.

#### Limits and pricing

- One post per request; **1–50 main comments**, default 10. Replies are additional; at most **250 total rows** are returned. Facebook reply expansion is also limited to 20 per thread.
- Collection budget: **90 seconds**. Available results may be returned when a safety limit is reached, with an explanation in `coverage`.
- Each returned **comment or reply** charges one **Server result** (`server-result`), at the same plan-based per-result rate as batch exports. No result means no result charge. There is no Actor-start fee per Server request. See **Pricing** for current rates.
- Results are isolated per request and returned directly, without a shared dataset. Use **Input** for CSV, Excel, JSON downloads and resumable runs.
- Repeating a request performs a new collection and can charge again. Billing is confirmed before the response; a billing error returns no results.
- A busy instance returns **429**, with `Retry-After: 5`; invalid input returns **400**; unavailable posts return **502**.

Multi-tenant hosting shares warm instances across users, while each request has its own inputs, network client, results and billing ID. The server accepts public URLs; it does not accept account cookies or login credentials.

Discover more no-code tools for social research: [Explore all Lofomachines Actors](https://apify.com/lofomachines).

# Actor input Schema

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

Enter public Facebook post, photo, reel or video URLs, including links to individual posts in public groups. Use Bulk edit to paste one link per line. Posts run in parallel; duplicate links are skipped. A link is required to collect comments.

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

Collect publicly available replies and preserve their connection to the parent comment.

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

Maximum main comments to check for each post, starting with the newest. Replies are added separately. 0 collects available comments within the automatic safety limits.

## `commentsSince` (type: `string`):

Choose the earliest date to include, starting at 00:00 UTC. Leave empty for all dates. With replies enabled, older parent comments are checked for newer replies.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.facebook.com/reel/1609243394332725/"
  ],
  "includeReplies": true,
  "maxComments": 0
}
```

# Actor output Schema

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

Default dataset table: one row per comment or reply, including source post links.

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

Result counts, source posts, applied filters and collection notes.

## `json` (type: `string`):

Full comment and reply records as JSON. Metadata can be null when Facebook does not expose it.

## `csv` (type: `string`):

CSV export of the comments view for spreadsheet analysis.

## `excel` (type: `string`):

Excel export of the comments view.

## `coverage` (type: `string`):

Per-post counts, source links and collection notes.

## `resolution` (type: `string`):

Submitted Facebook links and the associated public post permalinks when resolution succeeds.

# 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": [
        "https://www.facebook.com/reel/1609243394332725/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lofomachines/facebook-comments-replies-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": ["https://www.facebook.com/reel/1609243394332725/"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lofomachines/facebook-comments-replies-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/pehpLb62UYCXQaD9K/builds/NKO8cSllEd8NaoEPk/openapi.json
