# Facebook Comments Scraper: Comments, Replies & Reactions (`automatic/facebook-comments-scraper`) Actor

Scrape comments and replies from public Facebook posts, photos, videos and reels: text, author and profile link, date, reactions by type, reply counts and a direct link to each comment. Filter by date, such as the last 7 days, for scheduled monitoring. Skipped comments cost nothing.

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

## Pricing

from $1.50 / 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

Get the comments and replies from public Facebook posts, photos, videos and reels: comment text, author name and profile link, date, total reactions with a like, love, care, haha, wow, sad and angry breakdown, reply counts and a direct link to every comment. Each comment becomes one clean row for export to CSV, Excel or JSON.

Built for brand monitoring, community management, audience and sentiment research, and campaign reporting.

- **Paste any public link**: Page posts, photos, videos, reels, watch links, share links and fb.watch links. A comment link reads its whole post, and a Page URL reads its recent posts.
- **Full threads**: replies up to two levels deep, each with its depth and parent comment, so you can rebuild the conversation.
- **Engagement per comment**: total reactions, the breakdown by reaction type and the reply count.
- **Ready for scheduled monitoring**: sort newest first and keep only comments from the last `24 hours` or `7 days`. Skipped comments are not charged.

The prefilled input returns 10 comments from a NASA post in about 10 seconds.

### Also available

The Facebook and Meta suite: pick the job.

