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

Facebook comments scraper, no login: public comments and replies of Facebook posts, reels, videos and photos from Pages, profiles and public groups, with text, author, reactions, reply count, date and parent comment. All, newest or most relevant. JSON, CSV, Excel. $0.95 per 1,000 comments.

- **URL**: https://apify.com/socialscrapers/facebook-comments-scraper.md
- **Developed by:** [Social Scrapers](https://apify.com/socialscrapers) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 4 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

This **Facebook Comments Scraper** extracts the public comments and replies of Facebook posts, reels, videos and photos: comment text, author name, link and picture, reactions by type, reply count, date, and for each reply the comment it answers. Paste post links from Pages, profiles or public groups, choose all comments, newest first or most relevant, and download clean data as JSON, CSV or Excel. **No Facebook account, no login, no cookies.** It costs **$0.95 per 1,000 comments**.

> 💡 **Need a feature that isn't here? Just ask.** Open an issue on the **Issues** tab and tell us what you need: a new field, filter, input type or output format. We build requested features fast, usually within 24 hours, at no extra cost.

> ⭐ **Found it useful?** A short review on the **Reviews** tab helps other people find this scraper, and tells us what to build next.

### What does Facebook Comments Scraper do?

- 💬 **Every comment of a post**: page after page, as far as Facebook lists them, or up to the number you set per post.
- ↩️ **Replies too**: replies to each comment and replies to replies, each as its own row right after the comment it answers, with `parentCommentId` and the name of the person it answers.
- 🎬 **Posts, reels, videos and photos**: from Facebook Pages, personal profiles and public groups.
- 🔀 **Facebook's three orders**: *All comments*, *Newest first* or *Most relevant*, as in Facebook's own comment menu.
- 📅 **Only recent comments**: keep comments written after a date or within an age (`7 days`, `3 months`); reading stops at the limit.
- 😆 **Reactions by type**: like, love, care, haha, wow, sad and angry counts for each comment, plus the total.
- 🔗 **Any post link works**: links with or without tracking, mobile links, `permalink.php` and `story.php` links, Watch links, and share links from the Facebook app (`facebook.com/share/…`, `fb.watch/…`).
- 💸 **Pay only for comments saved**: no charge for posts with no comments, deleted or private posts, and the run stops cleanly at the spending limit you set.

Because it runs on the Apify platform, you also get the API, scheduling, integrations, monitoring and proxies without writing any code.

### What data can you extract from Facebook comments?

One dataset item per comment or reply. Every field is always present: `null` (or an empty list) means Facebook shows nothing for it.

| Field | Type | Description |
|---|---|---|
| `commentId` | string | The comment's numeric id. |
| `commentUrl` | string | The comment's own link. |
| `text` | string | What the comment says. |
| `createdAt` | string | When it was written, ISO 8601 in UTC. |
| `timestamp` | number | The same, in Unix seconds. |
| `reactionsCount` | number | All reactions on the comment. |
| `reactions` | object | Reactions by type: `like`, `love`, `care`, `haha`, `wow`, `sad`, `angry` (types with none left out). |
| `repliesCount` | number | Replies to the comment, as Facebook counts them. |
| `depth` | number | `0` for a comment on the post, `1` for a reply, `2` for a reply to a reply. |
| `parentCommentId` | string or null | For a reply: the id of the comment it answers. |
| `parentCommentAuthor` | string or null | For a reply: the name of the person or Page it answers. |
| `authorName` | string | The commenter's name. |
| `authorId` | string | The commenter's id: a number, or the token Facebook shows logged-out visitors instead. |
| `authorUrl` | string or null | The commenter's profile or Page link, when Facebook shows one. |
| `authorPictureUrl` | string | The commenter's profile picture. |
| `authorType` | string | `User` or `Page`. |
| `authorIsVerified` | boolean or null | The commenter has a verified badge. |
| `attachments` | array | Photos, stickers, GIFs and links in the comment: `type`, `url`, `imageUrl`. |
| `postUrl` | string | The post, reel, video or photo the comment is on. |
| `postCommentsCount` | number or null | Comments and replies on the post, as Facebook counted them when it was read. |
| `inputUrl` | string | The link from your input this comment answers. |
| `scrapedAt` | string | When the comment was read. |

### How to scrape Facebook comments

1. Click **Try for free** (or **Start**) on this page.
2. In **Facebook post URLs**, paste the links of the posts, reels, videos or photos, one per line. To get a post's link, click the post's date (or open the reel) and copy the address.
3. Set **Max comments per post** (for example `500`, or `0` for every comment), and turn on **Include replies** if you want the replies too.
4. Pick the **Comment order**, and optionally **Only comments newer than**.
5. Click **Start**, and download the comments from the **Output** tab as JSON, CSV, Excel or HTML, or read them through the API.

### How much does it cost to scrape Facebook comments?

**$0.95 per 1,000 comments**, platform usage and residential proxies included. A reply costs the same as a comment. You pay one `comment` event per comment or reply saved:

| Your Apify plan | Per 1,000 comments |
|---|---|
| Free and Starter (Bronze) | $0.95 |
| Scale (Silver) | $0.855 (−10%) |
| Business (Gold) | $0.76 (−20%) |

Each run also carries a start charge of $0.005, which covers loading Facebook before the first comment.

Three examples:

- **The latest 100 comments on each of 10 posts** = 1,000 comments = **$0.955** with the start charge.
- **Every comment and reply of one popular post**, about 700 in all = **$0.67**.
- **New comments on 20 posts of a brand's Page, checked every day** (`onlyCommentsNewerThan: "1 day"`), about 30 a post = 600 comments = **$0.575 a day**.

Posts with no comments, deleted or private posts and links that are no post produce no items and are not charged; only the start charge applies. To cap a run's cost, set **Maximum cost per run** in the run options: the scraper stops cleanly once it is reached and keeps everything scraped so far. Apify's free plan comes with monthly usage credit, enough to try this scraper on about 5,000 comments.

### Input example

```json
{
  "startUrls": [
    { "url": "https://www.facebook.com/NASA/posts/pfbid02hrXYVBCzSCcWhneqiiSCfZDXpDPaEFQWAeWV8KvYBmrgVT2ch5JmL7aj4MTqVHexl" },
    { "url": "https://www.facebook.com/reel/1056346190744779/" }
  ],
  "maxCommentsPerPost": 200,
  "includeReplies": true,
  "commentsSortOrder": "newest",
  "onlyCommentsNewerThan": "30 days"
}
```

| Field | Type | Description |
|---|---|---|
| `startUrls` | array | Links to public posts, reels, videos or photos: `{ "url": "…" }` objects or plain strings. Share links from the Facebook app work too. |
| `maxCommentsPerPost` | integer, default `50` | Comments (and replies) to save per post. `0` = every comment Facebook lists. |
| `includeReplies` | boolean, default `false` | Also save the replies to each comment, and the replies to those. |
| `commentsSortOrder` | string, default `all` | `all` (All comments), `newest` (Newest first) or `relevant` (Most relevant, Facebook's default, which leaves some comments out). |
| `onlyCommentsNewerThan` | string, optional | A date (`2026-01-31`, `31/01/2026`, `Jan 31 2026`) or an age (`7 days`, `2w`, `3 months`): only comments written since then. Comments are then read newest first. |
| `proxyConfiguration` | object, default Apify Proxy `RESIDENTIAL` | Proxy settings. Keep the residential default. |

Coming from another Facebook comments scraper? `resultsLimit`, `includeNestedComments` and `viewOption` (`RANKED_UNFILTERED`, `RECENT_ACTIVITY`, `RANKED_THREADED`) are read too.

### Output example

A real comment on a NASA post, with the commenter's name and id replaced by placeholders and the picture link shortened:

```json
{
  "commentId": "1888468175915396",
  "commentUrl": "https://www.facebook.com/NASA/posts/pfbid02hrXYVBCzSCcWhneqiiSCfZDXpDPaEFQWAeWV8KvYBmrgVT2ch5JmL7aj4MTqVHexl?comment_id=1888468175915396",
  "text": "Sắp có VinX đối trọng SpaceX trong tương lai",
  "createdAt": "2026-10-30T03:11:46.000Z",
  "timestamp": 1793329906,
  "reactionsCount": 325,
  "reactions": { "haha": 256, "like": 67, "love": 1, "sad": 1 },
  "repliesCount": 4,
  "depth": 0,
  "parentCommentId": null,
  "parentCommentAuthor": null,
  "authorName": "<commenter name>",
  "authorId": "<commenter id>",
  "authorUrl": "https://www.facebook.com/<commenter>",
  "authorPictureUrl": "https://scontent.xx.fbcdn.net/v/…/639861137_122231472368274290_n.jpg",
  "authorType": "User",
  "authorIsVerified": false,
  "attachments": [],
  "postUrl": "https://www.facebook.com/NASA/posts/pfbid02hrXYVBCzSCcWhneqiiSCfZDXpDPaEFQWAeWV8KvYBmrgVT2ch5JmL7aj4MTqVHexl",
  "postCommentsCount": 716,
  "inputUrl": "https://www.facebook.com/NASA/posts/pfbid02hrXYVBCzSCcWhneqiiSCfZDXpDPaEFQWAeWV8KvYBmrgVT2ch5JmL7aj4MTqVHexl",
  "scrapedAt": "2026-11-13T13:53:54.441Z"
}
```

### Use cases

- **Brand and campaign monitoring**: read what people say under your posts and ads, and your competitors', every day.
- **Sentiment and topic analysis**: feed comment text into a sentiment model or an LLM and see how an audience reacts.
- **Customer feedback**: collect complaints, questions and product ideas left under a Page's posts.
- **Contests and giveaways**: export every comment of a giveaway post to pick a winner fairly.
- **Community and moderation research**: study discussions in public groups and on viral reels.
- **Datasets**: real, labelled conversations for training and evaluating language models.

### Use Facebook Comments Scraper via API, Python, JavaScript and integrations

Run the scraper from your own code with the [Apify API](https://docs.apify.com/api/v2) or an Apify client:

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

const client = new ApifyClient({ token: 'MY-APIFY-TOKEN' });
const run = await client.actor('socialscrapers/facebook-comments-scraper').call({
    startUrls: [{ url: 'https://www.facebook.com/reel/1056346190744779/' }],
    maxCommentsPerPost: 200,
    includeReplies: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

```python
from apify_client import ApifyClient

client = ApifyClient("MY-APIFY-TOKEN")
run = client.actor("socialscrapers/facebook-comments-scraper").call(
    run_input={"startUrls": [{"url": "https://www.facebook.com/reel/1056346190744779/"}], "maxCommentsPerPost": 200}
)
for comment in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(comment["authorName"], comment["text"])
```

- **Schedules**: collect new comments every day with an Apify schedule and `onlyCommentsNewerThan: "1 day"`.
- **Integrations**: send comments to Google Sheets, Slack, Airtable, Make, Zapier or n8n, or trigger your own webhook when a run finishes.
- **AI agents**: call the scraper as a tool through the Apify MCP server.

### Limits

- **What a logged-out visitor sees.** The scraper never logs in, so it reads the comments Facebook shows anyone who is not signed in. Comments on posts shared only with friends, and on posts in private groups, are not available.
- **"Most relevant" leaves comments out.** Facebook's default order hides some comments; choose *All comments* or *Newest first* to get them all.
- **Commenter ids.** For many people Facebook shows logged-out visitors a token instead of the numeric profile id, and no profile link; `authorId` is then that token.
- **Counts can differ slightly** from what you see logged in, as Facebook counts hidden and removed comments differently.
- **Residential proxy required.** Facebook rarely serves data-center IP addresses, so keep the default Apify Proxy `RESIDENTIAL` setting.
- **Picture links expire.** Profile picture URLs point to Facebook's CDN, which expires links after a while.

### FAQ

#### Is it legal to scrape Facebook comments?

This scraper only reads public comments, the way Facebook shows them to anyone who isn't logged in. You are responsible for using the data lawfully. Comments include people's names, pictures and words, which are personal data under laws such as the GDPR (EU) and the CCPA (California), so collect only what you need for a legitimate purpose. Apify explains the basics in [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

#### Do I need a Facebook account or cookies?

No. Facebook Comments Scraper reads only what Facebook shows to visitors who are not logged in, so no account of yours is ever at risk.

#### How many comments can I get from one post?

All the comments Facebook lists for it, thousands for a popular post. Set **Max comments per post** to `0` for every one of them, and turn on **Include replies** for the replies.

#### Which links can I use?

Links to posts (`facebook.com/<page>/posts/…`, `permalink.php?story_fbid=…`, `story.php?story_fbid=…`), reels (`facebook.com/reel/…`), videos (`facebook.com/<page>/videos/…`, `facebook.com/watch/?v=…`), photos (`facebook.com/photo/?fbid=…`) and posts in public groups (`facebook.com/groups/<group>/posts/…`), and share links from the Facebook app. A link to a Page or profile itself is not a post: to get the comments of a Page's latest posts, use [Facebook Posts Scraper](https://apify.com/socialscrapers/facebook-profile-posts-scraper) to list the posts first.

#### Why did a post give fewer comments than Facebook shows, or none?

The post may be private, deleted, shared only with friends or in a private group; Facebook may count comments it hides from logged-out visitors; or *Most relevant* order left some out. The run still ends **Succeeded**, its status message says which posts gave nothing, and nothing is charged for them.

If the input has nothing the scraper can use (no links, or only links that are not posts, such as a Page's own link), the run ends **Succeeded** right away with a status message that starts "Nothing to scrape:" and says what to change; no results are charged. A run ends **Failed** only when Facebook refused every one of 3 or more posts and the comments of a well-known public post are refused too, because that means the scraper itself is being blocked right now.

#### How do I get only new comments?

Set **Only comments newer than** to an age such as `1 day`, and schedule the run daily. Comments are then read newest first, and reading stops at the limit.

#### Can I get the replies to a specific comment?

Turn on **Include replies**: each reply comes right after the comment it answers, with `parentCommentId` set to that comment's id.

### Other scrapers by Social Scrapers

| Scraper | What it gets |
| --- | --- |
| [TikTok API](https://apify.com/socialscrapers/tiktok-api) | Profiles, Videos and Comments |
| [TikTok Comments Scraper](https://apify.com/socialscrapers/tiktok-comments-scraper) | Comments, Replies and Likes |
| [TikTok Hashtag Scraper](https://apify.com/socialscrapers/tiktok-hashtag-scraper) | Top Videos, Views and Likes |
| [TikTok Profile Scraper](https://apify.com/socialscrapers/tiktok-profile-scraper) | Followers, Bio, Stats and Videos |
| [TikTok Scraper](https://apify.com/socialscrapers/tiktok-scraper) | Videos, Profiles, Hashtags and Comments |
| [TikTok Sound Scraper](https://apify.com/socialscrapers/tiktok-sound-scraper) | Videos Using a Sound and Music Info |
| [TikTok Video Scraper](https://apify.com/socialscrapers/tiktok-video-scraper) | Views, Likes, Captions and Comments |
| [Instagram API](https://apify.com/socialscrapers/instagram-api) | Profiles, Posts, Reels, Comments and Hashtags |
| [Instagram Comments Scraper](https://apify.com/socialscrapers/instagram-comments-scraper) | Comments, Likes and Reply Counts |
| [Instagram Hashtag Scraper](https://apify.com/socialscrapers/instagram-hashtag-scraper) | Reels and Keyword Search |
| [Instagram Post Details Scraper](https://apify.com/socialscrapers/instagram-post-details-scraper) | Likes, Comments, Views and Media |
| [Instagram Post Scraper](https://apify.com/socialscrapers/instagram-post-scraper) | Posts, Reels and Comments |
| [Instagram Profile Scraper](https://apify.com/socialscrapers/instagram-profile-scraper) | Followers, Bio, Posts and Reels |
| [Instagram Reels Scraper](https://apify.com/socialscrapers/instagram-reels-scraper) | Reels, Plays, Likes and Comments |
| [Instagram Reels Transcript Scraper](https://apify.com/socialscrapers/instagram-reels-transcript-scraper) | Speech to Text and Captions |
| [Instagram Scraper](https://apify.com/socialscrapers/instagram-scraper) | Posts, Profiles, Reels, Comments and Hashtags |
| [YouTube API](https://apify.com/socialscrapers/youtube-api) | Videos, Transcripts, Search, Channels and Comments |
| [YouTube Channel Scraper](https://apify.com/socialscrapers/youtube-channel-scraper) | Videos, Shorts, Subscribers and About |
| [YouTube Comments Scraper](https://apify.com/socialscrapers/youtube-comments-scraper) | Comments, Replies and Likes |
| [YouTube Scraper](https://apify.com/socialscrapers/youtube-scraper) | Videos, Shorts, Channels and Comments |
| [YouTube Search Scraper](https://apify.com/socialscrapers/youtube-search-scraper) | Videos, Channels, Views and Filters |
| [YouTube Shorts Scraper](https://apify.com/socialscrapers/youtube-shorts-scraper) | Shorts, Views, Likes and Search |
| [YouTube Transcript Scraper](https://apify.com/socialscrapers/youtube-transcript-scraper) | Subtitles, Captions and SRT |
| [YouTube Video Details Scraper](https://apify.com/socialscrapers/youtube-video-details-scraper) | Stats, Subtitles and Comments |
| [Facebook Ads Library Scraper](https://apify.com/socialscrapers/facebook-ads-library-scraper) | Meta Ad Library and Spend |
| [Facebook Groups Scraper](https://apify.com/socialscrapers/facebook-groups-scraper) | Public Group Posts and Reactions |
| [Facebook Marketplace Scraper](https://apify.com/socialscrapers/facebook-marketplace-scraper) | Prices, Locations and Sellers |
| [Facebook Page Contact Info Scraper](https://apify.com/socialscrapers/facebook-page-contact-scraper) | Email, Phone and WhatsApp |
| [Facebook Posts Scraper](https://apify.com/socialscrapers/facebook-profile-posts-scraper) | Pages, Profiles and Timelines |
| [Facebook Pages Scraper](https://apify.com/socialscrapers/facebook-profile-scraper) | Profiles, Contact Info and Reviews |
| [Facebook Reels Scraper](https://apify.com/socialscrapers/facebook-reels-scraper) | Reels, Videos, Plays and Captions |
| [X (Twitter) Profile Scraper](https://apify.com/socialscrapers/x-profile-scraper) | Followers, Bio and Tweets |
| [X (Twitter) Tweet Scraper](https://apify.com/socialscrapers/x-tweet-scraper) | Latest Posts by Profile |
| [Threads Profile Scraper](https://apify.com/socialscrapers/threads-profile-scraper) | Followers, Bio, Links and Posts |
| [Threads Replies Scraper](https://apify.com/socialscrapers/threads-replies-scraper) | Comments, Authors, Likes and Media |
| [Threads Scraper](https://apify.com/socialscrapers/threads-scraper) | Posts, Profiles, Replies and Search |
| [Threads Search Scraper](https://apify.com/socialscrapers/threads-search-scraper) | Keywords, Hashtags, Top and Recent Posts |
| [Reddit Comments Scraper](https://apify.com/socialscrapers/reddit-comments-scraper) | Threads, Replies, Votes and Authors |
| [Reddit Scraper](https://apify.com/socialscrapers/reddit-scraper) | Posts, Comments, Subreddits, Users and Search |
| [Reddit Search Scraper](https://apify.com/socialscrapers/reddit-search-scraper) | Posts by Keyword, Subreddit and Date |
| [Reddit User Scraper](https://apify.com/socialscrapers/reddit-user-scraper) | Profiles, Karma, Posts and Comments |
| [Subreddit Scraper](https://apify.com/socialscrapers/subreddit-scraper) | Hot, New and Top Posts with Comments |
| [Quora Scraper](https://apify.com/socialscrapers/quora-scraper) | Answers, Questions, Profiles and Topic Search |
| [LinkedIn Ad Library Scraper](https://apify.com/socialscrapers/linkedin-ad-library-scraper) | Ads, Advertisers and Impressions |
| [LinkedIn Job Search Scraper](https://apify.com/socialscrapers/linkedin-job-search-scraper) | Filters, Salaries and New Jobs |
| [LinkedIn Jobs Scraper](https://apify.com/socialscrapers/linkedin-jobs-scraper) | Job Listings, Salaries and Companies |
| [Google Maps Email Extractor](https://apify.com/socialscrapers/google-maps-email-extractor) | Emails, Phones and Social Links |
| [Google Maps Scraper](https://apify.com/socialscrapers/google-maps-scraper) | Places, Phones, Websites, Ratings and Hours |
| [Google News Scraper](https://apify.com/socialscrapers/google-news-scraper) | Headlines, Articles and Search |
| [Google Ads Transparency Scraper](https://apify.com/socialscrapers/google-ads-transparency-scraper) | Ad Creatives and Advertisers |
| [Amazon Product Scraper](https://apify.com/socialscrapers/amazon-product-scraper) | Search Results, Prices, Ratings, ASINs |
| [Indeed Jobs Scraper](https://apify.com/socialscrapers/indeed-jobs-scraper) | Salaries, Full Descriptions, Company Data |
| [Contact Details Scraper](https://apify.com/socialscrapers/contact-details-scraper) | Emails, Phones and Social Links |
| [Telegram Channel Scraper](https://apify.com/socialscrapers/telegram-channel-scraper) | Posts, Views and Media |
| [Doximity Scraper](https://apify.com/socialscrapers/doximity-physician-scraper) | Physician Profiles and Doctor Directory |
| [KevinMD Scraper](https://apify.com/socialscrapers/kevinmd-articles-scraper) | Physician Articles and Author Specialties |
| [Op-Med Scraper](https://apify.com/socialscrapers/opmed-articles-scraper) | Physician Essays and Doctor Profiles |
| [Career Site Jobs Scraper](https://apify.com/socialscrapers/career-site-jobs-scraper) | Greenhouse, Lever, Ashby and Workday |
| [Google Trends Scraper](https://apify.com/socialscrapers/google-trends-scraper) | Interest Over Time, Regions and Queries |

# Actor input Schema

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

Links to public posts, reels, videos or photos, from Pages, profiles or public groups: https://www.facebook.com/NASA/posts/pfbid…, https://www.facebook.com/reel/1056346190744779/, https://www.facebook.com/watch/?v=…, https://www.facebook.com/groups/<group>/posts/<id>/, permalink.php and photo links. Share links (https://www.facebook.com/share/p/…, fb.watch/…) work too. To get a post's link, click its date and copy the address.

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

How many comments (and replies, when they are on) to save per post, for example 100. 0 = every comment Facebook lists. You pay per comment saved.

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

Also save the replies to each comment (and the replies to those), each as its own row right after the comment it answers, with parentCommentId. Replies count towards the maximum per post and are charged like comments.

## `commentsSortOrder` (type: `string`):

The order Facebook lists the comments in, as in its comment menu. "All comments" lists every comment; "Newest" every comment, newest first; "Most relevant" is Facebook's default, which leaves some comments out.

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

Keep only comments written on or after this date; reading stops once Facebook lists older ones (comments are then read newest first). Pick a date or an age, or type one: 2026-01-31, 31/01/2026, Jan 31 2026, or 7 days, 2w, 3 months, yesterday. Dates are UTC days. Leave empty for no date limit.

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

Keep Apify Proxy with the RESIDENTIAL group (the default). Facebook does not show comments to visitors from datacenter IPs. Apify Proxy without the RESIDENTIAL group, or no proxy at all on Apify, is switched to RESIDENTIAL (your country is kept); residential traffic is included in the price.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/NASA/posts/pfbid02hrXYVBCzSCcWhneqiiSCfZDXpDPaEFQWAeWV8KvYBmrgVT2ch5JmL7aj4MTqVHexl"
    }
  ],
  "maxCommentsPerPost": 20,
  "includeReplies": false,
  "commentsSortOrder": "all",
  "onlyCommentsNewerThan": "7 days",
  "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 = {
    "startUrls": [
        {
            "url": "https://www.facebook.com/NASA/posts/pfbid02hrXYVBCzSCcWhneqiiSCfZDXpDPaEFQWAeWV8KvYBmrgVT2ch5JmL7aj4MTqVHexl"
        }
    ],
    "maxCommentsPerPost": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("socialscrapers/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": [{ "url": "https://www.facebook.com/NASA/posts/pfbid02hrXYVBCzSCcWhneqiiSCfZDXpDPaEFQWAeWV8KvYBmrgVT2ch5JmL7aj4MTqVHexl" }],
    "maxCommentsPerPost": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

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