# Facebook Post Comments Scraper (`khadinakbar/facebook-comments-scraper`) Actor

Scrape public comments from Facebook post and reel URLs into clean records with author, text, timestamps, reactions, reply counts, and provider diagnostics. No login or cookies required. MCP-ready.

- **URL**: https://apify.com/khadinakbar/facebook-comments-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, MCP servers, AI
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 comment scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Facebook Post Comments Scraper

Scrape public **comments** from any Facebook **post or reel** URL into clean, structured JSON. Give the actor one or more post URLs and it returns one record per comment — author name, comment text, timestamp, reaction count, and reply count — with no login, no cookies, and no browser session to manage.

Built for social listening, audience research, sentiment analysis, brand monitoring, and AI-agent workflows that need structured public Facebook comment data on demand.

### What it extracts

Each dataset item is a single comment:

| Field | Description |
|-------|-------------|
| `postUrl` | The Facebook post/reel the comment belongs to |
| `commentId` | Provider-encoded comment identifier |
| `text` | The comment body |
| `authorName` | Display name of the commenter |
| `authorId` | Encoded Facebook user ID of the commenter |
| `authorGender` | Author gender when exposed (MALE / FEMALE) |
| `createdAt` | ISO 8601 timestamp of the comment |
| `replyCount` | Number of replies to the comment |
| `reactionCount` | Total reactions on the comment |
| `reactions` | Per-type breakdown (like, love, haha, …) — only when enabled |
| `scrapeSource` | Which data backend returned the comment |
| `scrapedAt` | ISO 8601 timestamp of extraction |

### When to use it

- Pull the comment thread under a specific post, reel, ad creative, or viral video.
- Run sentiment or theme analysis over real audience reactions.
- Feed a Claude / GPT agent structured public comment data via Apify MCP.

**Do not** use it for page/profile feeds, post captions, or follower lists — give it the URL of a **single post or reel**. For post captions and engagement totals use the **Facebook Posts Scraper**. For ad creatives use the **Facebook Ad Library Scraper**.

### Input