| Actor | Use when |
|---|---|
| **Facebook Comments (this Actor)** | Comments and replies on any public post |
| [Facebook Page Posts](https://apify.com/automatic/facebook-posts-scraper) | Recent posts and reactions from any Page |
| [Facebook Pages](https://apify.com/automatic/facebook-pages-scraper) | Page followers, contacts and latest post |
| [Instagram Comments](https://apify.com/automatic/instagram-comments-scraper) | Comments on posts and reels |
| [YouTube Scraper](https://apify.com/automatic/youtube-scraper) | Videos, channels, search results and comments |
| [Reddit](https://apify.com/automatic/reddit-scraper) | Posts and comments from subreddits and searches |

### Quick start

```json
{
  "startUrls": ["https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl"],
  "maxCommentsPerPost": 10,
  "maxItems": 10
}
```

Paste post, photo, video, reel or Page links in `startUrls`, one per line.

### Input

| Field | Meaning |
| --- | --- |
| `startUrls` | Up to 100 links: Page posts, photos, videos, reels, watch links, share links (`facebook.com/share/…`, `fb.watch/…`), comment links or Page URLs. Duplicates are removed. |
| `maxCommentsPerPost` | Most comments to save from each post, replies included. Default 100; up to 1,000. |
| `maxItems` | Most comments to save in the whole run. Default 100; up to 10,000. |
| `maxPostsPerPage` | For Page URLs: how many recent posts to read. Default 1; up to 20. |
| `includeReplies` | Also save replies, up to two levels, as their own rows. Default off. |
| `sort` | `most_relevant` (Facebook's default ranking) or `newest`. |
| `onlyCommentsNewerThan` | Optional. A date such as `2026-11-01` or a relative age such as `24 hours`, `7 days` or `2 weeks`. |
| `onlyCommentsOlderThan` | Optional. A date or relative age; combine both for a date range. |

For the latest comments on a video, replies included:

```json
{"startUrls": ["https://www.facebook.com/NASA/videos/1139406561931708/"], "sort": "newest", "includeReplies": true, "maxCommentsPerPost": 200}
```

For a daily run that keeps only the last day's comments on a Page's five most recent posts:

```json
{"startUrls": ["https://www.facebook.com/bbcnews"], "maxPostsPerPage": 5, "sort": "newest", "onlyCommentsNewerThan": "1 day", "maxItems": 1000}
```

### Output

| Fields | What you get |
| --- | --- |
| `commentId`, `commentUrl` | Comment ID and a direct link that opens the comment on Facebook. |
| `postId`, `postUrl`, `postText` | The post the comment belongs to, its link and its text. |
| `pageId`, `pageName` | The Page that published the post. |
| `text`, `publishedAt` | Comment text and its time in ISO format (UTC). |
| `authorName`, `authorUrl`, `authorId`, `authorProfilePicture` | The commenter's public name, profile link, ID and profile picture. |
| `reactionsCount`, `reactionsLike`, `reactionsLove`, `reactionsCare`, `reactionsHaha`, `reactionsWow`, `reactionsSad`, `reactionsAngry` | Total reactions and each reaction type. |
| `replyCount`, `depth`, `isReply`, `parentId` | Reply count, thread level (0 for a comment, 1 or 2 for replies) and the parent comment. |
| `mediaUrl` | The image, GIF or sticker attached to the comment. |
| `scrapedAt` | Collection time. |

### Output example

Captured from the NASA sample on 2026-11-15:

```json
{
  "commentId": "2332508050921595",
  "commentUrl": "https://www.facebook.com/NASA/posts/pfbid0sCRtJWP47dBHDkh8JV8D1nVdJEDxEsXfnvPZ38Xt5uudwj3Z8wqhc8RguzbDTHMyl?comment_id=2332508050921595",
  "postId": "1685704526258250",
  "postUrl": "https://www.facebook.com/NASA/posts/pfbid0sCRtJWP47dBHDkh8JV8D1nVdJEDxEsXfnvPZ38Xt5uudwj3Z8wqhc8RguzbDTHMyl",
  "postText": "Tethys and Dione showed up for the group photo!\n \nIn addition to the two moons shown here, Saturn has a whole entourage of natural satellites—more than any other planet in our solar system. As of now, the ringed planet has 293 confirmed moons.",
  "pageId": "54971236771",
  "pageName": "NASA - National Aeronautics and Space Administration",
  "text": "293 moons is a wild number. Most of them must be small rocks nobody will ever name, so it's nice to see two of the bigger ones get their own photo with the rings",
  "authorName": "Moslim Oskanov",
  "authorUrl": "https://www.facebook.com/Bekov.Muslim",
  "authorId": "pfbid02hZGnsdEoRrcqc26w2mV1nHEeyv88uSeEgE6jcHqvBEFDpWquW3qkWc1ZuiE9R9yql",
  "authorProfilePicture": "https://scontent.flim11-1.fna.fbcdn.net/v/t39.30808-1/886895155_1459949396281278_3066181881884283843_n.avif?stp=cp0_dst-jpg_tt6&cstp=mx1080x1080&ctp=s64x64&_nc_cat=100&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=e99d92&_nc_ohc=OMy9WAn7ypYQ7kNvwHYlovI&_nc_oc=AdpEf4Fl244cP41Y9WUVyw-vOdcy62DtXsei4qhL9xwtZGOAjZ8UpY5CvjqNtM8PdW0&_nc_zt=24&_nc_ht=scontent.flim11-1.fna&_nc_gid=o0kpYaBuHHG19c_KIyh0ng&_nc_ss=7b289&oh=00_AQQN4YqJ5qkSzwfvvaCP8-imfSf61jRwG2vSH_5FgW-Fww&oe=6AFF0172",
  "publishedAt": "2026-11-12T20:33:51+00:00",
  "reactionsCount": 7,
  "reactionsLike": 6,
  "reactionsLove": 0,
  "reactionsCare": 1,
  "reactionsHaha": 0,
  "reactionsWow": 0,
  "reactionsSad": 0,
  "reactionsAngry": 0,
  "replyCount": 2,
  "depth": 0,
  "isReply": false,
  "parentId": null,
  "mediaUrl": null,
  "scrapedAt": "2026-11-15T03:46:06.721388+00:00"
}
```

### Run summary

`OUTPUT` reports saved `comments`, `postsProcessed`, per-post `postCoverage`, `errors` for any link that could not be read, `skippedSources` for unsupported links, and the exact `dateWindow` with `skippedByDate` when a date filter is set. An empty input runs an announced five-comment NASA sample with `usedExample: true`. If nothing matches your links or dates, the run still succeeds and says why.

### Pricing

**$0.0015 per delivered comment ($1.50 per 1,000) plus $0.005 per run start.** The start fee is charged per GB of memory (minimum one); the default 512 MB run is one start event. Only delivered comment rows count as results.

| Example at the default 512 MB memory | Comments | Cost |
| --- | ---: | ---: |
| Console prefill | 10 | $0.02 |
| 100 delivered comments | 100 | $0.155 |
| 1,000 delivered comments | 1,000 | $1.505 |
| No delivered comments | 0 | $0.005 |

Comments outside your date window are not saved and not charged.

### Good to know

- Public Page content only, as anyone sees it without logging in. Group posts, personal profiles, private or deleted posts are not available; unsupported links are listed in the run summary.
- Facebook shows logged-out visitors a subset of the comments on big posts, so a post can return fewer comments than its displayed total.
- Replies are limited to two levels. A Page URL follows public feed order, so a pinned post can come first.
- With `most_relevant`, a date filter checks every visible comment; with `newest`, reading stops at the first comment older than your window, which is faster and cheaper.
- When the reaction types Facebook shows do not add up to the total, the missing types are null. Profile pictures and media links can expire.
- Counts are a snapshot at collection time.

# Actor input Schema

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

Public Page post links, photo, video, reel and watch links, share links (facebook.com/share/…, fb.watch) or Page URLs. Comment links read the whole post. For a Page URL, comments come from its latest public posts (see Posts per Page). Example: https://www.facebook.com/NASA/posts/… . Duplicates are removed; unsupported links are skipped and listed in the run summary. Empty input runs an announced five-comment NASA sample.

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

Most comments to save from each post, replies included. Example: 100. Facebook may show fewer public comments than its displayed total.

## `maxPostsPerPage` (type: `integer`):

For Page URLs only: how many of the Page's recent public posts to read, in the order the Page shows them (pinned posts can come first). Example: 5.

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

Most comments to save in this run across all links, replies included. Example: 500.

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

Also save replies, up to two reply levels, as their own rows with depth and parentId. Replies count toward the same limits.

## `sort` (type: `string`):

Most relevant follows Facebook's default ranking. Newest first returns the latest comments first and works best with a date filter.

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

Optional. A UTC date such as 2026-11-01 or a relative age such as 24 hours, 7 days or 2 weeks (counted back from the run start, handy for scheduled runs). Comments outside the window are skipped and not charged. With Newest first, reading stops at the first older comment.

## `onlyCommentsOlderThan` (type: `string`):

Optional. A UTC date such as 2026-11-01 or a relative age such as 30 days. Combine with Only comments newer than for a date range. Skipped comments are not charged.

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

Optional Apify connection settings. Example: {"useApifyProxy":true,"apifyProxyCountry":"US"}.

## `residentialFallback` (type: `boolean`):

When Facebook refuses a public page on the default connection, retry it on an alternative one. Example: true. Saved comments are kept.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl"
  ],
  "maxCommentsPerPost": 10,
  "maxPostsPerPage": 1,
  "maxItems": 10,
  "includeReplies": false,
  "sort": "most_relevant",
  "onlyCommentsNewerThan": "",
  "onlyCommentsOlderThan": "",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  },
  "residentialFallback": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (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 = {
    "startUrls": [
        "https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl"
    ],
    "maxCommentsPerPost": 10,
    "maxPostsPerPage": 1,
    "maxItems": 10,
    "includeReplies": false,
    "sort": "most_relevant",
    "onlyCommentsNewerThan": "",
    "onlyCommentsOlderThan": "",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyCountry": "US"
    },
    "residentialFallback": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatic/facebook-comments-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startUrls": ["https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl"],
    "maxCommentsPerPost": 10,
    "maxPostsPerPage": 1,
    "maxItems": 10,
    "includeReplies": False,
    "sort": "most_relevant",
    "onlyCommentsNewerThan": "",
    "onlyCommentsOlderThan": "",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyCountry": "US",
    },
    "residentialFallback": True,
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    "https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl"
  ],
  "maxCommentsPerPost": 10,
  "maxPostsPerPage": 1,
  "maxItems": 10,
  "includeReplies": false,
  "sort": "most_relevant",
  "onlyCommentsNewerThan": "",
  "onlyCommentsOlderThan": "",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  },
  "residentialFallback": true
}' |
apify call automatic/facebook-comments-scraper --silent --output-dataset

```

## MCP server setup

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