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

Extract data from hundreds of Facebook comments from one or multiple Facebook posts. Get comment text, timestamp, likes count and basic commenter info. Download the data in JSON, CSV, Excel and use it in apps, spreadsheets, and reports.

- **URL**: https://apify.com/apify/facebook-comments-scraper.md
- **Developed by:** [Apify](https://apify.com/apify) (Apify)
- **Categories:** Social media
- **Stats:** 32,858 total users, 2,858 monthly users, 99.9% runs succeeded, 380 bookmarks
- **User rating**: 4.68 out of 5 stars

## Pricing

from $1.40 / 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/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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

### What is Facebook Comments Scraper?

Facebook Comments Scraper is a simple but powerful tool that lets you **extract comments from Facebook posts, videos, posts with images, and reels**. Just **paste in a post URL and click "Save & Start"**. Unlike the limited Facebook API, this scraper gives you access to **publicly visible comments** in bulk:

❖ Scrape thousands of Facebook **comments from a post, photo, reel, and video**

❖ Extract **comment text, replies, likes count, timestamp**, and more

❖ Extract **basic public profile info** of the comment author

❖ Presort comments based on **sorting type** (newest, most relevant, all), filter out comments based on timeframe

❖ Get **2,000 comments for free** in less than 2 minutes

❖ **No limitations** on requests or number of calls

❖ Export to **JSON, CSV, Excel, or HTML**

❖ Export via SDKs (Python & Node.js), use **API Endpoints**, webhooks, or integrate with apps & AI workflows

❖ Combine with **20+ other [Facebook scraping tools](https://apify.com/store/collections/facebook-scrapers)**

### What Facebook comments data can I extract?

With this Facebook API, you will be able to extract the following data from Facebook posts:

<table>
  <tr>
  <td>📝 Post title</td>
  <td>🔗 Post URL</td>
  </tr>
  <tr>
  <td>💬 Comment text and URL</td>
  <td>⌨️  Replies count</td>
  </tr>
  <tr>
  <td>🧛 Commenter name and profile ID</td>
  <td>🖼 Profile picture</td>
  </tr>
  <tr>
  <td>🕐 Timestamp</td>
  <td>👍 Likes count</td>
  </tr>
  <tr>
  <td>🙋 Replier's name</td>
  <td>🧵 Threading depth</td>
  </tr>
  <tr>
  <td>🆔 Post, Comment, Facebook ID</td>
  <td>🛍️  Ad Library activity status</td>
  </tr>
  </table>

### How do I use Facebook Comments Scraper?

Facebook Comments Scraper was built to work even if you’ve never scraped data before. Here’s how to get started:

1. [Create](https://console.apify.com/sign-up) a free Apify account.
2. Open [Facebook Comments Scraper](https://apify.com/apify/facebook-comments-scraper).
3. Paste in one or more Facebook **post URLs**.
4. Choose the **number** of comments and **replies** to scrape.
5. Choose the way the comments are **sorted** (most relevant, newest, or non-filtered)
6. Click "Start" to begin the scrape.
7. Download your results as JSON, CSV, Excel, HTML, or use the API.

If you want a walkthrough, check out our [step-by-step tutorial](https://blog.apify.com/scrape-facebook-comments-data/) 🔗.

### ⬇️ Input

The input for Facebook Comments Scraper should be **Facebook post URLs** **(reels, videos, posts with images, or regular posts)**. Paste them manually, import a list, or set up your own input via API.

<a href="https://console.apify.com/actors/us5srxAYnsrkgUv2v">
<img src="https://raw.githubusercontent.com/apify-projects/actor-readme-images/refs/heads/master/Facebook%20comments%20scraper.png" alt="Facebook comments scraping input" style="width:70%;">
</a>

Click on the [input tab](https://apify.com/apify/facebook-comments-scraper/input-schema) for a full explanation of an input example in JSON.

### ⬆️ Output

The results will be wrapped into a dataset which you can find in the **Storage** tab. Here's an excerpt from the dataset you'd get if you apply the input parameters above:

<a href="https://console.apify.com/actors/us5srxAYnsrkgUv2v">
<img src="https://raw.githubusercontent.com/apify-projects/actor-readme-images/refs/heads/master/Facebook%20comments%20scraped.png" alt="Facebook comments scraping output" style="width:90%;">
</a>

#### 💬 **Extracted Facebook comments & replies sample**

```json
[
    {
        "facebookUrl": "https://www.facebook.com/humansofnewyork/posts/pfbid0tpbAbjJiWV4otqtTkJg94rfM6MceLwQDAyHc2nphpF57nJz72sja8PU9DXQTk6iYl",
        "commentUrl": "https://www.facebook.com/humansofnewyork/posts/pfbid0tpbAbjJiWV4otqtTkJg94rfM6MceLwQDAyHc2nphpF57nJz72sja8PU9DXQTk6iYl?comment_id=883254471472572",
        "commentId": "883254471472572",
        "id": "Y29tbWVudDoxNDU4OTI0Mzg5MTMxODc5Xzg4MzI1NDQ3MTQ3MjU3Mg==",
        "feedbackId": "ZmVlZGJhY2s6MTQ1ODkyNDM4OTEzMTg3OV84ODMyNTQ0NzE0NzI1NzI=",
        "date": "2026-06-05T04:06:45.000Z",
        "text": "You're beautiful! 27 is young. Don't be in a hurry. Dating sites prob aren't the answer!",
        "profilePicture": "https://scontent-atl3-3.xx.fbcdn.net/v/t39.30808-1/464862567_1308754820535790_5748858663920029356_n.jpg?stp=cp0_dst-jpg_tt6&cstp=mx720x730&ctp=s32x32&_nc_cat=109&ccb=1-7&_nc_sid=e99d92&_nc_ohc=lTUbrprb5fUQ7kNvwGCPbX4&_nc_oc=Adqz_11UgWazzeluG-rh33nxZ3xrhlsA9nyQn2c13pbp7nmRr4hY5y-SBTay892Dp8o&_nc_zt=24&_nc_ht=scontent-atl3-3.xx&_nc_gid=sDahnKaxNXx_2cdrHGhHSA&_nc_ss=7c289&oh=00_Af9Yiohg9QT50jB2sW7OjOtnZU46HxAcF6Xsv5oM4YqkOw&oe=6A3097CC",
        "profileId": "pfbid02hfdQq8zmFdeQYj7ZNN7qkKumDyyndD8QhF7zd4eGoLFgzB6JfTdXFeiW5i61kJhcl",
        "profileName": "Laurie DeHarte",
        "likesCount": "0",
        "threadingDepth": 0,
        "facebookId": "1458924389131879",
        "postTitle": "“I’ve been on forty first dates over the course of three years. And that’s not counting the hundred conversations on dating apps that didn’t go anywhere. So yeah— I thought meeting someone would be a little easier than this. Maybe the city is just a difficult place to date, or maybe it’s just how the apps are designed, but it’s a pretty cold environment, pretty emotionless. People don’t seem to put much emotion into the way they put themselves out there. There’s a lot of ghosting. It happens most often before you even get to the date. You’ll be trying to set something up, and the person falls off. But there are times when the date does happen, and you’ll think it went well, but when you follow up a few days later there’s no response. People seem to have this mentality that if they’ve just met someone online, they don’t owe them anything. And I agree with that to some extent. But I think you owe people the common decency to reject them. I don’t think it’s difficult to say: ‘I’m not interested.’ One time I’d been dating someone for a month-and-a-half. We’d just spent a weekend together in New Jersey, but when I texted him the next day he didn't respond ever again. Maybe I’m just too sensitive. A lot of people seem to be able to say: ‘If the person ghosted me, then they weren’t for me.’  But I end up feeling like I'm not interesting enough, or that there's something missing with me that people can sense, and that's why it never goes anywhere deeper. Maybe that’s my low self-esteem coming out. Maybe if I had higher self-esteem I wouldn’t take ghosting so badly. I’m still only 27, but I’m losing hope of actually finding someone. I'm so fed up with the interactions I’m having that I don't want to put myself out there as much. People keep disappointing me. So it’s like: ‘Is it really worth my peace to keep interacting with people?’ But I feel like I have to keep doing it. Because if I stop, then I'll get into this head space where I don't want to put myself out there again.’”",
        "pageAdLibrary": {
            "is_business_page_active": false,
            "id": "102099916530784"
        },
        "inputUrl": "https://www.facebook.com/humansofnewyork/posts/pfbid0tpbAbjJiWV4otqtTkJg94rfM6MceLwQDAyHc2nphpF57nJz72sja8PU9DXQTk6iYl"
    },
    {
        "facebookUrl": "https://www.facebook.com/humansofnewyork/posts/pfbid0tpbAbjJiWV4otqtTkJg94rfM6MceLwQDAyHc2nphpF57nJz72sja8PU9DXQTk6iYl",
        "commentUrl": "https://www.facebook.com/humansofnewyork/posts/pfbid0tpbAbjJiWV4otqtTkJg94rfM6MceLwQDAyHc2nphpF57nJz72sja8PU9DXQTk6iYl?comment_id=2089407168274372",
        "commentId": "2089407168274372",
        "id": "Y29tbWVudDoxNDU4OTI0Mzg5MTMxODc5XzIwODk0MDcxNjgyNzQzNzI=",
        "feedbackId": "ZmVlZGJhY2s6MTQ1ODkyNDM4OTEzMTg3OV8yMDg5NDA3MTY4Mjc0Mzcy",
        "date": "2026-05-31T01:10:09.000Z",
        "text": "Being hurt by ghosting doesn't make you sensitive it makes you human. The world needs more people who are honest about their feelings and respectful of others emotions",
        "profileUrl": "https://www.facebook.com/aichia.chung",
        "profilePicture": "https://scontent-atl3-1.xx.fbcdn.net/v/t39.30808-1/710723135_26951122931197054_7103138006659037278_n.jpg?stp=c0.455.1034.1035a_cp0_dst-jpg_tt6&cstp=mx1034x1035&ctp=s32x32&_nc_cat=106&ccb=1-7&_nc_sid=e99d92&_nc_ohc=YCvFfcCgHmQQ7kNvwEyh4it&_nc_oc=AdoAtv4VMfUuayk0FtueYhrF7OVWHY6C4TGVI2oh3PFX8V1LtrgomWC9D0-mEW0uVYY&_nc_zt=24&_nc_ht=scontent-atl3-1.xx&_nc_gid=sDahnKaxNXx_2cdrHGhHSA&_nc_ss=7c289&oh=00_Af8xZ_x6eG5cKJ7_NTZK4Vxk261uQtCLZzqfc9SpwBmq8w&oe=6A307AB1",
        "profileId": "pfbid02UXES35YzTyQorvGeaVBDtac9ELRiSXuuFrrcsiqRM2wGDSJELEEimKg3zaHbpWTkl",
        "profileName": "Meera Rajput",
        "likesCount": "0",
        "threadingDepth": 0,
        "facebookId": "1458924389131879",
        "postTitle": "“I’ve been on forty first dates over the course of three years. And that’s not counting the hundred conversations on dating apps that didn’t go anywhere. So yeah— I thought meeting someone would be a little easier than this. Maybe the city is just a difficult place to date, or maybe it’s just how the apps are designed, but it’s a pretty cold environment, pretty emotionless. People don’t seem to put much emotion into the way they put themselves out there. There’s a lot of ghosting. It happens most often before you even get to the date. You’ll be trying to set something up, and the person falls off. But there are times when the date does happen, and you’ll think it went well, but when you follow up a few days later there’s no response. People seem to have this mentality that if they’ve just met someone online, they don’t owe them anything. And I agree with that to some extent. But I think you owe people the common decency to reject them. I don’t think it’s difficult to say: ‘I’m not interested.’ One time I’d been dating someone for a month-and-a-half. We’d just spent a weekend together in New Jersey, but when I texted him the next day he didn't respond ever again. Maybe I’m just too sensitive. A lot of people seem to be able to say: ‘If the person ghosted me, then they weren’t for me.’  But I end up feeling like I'm not interesting enough, or that there's something missing with me that people can sense, and that's why it never goes anywhere deeper. Maybe that’s my low self-esteem coming out. Maybe if I had higher self-esteem I wouldn’t take ghosting so badly. I’m still only 27, but I’m losing hope of actually finding someone. I'm so fed up with the interactions I’m having that I don't want to put myself out there as much. People keep disappointing me. So it’s like: ‘Is it really worth my peace to keep interacting with people?’ But I feel like I have to keep doing it. Because if I stop, then I'll get into this head space where I don't want to put myself out there again.’”",
        "pageAdLibrary": {
            "is_business_page_active": false,
            "id": "102099916530784"
        },
        "inputUrl": "https://www.facebook.com/humansofnewyork/posts/pfbid0tpbAbjJiWV4otqtTkJg94rfM6MceLwQDAyHc2nphpF57nJz72sja8PU9DXQTk6iYl"
    },
    {
        "facebookUrl": "https://www.facebook.com/humansofnewyork/posts/pfbid0tpbAbjJiWV4otqtTkJg94rfM6MceLwQDAyHc2nphpF57nJz72sja8PU9DXQTk6iYl",
        "commentUrl": "https://www.facebook.com/humansofnewyork/posts/pfbid0tpbAbjJiWV4otqtTkJg94rfM6MceLwQDAyHc2nphpF57nJz72sja8PU9DXQTk6iYl?comment_id=26766913429643643",
        "commentId": "26766913429643643",
        "id": "Y29tbWVudDoxNDU4OTI0Mzg5MTMxODc5XzI2NzY2OTEzNDI5NjQzNjQz",
        "feedbackId": "ZmVlZGJhY2s6MTQ1ODkyNDM4OTEzMTg3OV8yNjc2NjkxMzQyOTY0MzY0Mw==",
        "date": "2026-05-17T03:18:02.000Z",
        "text": "Is sad but if you can do not spend a weekend with anybody in any place.Give yourself a little.more respect.You look like a very nice and good woman.Spend time not looking.Wait until God found your perfect match.Let us know if this have good results😘",
        "profileUrl": "https://www.facebook.com/lourdes.quintero.77582",
        "profilePicture": "https://scontent-atl3-2.xx.fbcdn.net/v/t39.30808-1/673859884_2061771258091941_7418303018882414017_n.jpg?stp=cp0_dst-jpg_tt6&cstp=mx2048x2042&ctp=s32x32&_nc_cat=102&ccb=1-7&_nc_sid=e99d92&_nc_ohc=qVL-SG8Juq4Q7kNvwHqGg9D&_nc_oc=Adrmb7UQw112l1CHjOuQksQH8cBKPxcKPxo0W2-v8xrteg7tk59SBpldLwixslJe8Ng&_nc_zt=24&_nc_ht=scontent-atl3-2.xx&_nc_gid=sDahnKaxNXx_2cdrHGhHSA&_nc_ss=7c289&oh=00_Af8JCxomSixpkFo7MJhglp8h025ZO_zC9wNsYuiihzQRLw&oe=6A307364",
        "profileId": "pfbid0auM5GNtTyzpmc7SRX2cb3HMCmn8T8u5ujdWtwWvBx2gJMCadFPDk8WQuyFigWPfRl",
        "profileName": "Lourdes Quintero",
        "likesCount": "0",
        "threadingDepth": 0,
        "facebookId": "1458924389131879",
        "postTitle": "“I’ve been on forty first dates over the course of three years. And that’s not counting the hundred conversations on dating apps that didn’t go anywhere. So yeah— I thought meeting someone would be a little easier than this. Maybe the city is just a difficult place to date, or maybe it’s just how the apps are designed, but it’s a pretty cold environment, pretty emotionless. People don’t seem to put much emotion into the way they put themselves out there. There’s a lot of ghosting. It happens most often before you even get to the date. You’ll be trying to set something up, and the person falls off. But there are times when the date does happen, and you’ll think it went well, but when you follow up a few days later there’s no response. People seem to have this mentality that if they’ve just met someone online, they don’t owe them anything. And I agree with that to some extent. But I think you owe people the common decency to reject them. I don’t think it’s difficult to say: ‘I’m not interested.’ One time I’d been dating someone for a month-and-a-half. We’d just spent a weekend together in New Jersey, but when I texted him the next day he didn't respond ever again. Maybe I’m just too sensitive. A lot of people seem to be able to say: ‘If the person ghosted me, then they weren’t for me.’  But I end up feeling like I'm not interesting enough, or that there's something missing with me that people can sense, and that's why it never goes anywhere deeper. Maybe that’s my low self-esteem coming out. Maybe if I had higher self-esteem I wouldn’t take ghosting so badly. I’m still only 27, but I’m losing hope of actually finding someone. I'm so fed up with the interactions I’m having that I don't want to put myself out there as much. People keep disappointing me. So it’s like: ‘Is it really worth my peace to keep interacting with people?’ But I feel like I have to keep doing it. Because if I stop, then I'll get into this head space where I don't want to put myself out there again.’”",
        "pageAdLibrary": {
            "is_business_page_active": false,
            "id": "102099916530784"
        },
        "inputUrl": "https://www.facebook.com/humansofnewyork/posts/pfbid0tpbAbjJiWV4otqtTkJg94rfM6MceLwQDAyHc2nphpF57nJz72sja8PU9DXQTk6iYl"
    }
]
````

You can export this data in JSON, JSONL, CSV, XML, Excel, or HTML.

### How many comments can it scrape?

You can expect to scrape **2,000–3,000 comments per post**, depending on the structure and visibility of the post. However, results vary due to:

- Post type (e.g. public post vs. private post)
- Facebook’s dynamic comment loading
- Pagination structure
- Geographic or login-based restrictions

The best way to know how much data you'll get is to **run a test scrape with your actual input**. More details on maximizing your scraping results in the ❓ [FAQ section](https://apify.com/apify/facebook-comments-scraper#faq).

### What is the best Facebook scraper?

Need to scrape more than comments? These tools are built for different scraping needs across Facebook:

<table>
<tr>
<td>🌟 <a href="https://apify.com/apify/facebook-reviews-scraper">Facebook Reviews Scraper</a></td>
<td>📝 <a href="https://apify.com/apify/facebook-posts-scraper">Facebook Posts Scraper</a></td>
<td>🔮 <a href="https://apify.com/apify/brand-collaboration-scraper">Brand Collaboration Scraper</a></td>
</tr>
<tr>
<td>📘 <a href="https://apify.com/apify/facebook-pages-scraper">Facebook Pages Scraper</a></td>
<td>👍 <a href="https://apify.com/apify/facebook-likes-scraper">Facebook Likes and Reactions Scraper</a></td>
<td>ℹ️ <a href="https://apify.com/apify/facebook-page-contact-information">Facebook Page Contact Information</a></td>
</tr>
<tr>
<td>🕵️‍♀️ <a href="https://apify.com/apify/facebook-search-scraper">Facebook Search Scraper</a></td>
<td>🗓 <a href="https://apify.com/apify/facebook-events-scraper">Facebook Events Scraper</a></td>
<td>👥 <a href="https://apify.com/apify/facebook-groups-scraper">Facebook Groups Scraper</a></td>
</tr>
<tr>
<td>👀 <a href="https://apify.com/apify/facebook-marketplace-scraper">Facebook Marketplace Scraper</a></td>
<td>🕹 <a href="https://apify.com/apify/facebook-games-scraper">Facebook Games Scraper</a></td>
<td>🎞 <a href="https://apify.com/apify/facebook-reels-scraper">Facebook Reels Scraper</a></td>
</tr>
<tr>
<td>👥 <a href="https://apify.com/apify/facebook-groups-scraper">Facebook Groups Scraper</a></td>
<td>🏞 <a href="https://apify.com/apify/facebook-photos-scraper">Facebook Photos Scraper</a></td>
<td>🛍️ <a href="https://apify.com/apify/facebook-ads-scraper">Facebook Ads Library Scraper</a></td>
</tr>
<tr>
<td>📹 <a href="https://apify.com/apify/facebook-video-search-scraper">Facebook Video Search Scraper</a></td>
<td>👩‍💻 <a href="https://apify.com/apify/facebook-followers-following-scraper">Facebook Followers&Following Scraper</a></td>
<td></td>
</tr>
</table>

### ❓ FAQ

#### Can I filter Facebook comments by date?

Yes. Use `onlyCommentsNewerThan` section to extract only comments newer than a selected date/time.

Supported formats:

- `YYYY-MM-DD`
- Full or partial ISO absolute timestamp (UTC)
- Relative values such as `1 day`, `2 months`, `3 years`, `1 hour`, or `2 minutes`

When `onlyCommentsNewerThan` is set, the scraper uses newest-first sorting (`RECENT_ACTIVITY`) so the filter works correctly.

#### Why do I see fewer comments than is seen on the Facebook post itself?

You might see fewer comments than what’s shown on the Facebook post itself because the **Actor only gets public comments**. If someone has **privacy settings** that hide their comments from the public, those won’t be scraped. Also, Facebook’s comment counter includes **both top-level comments and all replies**. So, especially on larger threads, it’s normal that the number of comments scraped is lower than the number shown by Facebook.

#### Why am I getting way more results than I had set in Results amount?

The **Results amount** limit covers **both comments and their replies**. The Actor can return up to 3 levels — comments, replies, and nested replies — so the total number of items can be higher than what you set.

#### How can I get the most comments possible using the Facebook Comments Scraper?

To maximize the number of comments scraped, make sure to enable replies (nested comments) and set sorting to "newest". Facebook’s total comment count includes public, private comments and replies, but the scraper can only access public ones. So if you’re seeing fewer results than the total shown, it’s likely due to private content you can’t scrape — not a bug or blocking issue.

#### Can the scraper get both public and private comments from Facebook, and what's the difference?

Yep, there *is* a difference! Public comments are visible to everyone and can be scraped. But if someone with a private profile leaves a comment, it might only be visible to their friends or followers—and not to the scraper. So if a post has 200 comments but the scraper only grabs 100, it’s likely the rest are from private accounts and can’t be accessed. We just assume those are private ones hiding in the shadows.

#### Can I use Facebook Comments Scraper through an MCP Server?

With Apify API, you can use 💬 Facebook Comments Scraper within your AI workflows. You can connect to the MCP Server using clients like ClaudeDesktop and LibreChat or build your own. Here's you can set up Facebook Scraper via Model Context Protocol (MCP) server, you should:

1. Start a Server-Sent Events (SSE) session to receive a `sessionId`.
2. Send API messages using that `sessionId` to trigger the scraper.
3. The message starts the 💬 Facebook Comments Scraper with the provided input.
4. The response should be: `Accepted`.

#### Can I integrate Facebook comments data with other apps?

Yes, Facebook Comments Scraper can be [integrated](https://apify.com/integrations) with most tools and services via the Apify platform:

- Zapier, Make, Slack, Airbyte, Google Sheets, Asana, GitHub, Keboola, and more
- MCP for your AI agents and workflows
- [Webhooks](https://docs.apify.com/integrations/webhooks) to trigger actions on scrape completion
- [Apify API](https://docs.apify.com/api/v2) for full automation

#### Is there a simpler way to get Facebook comments directly on Make?

We have a dedicated [Facebook scraping App on Make](make.com/en/integrations/apify-facebook-scraper) with a Facebook Comments module, so you don’t need to set up the full Apify integration. It has a regular input schema and a few templates to start from. All you need to set it up is to add your Apify API token.

#### Can I export Facebook comments data using API?

Yes, you can access the extracted Facebook data through the Apify API. You’ll need an Apify account and your API token (available under Integrations settings in Console). Use your Apify API token to:

- Schedule runs
- Trigger scrapes on demand
- Access datasets
- Monitor runs and logs

You can access the API from Console or use `apify-client` for [Python](https://apify.com/apify/facebook-comments-scraper/api/python) or [Node.js](https://apify.com/apify/facebook-comments-scraper/api/javascript). Click the [API tab](https://apify.com/apify/facebook-comments-scraper/api) for code snippets.

#### Do I need proxies to scrape data from Facebook comments?

Yes, Facebook requires proxies for stable scraping. The scraper runs on **Apify Proxy** with **residential IPs** automatically when used on the platform. You don’t need to configure anything. Residential proxies are included with the [Starter plan](https://apify.com/pricing) or higher.

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

Yes, as long as the data is **public**. Facebook Comments Scraper — and Apify's [Facebook scrapers](https://apify.com/store/categories?search=facebook\&managedBy=APIFY) in general — only extract publicly available comments. They don’t access private data like DMs or closed groups.

That said, scraped content may still contain personal data. If you plan to store, process, or reshare that data, make sure you have a legitimate legal basis. Read our take on [legal web scraping](https://blog.apify.com/is-web-scraping-legal/) and [ethical scraping](https://blog.apify.com/what-is-ethical-web-scraping-and-how-do-you-do-it/).

#### Facebook Comments Scraper not working

Got a feature request, question, or bug to report? Drop us a note on the [Issues tab](https://apify.com/apify/facebook-comments-scraper/issues/open) — someone from the Apify team will address it shortly.

# Actor input Schema

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

Valid facebook URL

## `resultsLimit` (type: `integer`):

If this limit is not set as many results as possible are returned

## `includeNestedComments` (type: `boolean`):

If checked, the actor will return up to 3 levels of comments/replies for each post. Note that each reply/comment will be returned as a separate result.

## `viewOption` (type: `string`):

Choose the way the comments are sorted

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

Limit how far back to the history the scraper should go. The date should be in YYYY-MM-DD or full ISO absolute format or in relative format e.g. 1 year, 2 months, 3 days, 4 hours, or 5 minutes. All time values are taken in UTC timezone. This <a href='https://apify.com/apify/facebook-comments-scraper/pricing' target='_blank' rel='noopener'>add-on feature</a> is billed separately.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl"
    }
  ],
  "resultsLimit": 50,
  "includeNestedComments": false,
  "viewOption": "RANKED_UNFILTERED",
  "onlyCommentsNewerThan": "2024-01-01"
}
```

# Actor output Schema

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

Dataset containing all scraped data

# 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/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl"
        }
    ],
    "resultsLimit": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("apify/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/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl" }],
    "resultsLimit": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("apify/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 '{
  "startUrls": [
    {
      "url": "https://www.facebook.com/humansofnewyork/posts/pfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl"
    }
  ],
  "resultsLimit": 50
}' |
apify call apify/facebook-comments-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Comments Scraper",
        "description": "Extract data from hundreds of Facebook comments from one or multiple Facebook posts. Get comment text, timestamp, likes count and basic commenter info. Download the data in JSON, CSV, Excel and use it in apps, spreadsheets, and reports.",
        "version": "0.0",
        "x-build-id": "VScRzKjvVTDTTevOw"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/apify~facebook-comments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-apify-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/apify~facebook-comments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-apify-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/apify~facebook-comments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-apify-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": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Facebook URLs",
                        "type": "array",
                        "description": "Valid facebook URL",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "resultsLimit": {
                        "title": "Results amount",
                        "minimum": 1,
                        "type": "integer",
                        "description": "If this limit is not set as many results as possible are returned"
                    },
                    "includeNestedComments": {
                        "title": "Include comment replies",
                        "type": "boolean",
                        "description": "If checked, the actor will return up to 3 levels of comments/replies for each post. Note that each reply/comment will be returned as a separate result.",
                        "default": false
                    },
                    "viewOption": {
                        "title": "Comments mode",
                        "enum": [
                            "RANKED_THREADED",
                            "RECENT_ACTIVITY",
                            "RANKED_UNFILTERED"
                        ],
                        "type": "string",
                        "description": "Choose the way the comments are sorted",
                        "default": "RANKED_UNFILTERED"
                    },
                    "onlyCommentsNewerThan": {
                        "title": "📅 Extract comments that are newer than",
                        "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])(T[0-2]\\d:[0-5]\\d(:[0-5]\\d)?(\\.\\d+)?Z?)?$|^(\\d+)\\s*(minute|hour|day|week|month|year)s?$",
                        "type": "string",
                        "description": "Limit how far back to the history the scraper should go. The date should be in YYYY-MM-DD or full ISO absolute format or in relative format e.g. 1 year, 2 months, 3 days, 4 hours, or 5 minutes. All time values are taken in UTC timezone. This <a href='https://apify.com/apify/facebook-comments-scraper/pricing' target='_blank' rel='noopener'>add-on feature</a> is billed separately."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