```json
{
  "postUrls": [
    "https://www.facebook.com/reel/753347914167361",
    "https://www.facebook.com/NASA/posts/10159744600446772"
  ],
  "maxComments": 200,
  "maxCommentsPerPost": 1000,
  "includeReactionBreakdown": false,
  "provider": "auto"
}
````

`postUrls` accepts plain URL strings or `{ "url": "..." }` objects. `maxComments` is your global cost cap; `maxCommentsPerPost` balances coverage across many posts within that cap.

### Output

```json
{
  "postUrl": "https://www.facebook.com/reel/753347914167361",
  "commentId": "Y29tbWVudDoxMjM=",
  "text": "This is incredible, thanks for sharing!",
  "authorName": "Jane Doe",
  "authorId": "100001",
  "createdAt": "2026-06-01T12:30:00.000Z",
  "replyCount": 4,
  "reactionCount": 27,
  "scrapeSource": "scrapecreators",
  "scrapedAt": "2026-06-26T00:00:00.000Z"
}
```

A machine-readable run summary (`OUTPUT` key) reports `outcome`, `totalComments`, `posts`, `blockedPosts`, `emptyPosts`, `providerUsage`, event-charge counts, and cost totals. `RUN_SUMMARY` includes provider attempts, validation errors, storage IDs, and detailed diagnostics.

### How it works

The actor is **provider-backed**. Public Facebook comments are login-gated for raw HTTP, so this actor reads them through managed data providers (ScrapeCreators, with SociaVault as automatic fallback) that return clean public-comment JSON. It paginates through each post's comment cursor until `maxComments` is reached. There is no proxy to configure and nothing to log in to — the provider keys are pre-configured by the actor owner.

If a post is private, deleted, age-gated, or has comments turned off, it is reported in the run summary rather than crashing the run. If every post fails at the provider, the run fails honestly with a clear message instead of returning a silent empty dataset.

### Pricing

Pay-per-event:

- **Actor start** — $0.00005 per run
- **Comment scraped** — $0.003 per comment written to the dataset

You are charged for comments actually returned, plus Apify platform usage under Pay per event + usage. Use `maxComments` to cap comment event spend exactly; platform usage is reported separately by Apify.

### Use with AI agents (MCP)

This actor is MCP-ready. Connect it through Apify MCP and an agent can call it with a single post URL and receive structured comment JSON, ideal for sentiment summaries and audience-reaction analysis.

### FAQ

**Do I need a Facebook login or cookies?** No. The actor reads only public comments via managed providers.

**Does it scrape replies to comments?** v1 returns top-level comments with a `replyCount`. Nested reply text is on the roadmap.

**Why did a post return no comments?** It is likely private, deleted, age-gated, has comments disabled, or genuinely has none. Check the `OUTPUT` summary's `blockedPosts` vs `emptyPosts`.

### Legal

Use this actor only to collect **publicly available** data and in compliance with Facebook's terms, applicable laws (including GDPR/CCPA), and the rights of data subjects. You are responsible for how you use scraped data. This actor does not access private, login-gated, or non-public content.

# Actor input Schema

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

One or more public Facebook post or reel URLs to read comments from (e.g. 'https://www.facebook.com/reel/753347914167361' or a permalink/story.php/posts URL). Accepts plain URL strings or {"url": "..."} objects. NOT a page, profile, or group feed URL — give the URL of a single post. Private, deleted, or login-only posts return no comments.

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

Maximum number of comment records to emit across all posts. This is your primary cost cap; each emitted comment charges the comment-scraped event. Defaults to 100. Set lower to control spend on busy posts.

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

Maximum number of comments to collect from each individual post before moving to the next URL. Defaults to 1000. Use this to balance coverage across many posts within the total comments limit. NOT the global cap — see Total comments limit.

## `includeReactionBreakdown` (type: `boolean`):

When enabled, adds a reactions object with per-type counts (like, love, haha, wow, care, sad, angry) to each comment when the provider returns it. Leave off for a leaner dataset; the total reactionCount is always included.

## `provider` (type: `string`):

Which backend reads the public comments. 'auto' tries ScrapeCreators first then SociaVault. Pick a single provider to force it. The owner's API keys are pre-configured as environment variables; you do not supply a key. NOT a Facebook login.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.facebook.com/reel/753347914167361"
  ],
  "maxComments": 200,
  "maxCommentsPerPost": 500,
  "includeReactionBreakdown": false,
  "provider": "auto"
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

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

No description

## `runSummary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "postUrls": [
        "https://www.facebook.com/reel/753347914167361"
    ]
};

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

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/facebook-comments-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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/reel/753347914167361"
  ]
}' |
apify call khadinakbar/facebook-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=khadinakbar/facebook-comments-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Post Comments Scraper",
        "description": "Scrape public comments from Facebook post and reel URLs into clean records with author, text, timestamps, reactions, reply counts, and provider diagnostics. No login or cookies required. MCP-ready.",
        "version": "1.1",
        "x-build-id": "WxmnFFbl7kAhAcgA7"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/khadinakbar~facebook-comments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-khadinakbar-facebook-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/khadinakbar~facebook-comments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-khadinakbar-facebook-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/khadinakbar~facebook-comments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-khadinakbar-facebook-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "postUrls"
                ],
                "properties": {
                    "postUrls": {
                        "title": "Facebook post or reel URLs",
                        "type": "array",
                        "description": "One or more public Facebook post or reel URLs to read comments from (e.g. 'https://www.facebook.com/reel/753347914167361' or a permalink/story.php/posts URL). Accepts plain URL strings or {\"url\": \"...\"} objects. NOT a page, profile, or group feed URL — give the URL of a single post. Private, deleted, or login-only posts return no comments.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxComments": {
                        "title": "Total comments limit",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Maximum number of comment records to emit across all posts. This is your primary cost cap; each emitted comment charges the comment-scraped event. Defaults to 100. Set lower to control spend on busy posts.",
                        "default": 100
                    },
                    "maxCommentsPerPost": {
                        "title": "Max comments per post",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Maximum number of comments to collect from each individual post before moving to the next URL. Defaults to 1000. Use this to balance coverage across many posts within the total comments limit. NOT the global cap — see Total comments limit.",
                        "default": 1000
                    },
                    "includeReactionBreakdown": {
                        "title": "Include reaction breakdown",
                        "type": "boolean",
                        "description": "When enabled, adds a reactions object with per-type counts (like, love, haha, wow, care, sad, angry) to each comment when the provider returns it. Leave off for a leaner dataset; the total reactionCount is always included.",
                        "default": false
                    },
                    "provider": {
                        "title": "Data provider",
                        "enum": [
                            "auto",
                            "scrapeCreators",
                            "sociaVault"
                        ],
                        "type": "string",
                        "description": "Which backend reads the public comments. 'auto' tries ScrapeCreators first then SociaVault. Pick a single provider to force it. The owner's API keys are pre-configured as environment variables; you do not supply a key. NOT a Facebook login.",
                        "default": "auto"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
