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

Scrape and export Facebook comments from any public post, reel, video or group post without login: comment text, author, date, reactions, reply count and optional replies. Sort by newest or all. Download comments to Excel or CSV for giveaways, sentiment and research.

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

## Pricing

from $1.00 / 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.

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

Scrape and **export Facebook comments** from any public post, reel, video or group post, with no login and no Graph API token. The **Facebook Comments Scraper** returns each comment's text, author, exact date, reaction count, reply count and attached GIF or sticker, and can add the replies (and replies to replies) with a link to the comment they answer. Paste many post URLs in one run and download the comments to Excel, CSV or JSON. Use it as a Facebook comment exporter for giveaways and comment pickers, sentiment analysis, customer feedback research and lead lists.

### 🎯 Use Cases

- **Facebook comment picker for giveaways**: export every comment of a contest post to a spreadsheet and draw the winner from the full list, not just the comments Facebook shows first.
- **Export Facebook comments to Excel**: a clean table of who said what and when, for reports, moderation and archiving.
- **Sentiment analysis and social listening**: collect comments on brand, competitor and news posts and feed them to an AI model or a sentiment tool.
- **Customer feedback research**: read what people ask and complain about under product launches, ads and announcements.
- **Lead lists from comments**: find the people who comment "interested" or ask for prices under a post.
- **Group discussions**: scrape the comments of public group posts together with the [Facebook Group Posts Scraper](https://apify.com/piotrv1001/facebook-group-posts-scraper).

### ✨ Features

- **Any public post**: page posts, reels, videos, photos, group posts, `story.php` and `permalink.php` links. Watch and share links are followed to the post.
- **Deep comment lists**: 10 comments per page, page after page; we read 600 comments of one NASA post without reaching the end.
- **Replies on demand**: turn on "Include replies" to also get the replies and the replies to replies, each row with `depth` and `parentId`.
- **Sort order**: all comments (default), newest first, or most relevant, the same choices Facebook gives.
- **Media in comments**: GIFs, stickers and photos posted as comments come back as `imageUrl`.
- **Fair billing**: each comment is saved and charged once per run, even when two URLs point to the same post. Posts that are removed or not public are listed in the status message and not charged.

### 🛠️ How It Works

1. **Paste Facebook post URLs**: one per line, e.g. `https://www.facebook.com/NASA/posts/pfbid02or…` or `https://www.facebook.com/groups/…/posts/…`.
2. **Set the limit and options**: 50 comments per post by default; pick the sort order and whether to include replies.
3. **Run the scraper**: download the comments as Excel, CSV or JSON, or get them through the API.

### ⚙️ Input

| Field | What it does |
| --- | --- |
| **Facebook post URLs** | Public post, reel, video, photo or group post URLs, one per line. |
| **Max comments per post** | Stop after this many comments from each post. Replies count too when they are included. Default 50. |
| **Sort comments** | `all` (All comments, default), `newest` (Newest first) or `relevant` (Most relevant, can hide some comments). |
| **Include replies** | Also save the replies to each comment. Off by default. |

```json
{
    "postUrls": [
        "https://www.facebook.com/NASA/posts/pfbid02or2A5mwjUdptjrR9LiDcrdfV73poxS7Mn1GwdCN2mS5ntTcvF4owZKCsMLSbajEUl",
        "https://www.facebook.com/reel/1863947697952668/"
    ],
    "maxItems": 500,
    "sortBy": "newest",
    "includeReplies": true
}
```

### 💰 Pricing

You pay per comment saved, with no monthly rental.

| Event | Price | What you get |
| --- | --- | --- |
| **Comment** | $0.001 per comment ($1 per 1,000) | One comment or reply with all the fields below |
| **Actor start** | $0.00005 per run | Charged once when the run starts |

Examples: 500 comments cost $0.50 and 10,000 comments cost $10. Replies are comments, so each saved reply is one Comment event. Posts that are removed, private or have no comments are listed in the run's status message and are not charged.

### 📊 Sample Output Data

```json
{
    "id": "1862694261574416",
    "url": "https://www.facebook.com/NASA/posts/pfbid02or2A5mwjUdptjrR9LiDcrdfV73poxS7Mn1GwdCN2mS5ntTcvF4owZKCsMLSbajEUl?comment_id=1862694261574416",
    "text": "This looks like a PS2 cut scene",
    "createdAt": "2026-10-17T00:31:04.000Z",
    "reactions": 305,
    "replies": 8,
    "depth": 0,
    "parentId": null,
    "author": {
        "name": "Alberto Sánchez",
        "id": "pfbid02n262CRVSoKhn3Z1NZ9Y9H6o2NnfwqGHpxPVdgPfxDDbCd2DjXkuG2qBPyWNWAzvZl",
        "url": null,
        "profilePictureUrl": "https://scontent.fpos3-1.fna.fbcdn.net/v/t39.30808-1/855728896_10241867353517762_1802761522569040999_n.jpg?…"
    },
    "imageUrl": null,
    "postId": "1658876782274358",
    "postUrl": "https://www.facebook.com/NASA/posts/float-into-the-weekend-like-a-space-jellyfish-this-fuzzy-glowing-jellyfish-shape/1658876782274358/",
    "inputUrl": "https://www.facebook.com/NASA/posts/pfbid02or2A5mwjUdptjrR9LiDcrdfV73poxS7Mn1GwdCN2mS5ntTcvF4owZKCsMLSbajEUl",
    "scrapedAt": "2026-10-21T14:32:37.079Z"
}
```

A reply carries the comment it answers in `parentId` and `depth: 1` (a reply to a reply has `depth: 2`):

```json
"depth": 1,
"parentId": "1862694261574416",
"url": "https://www.facebook.com/NASA/posts/pfbid02or…?comment_id=1862694261574416&reply_comment_id=2519402785223724",
"imageUrl": "https://external.fpos3-1.fna.fbcdn.net/emg1/v/t13/4266532889711215789?…giphy.gif…"
```

`replies` is the number of replies Facebook counts for the comment. `author.id` is the commenter's public ID as Facebook shows it to logged-out visitors (often an encoded `pfbid…` value), and `author.url` is filled only when Facebook shows a profile link. `inputUrl` is the URL you entered, so rows from several posts are easy to group.

### ⏰ Schedule and Integrate

Run it daily on your latest posts to keep a running archive of new comments, or once when a giveaway closes. Set it up with Apify **Schedules**, and send the results to Google Sheets, Zapier, Make, n8n or your own webhook through the Apify integrations.

### 🤖 Use with AI Agents (MCP)

The scraper works as a tool in Claude, ChatGPT, Cursor and other MCP clients through the Apify MCP server (`https://mcp.apify.com`). An agent can call it with:

```json
{ "postUrls": ["https://www.facebook.com/NASA/posts/pfbid02or2A5mwjUdptjrR9LiDcrdfV73poxS7Mn1GwdCN2mS5ntTcvF4owZKCsMLSbajEUl"], "maxItems": 100 }
```

### ❓ FAQ

**Does Facebook have an official comments API?** The Graph API returns comments only for pages you manage, with an app review and access tokens. This scraper reads the comments any logged-out visitor can see on a public post, with no key or approval, and returns them in one flat table.

**Do I need a Facebook account or cookies?** No. Only public posts work; posts in private groups or with limited audiences are reported as not available and not charged.

**How do I export Facebook comments to Excel for a giveaway?** Paste the contest post URL, set "Max comments per post" above the post's comment count, keep "All comments" sorting, run, and download the dataset as Excel. Turn on "Include replies" if replies count as entries.

**Can I scrape all comments from a Facebook post?** Yes, up to the limit you set. Facebook itself can hide spam or low-quality comments from everyone, so the saved count can be a little lower than the number on the post.

**Why is `author.url` empty?** Facebook hides most commenter profile links from logged-out visitors. The name, encoded ID and profile picture are still there.

**Why is `text` empty on some comments?** Those comments are only a GIF, sticker or photo; the image link is in `imageUrl`.

**How long do the image links work?** Facebook's media links expire after a few days, so download the files you need soon after the run.

### 🔗 More Facebook Actors

- [Facebook Group Posts Scraper](https://apify.com/piotrv1001/facebook-group-posts-scraper): the posts of public groups; feed their URLs here for the comments.
- [Facebook Posts Scraper](https://apify.com/piotrv1001/facebook-posts-scraper): the posts of public pages with engagement counts.
- [Facebook Pages Scraper](https://apify.com/piotrv1001/facebook-pages-scraper): page profile, followers, contact details and rating.
- [Facebook Ads Library Scraper](https://apify.com/piotrv1001/facebook-ads-library-scraper): ads from Meta's Ad Library by keyword.

# Actor input Schema

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

Public Facebook post, reel, video or group post URLs, one per line, e.g. `https://www.facebook.com/NASA/posts/pfbid02or…` or `https://www.facebook.com/groups/…/posts/…`.

## `maxItems` (type: `integer`):

Stop after this many comments from each post (replies count too when they are included).

## `sortBy` (type: `string`):

The comment order Facebook offers on the post. "Most relevant" can hide some comments.

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

Also save the replies to each comment (each reply is one result, with the comment it answers in `parentId`).

## `proxyConfiguration` (type: `object`):

Connection settings. Keep the default.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.facebook.com/NASA/posts/pfbid02or2A5mwjUdptjrR9LiDcrdfV73poxS7Mn1GwdCN2mS5ntTcvF4owZKCsMLSbajEUl"
  ],
  "maxItems": 50,
  "sortBy": "all",
  "includeReplies": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (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/NASA/posts/pfbid02or2A5mwjUdptjrR9LiDcrdfV73poxS7Mn1GwdCN2mS5ntTcvF4owZKCsMLSbajEUl"
    ],
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("piotrv1001/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/NASA/posts/pfbid02or2A5mwjUdptjrR9LiDcrdfV73poxS7Mn1GwdCN2mS5ntTcvF4owZKCsMLSbajEUl"],
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("piotrv1001/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 '{
  "postUrls": [
    "https://www.facebook.com/NASA/posts/pfbid02or2A5mwjUdptjrR9LiDcrdfV73poxS7Mn1GwdCN2mS5ntTcvF4owZKCsMLSbajEUl"
  ],
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call piotrv1001/facebook-comments-scraper --silent --output-dataset

```

## MCP server setup

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