# Facebook Groups Scraper (`apify/facebook-groups-scraper`) Actor

Extract data from one or multiple public Facebook groups. Get group and post URLs, post text, comments, timestamp, likes and comments count, and basic commentator info. Download the data in JSON, CSV, and Excel and use it in apps, spreadsheets, and reports.

- **URL**: https://apify.com/apify/facebook-groups-scraper.md
- **Developed by:** [Apify](https://apify.com/apify) (Apify)
- **Categories:** Social media
- **Stats:** 31,010 total users, 3,894 monthly users, 100.0% runs succeeded, 416 bookmarks
- **User rating**: 4.76 out of 5 stars

## Pricing

from $2.60 / 1,000 posts

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 Groups Scraper?

It's a simple but powerful Facebook data extractor that allows you to scrape posts and comments from public Facebook groups. To get that data, just insert the group URL and click "Save & Start" button. With this Facebook scraper tool, you can extract valuable group data beyond the limitations of the Facebook API:

🗂 Scrape multiple Facebook groups **at once**

📝 Extract **key post data from any public Facebook group**: caption, URLs, IDs, authors, timestamps, top comments, and their details

💙 Get top engagement metrics such as **likes, top reactions, reaction breakdowns, shares, and comments count**

⚙️ Get posts pre-sorted before scraping by relevance, time frame, activity, or keyword

🖼 Access all media assets with thumbnails, image URLs, profile pic URLs, dimensions, and OCR text for deeper analysis

⚡ Get **500 posts for free** in less than 2 minutes

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

💾 Export Facebook data in **JSON, CSV, Excel, or HTML**

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

🔍 Explore 20+ **other [Facebook scraping tools](#what-is-the-best-facebook-scraper)**

Add this Facebook Group Extractor to your social media toolkit to help you out with identifying engagement patterns, measuring sentiment, and tracking engagement. Our users already use the extracted groups data to analyze member interactions to discover popular topics, top contributors, and post performance.

### What Facebook group data can I extract?

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

<table>
<tr>
<td>📝 Post text and URL</td>
<td>👥 User name and ID</td>
</tr>
<tr>
<td>🕐 Post timestamp</td>
<td>👍 Likes, reactions, and shares count</td>
</tr>
<tr>
<td>💬 Comments count and top comments</td>
<td>📎 Attachments (photos, videos, links)</td>
</tr>
<tr>
<td>🆔 Post ID and Feedback ID</td>
<td>🔗 Group URL and title</td>
</tr>
<tr>
<td>🖼 Media URLs, thumbnails, and dimensions</td>
<td>📸 Image OCR text</td>
</tr>
<tr>
<td>💭 Comment details (text, author, likes)</td>
<td>🔢 Reaction breakdowns (like, love, haha, etc.)</td>
</tr>
</table>

> 💡 **Tip:** Need to scrape more comments from Facebook Groups? Try our 🔗 [Facebook Comments Scraper](https://apify.com/apify/facebook-comments-scraper). Just add post URLs (for example, the ones you'd scraped with Facebook Groups Scraper) and get all comments, replies, likes, and basic commentator info.

### How do I use Facebook Groups Scraper?

Facebook Groups Scraper was designed to be easy to start with even if you've never extracted data from the web before. Here's how you can scrape Facebook groups data with this tool:

1. [Create](https://console.apify.com/sign-up) a free Apify account using your email.
1. Open [Facebook Groups Scraper](https://apify.com/apify/facebook-groups-scraper).
1. Choose Facebook Group URLs to scrape posts from and number of posts to scrape.
1. Choose additional filters: sorting order (new posts, newest activity, or most relevant), search options or timeframe of posts.
1. Click "Start" and wait for the data to be extracted.
1. Download your data in JSON, XML, CSV, Excel, or HTML.

For a step-by-step guide on how to scrape Facebook Groups, follow our [Facebook Groups Scraper tutorial](https://blog.apify.com/scrape-facebook-groups-data/) 📝 or watch the [video tutorial](https://www.youtube.com/watch?v=xoIc7_T7AHg).

https://www.youtube.com/watch?v=xoIc7_T7AHg

### ➡️ Input

The input for Facebook Groups Scraper should be Facebook Group URLs such as `https://www.facebook.com/groups/groupname/`. You can insert the group URLs one by one, paste a prepared list, or set the input via API. The groups must be public.

<a href="https://console.apify.com/actors/2chN8UQcH1CfxLRNE">
<img src="https://github.com/apify-projects/actor-readme-images/blob/master/Facebook%20groups%20input.png?raw=true" alt="Facebook group scraping input" style="width:70%;">
</a>

Click on the [input tab](https://apify.com/apify/facebook-groups-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 **Output** tab. Here's an excerpt from the dataset you'd get when scraping a Facebook group:

<a href="https://console.apify.com/actors/2chN8UQcH1CfxLRNE">
<img src="https://github.com/apify-projects/actor-readme-images/blob/master/Facebook%20groups%20output.png?raw=true" alt="Facebook group scraping output" style="width:70%;">
</a>

#### 📘 Extracted Facebook group posts sample

```javascript
[
    {
        facebookUrl: 'https://www.facebook.com/groups/webscrapingandautomation',
        url: 'https://www.facebook.com/groups/webscrapingandautomation/permalink/1223750702961359/',
        time: '2025-12-10T04:37:15.000Z',
        user: {
            id: '******',
            name: '******',
        },
        text: 'Need Web products data scraper',
        topReactionsCount: 2,
        feedbackId: 'ZmVlZGJhY2s6MTIyMzc1MDcwMjk2MTM1OQ==',
        reactionLikeCount: 10,
        reactionLoveCount: 2,
        id: 'UzpfSTEwMDA4NjE1NTM5NjkyOTpWSzoxMjIzNzUwNzAyOTYxMzU5',
        legacyId: '1223750702961359',
        likesCount: 12,
        sharesCount: 0,
        commentsCount: 34,
        topComments: [
            {
                commentUrl:
                    'https://www.facebook.com/groups/webscrapingandautomation/permalink/1223750702961359/?comment_id=1223751619627934',
                id: 'Y29tbWVudDoxMjIzNzUwNzAyOTYxMzU5XzEyMjM3NTE2MTk2Mjc5MzQ=',
                feedbackId: 'ZmVlZGJhY2s6MTIyMzc1MDcwMjk2MTM1OV8xMjIzNzUxNjE5NjI3OTM0',
                date: '2025-12-10T04:38:44.000Z',
                text: 'Available here for scraping',
                profileUrl: 'https://www.facebook.com/******',
                profilePicture: 'https://scontent-atl3-3.xx.fbcdn.net/v/t39.30808-1/******',
                profileId: '******',
                profileName: '******',
                likesCount: '1',
                threadingDepth: 0,
            },
            {
                commentUrl:
                    'https://www.facebook.com/groups/webscrapingandautomation/permalink/1223750702961359/?comment_id=1223835609619535',
                id: 'Y29tbWVudDoxMjIzNzUwNzAyOTYxMzU5XzEyMjM4MzU2MDk2MTk1MzU=',
                feedbackId: 'ZmVlZGJhY2s6MTIyMzc1MDcwMjk2MTM1OV8xMjIzODM1NjA5NjE5NTM1',
                date: '2025-12-10T07:45:18.000Z',
                text: 'Text me',
                profilePicture: 'https://scontent-atl3-2.xx.fbcdn.net/v/t39.30808-1/******',
                profileId: '******',
                profileName: '******',
                likesCount: '0',
                threadingDepth: 0,
            },
        ],
        facebookId: '******',
        groupTitle: '******',
        inputUrl: 'https://www.facebook.com/groups/webscrapingandautomation',
    },
    {
        facebookUrl: 'https://www.facebook.com/groups/selftaughtprogrammers/',
        url: 'https://www.facebook.com/groups/selftaughtprogrammers/permalink/2616394328724285/',
        time: '2025-12-09T18:20:41.000Z',
        user: {
            id: '******',
            name: '******',
        },
        text: "So I Just Started Programming, understand Basics in depth I started with C ++ as It is In My 1st Semester I gave my mids but I have seen some Ppl who get a job after 1st semester or 2nd So it possible for me? If I Give around 50 to 6 hours Daily? But I have a problem I can't figure Which field should I choose like I started learning ml took a course but then I saw That job opportunities and internships weren't too much as compare to web\nAnd same issue with Cyber security.I don't Want to Get exposure of other fields cuz I don't have much time as My parents can't afford my Semester fees So Only option I have left is odd job.And that is a dangerous path I think,bcz I have seen so Many ppl who did odd jobs to Pay there semester fee they did manage to pay there fee hit When they Graduated They were not some kind of prodigy And they couldn't really understand this field cuz Most of there time was being invested in odd job.Sp They Either teach programming in schools or Do irrelevant jobs. What should I do?  I have around 6 months how do I utilize These 6 months to become prodigy level in whatever field I choose and hwo should I decide Which field to choose?",
        topReactionsCount: 1,
        feedbackId: 'ZmVlZGJhY2s6MjYxNjM5NDMyODcyNDI4NQ==',
        reactionLikeCount: 1,
        id: 'UzpfSTExODg5ODQ3NzAwNTE4MTM6Vks6MjYxNjM5NDMyODcyNDI4NQ==',
        legacyId: '2616394328724285',
        likesCount: 1,
        sharesCount: 0,
        commentsCount: 0,
        topComments: [],
        facebookId: '387875758242831',
        groupTitle: 'Self-Taught Programmers',
        inputUrl: 'https://www.facebook.com/groups/selftaughtprogrammers/',
    },
    {
        facebookUrl: 'https://www.facebook.com/groups/dataminers',
        url: 'https://www.facebook.com/groups/dataminers/permalink/2160479344361035/',
        time: '2025-11-21T00:00:05.000Z',
        user: {
            id: '******',
            name: '******',
        },
        text: 'I want web scraper',
        topReactionsCount: 1,
        feedbackId: 'ZmVlZGJhY2s6MjE2MDQ3OTM0NDM2MTAzNQ==',
        reactionLikeCount: 5,
        id: 'UzpfSTEzNjk4ODI4OTY6Vks6MjE2MDQ3OTM0NDM2MTAzNQ==',
        legacyId: '2160479344361035',
        likesCount: 5,
        sharesCount: 0,
        commentsCount: 20,
        topComments: [
            {
                commentUrl:
                    'https://www.facebook.com/groups/dataminers/permalink/2160479344361035/?comment_id=2162023090873327',
                id: 'Y29tbWVudDoyMTYwNDc5MzQ0MzYxMDM1XzIxNjIwMjMwOTA4NzMzMjc=',
                feedbackId: 'ZmVlZGJhY2s6MjE2MDQ3OTM0NDM2MTAzNV8yMTYyMDIzMDkwODczMzI3',
                date: '2025-11-21T07:26:01.000Z',
                text: 'You post and never reply \n\nDM me',
                profileUrl: 'https://www.facebook.com/******',
                profilePicture: 'https://scontent-mia3-1.xx.fbcdn.net/v/t1.30497-1/******',
                profileId: '******',
                profileName: '******',
                likesCount: '0',
                threadingDepth: 0,
            },
            {
                commentUrl:
                    'https://www.facebook.com/groups/dataminers/permalink/2160479344361035/?comment_id=2162516160824020',
                id: 'Y29tbWVudDoyMTYwNDc5MzQ0MzYxMDM1XzIxNjI1MTYxNjA4MjQwMjA=',
                feedbackId: 'ZmVlZGJhY2s6MjE2MDQ3OTM0NDM2MTAzNV8yMTYyNTE2MTYwODI0MDIw',
                date: '2025-11-21T20:06:48.000Z',
                text: "I'm interested!",
                profileUrl: 'https://www.facebook.com/******',
                profilePicture: 'https://scontent-mia3-2.xx.fbcdn.net/v/t39.30808-1/******',
                profileId: '******',
                profileName: '******',
                likesCount: '0',
                threadingDepth: 0,
            },
        ],
        facebookId: '536969943378658',
        groupTitle: 'Web Scraping World',
        pageAdLibrary: {
            is_business_page_active: false,
            id: '664799263393118',
        },
        inputUrl: 'https://www.facebook.com/groups/dataminers',
    },
];
````

You can choose in which format to download your Facebook data: JSON, JSONL, Excel spreadsheet, HTML table, CSV, or XML.

### How much will scraping Facebook Groups cost you?

Scraping data from Facebook groups costs approximately $5 for every 1,000 posts, or $0.005 per post. If you're on Apify Free plan, you will be able to scrape up to 1000 posts before needing to upgrade.

For more frequent or extensive Facebook data scraping, consider upgrading to the $29/month [Starter plan](https://apify.com/pricing), which can get you up to 5,800 Facebook group posts per month. For scalable Facebook group scraping, check out $199/month Scale or $999/month Business plan.

### What is the best Facebook scraper?

You can use the dedicated scrapers below if you want to scrape specific Facebook data. Each of them is built particularly for the relevant Facebook scraping case be it posts, pages, comments or search. Feel free to browse them:

<table>
<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-pages-scraper">Facebook Pages Scraper</a></td>
</tr>
<tr>
<td>🕹 <a href="https://apify.com/apify/facebook-games-scraper">Facebook Games Scraper</a></td>
<td>👀 <a href="https://apify.com/apify/facebook-marketplace-scraper">Facebook Marketplace 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-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/facebook-video-search-scraper">Facebook Video Search Scraper</a></td>
</tr>
<tr>
<td>💬 <a href="https://apify.com/apify/facebook-comments-scraper">Facebook Comments 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-photos-scraper">Facebook Photos Scraper</a></td>
<td>🔮 <a href="https://apify.com/apify/brand-collaboration-scraper">Brand Collaboration Scraper</a></td>
<td>👥 <a href="https://apify.com/apify/facebook-followers-following-scraper">Facebook Followers Following Scraper</a></td>
</tr>
<tr>
<td>🛍️ <a href="https://apify.com/apify/facebook-ads-scraper">Facebook Ads Library Scraper</a></td>
<td>📱 <a href="https://apify.com/apify/facebook-page-contact-information">Facebook Pages Info Scraper</a></td>
<td>🧲 <a href="https://apify.com/apify/social-media-leads-analyzer">Social Media Leads Analyzer</a></td>
</tr>
</table>

### ❓ FAQ

#### What's the difference between a public and a private Facebook group?

A public Facebook group is a group that is visible to anyone on Facebook and anyone can join without needing to be approved by an administrator. Posts made in a public group are also visible to anyone on Facebook. A private Facebook group is a group that is not visible to the general public and only members who have been approved by an administrator can see the group and its posts.

This Facebook Groups Scraper only works with public groups. Private group scraping would require login credentials, which goes against Facebook's Terms of Service.

#### Can I export Facebook Groups 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). Apify API is organized around RESTful HTTP endpoints that enable you to manage, schedule, and run Apify Actors. The API also lets you access any datasets, monitor actor performance, fetch results, create and update versions, and more. To access the API using Node.js, use the `apify-client` [NPM package](https://apify.com/apify/facebook-groups-scraper/api/javascript). To access the API using Python, use the `apify-client` [PyPI package](https://apify.com/apify/facebook-groups-scraper/api/python).

Click on the [API tab](https://apify.com/apify/facebook-groups-scraper/api) for code examples or check out the [Apify API reference docs](https://docs.apify.com/api/v2) for full detail.

#### Can I use Facebook Groups Scraper through an MCP server?

With Apify API, you can use Facebook Groups Scraper within your AI workflows. You can connect to the [MCP server](https://apify.com/apify/facebook-groups-scraper/api/mcp) using clients like ClaudeDesktop and LibreChat or build your own. Here's how you can set up Facebook Groups Scraper via Model Context Protocol (MCP) server:

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 Groups Scraper with the provided input.
4. The response should be: `Accepted`.

This makes Facebook Groups Scraper compatible with facebook mcp server implementations and allows you to use it as a facebook data extractor within your AI agent workflows.

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

You need proxies in general but you don't need to do anything extra to apply them if you run the scraper on the Apify platform. For successful Facebook scraping, we run [residential proxies](https://apify.com/proxy?pricing=residential-ip#pricing) in the background which are included in Apify's monthly Starter plan ($29).

#### Can I integrate data from Facebook Groups Scraper with other apps?

Yes. Facebook Groups Scraper can be connected with almost any cloud service or web app thanks to [integrations on the Apify platform](https://apify.com/integrations). You can integrate with Make, Zapier, ChatGPT, Slack, Airbyte, GitHub, Google Sheets, Asana, Google Drive, Keboola, MCP Servers, and more.

You can also use [webhooks](https://docs.apify.com/integrations/webhooks) to carry out an action whenever an event occurs, e.g., get a notification whenever Facebook Groups Scraper successfully finishes a run.

#### Is it legal to scrape Facebook Groups data?

Our [Facebook scrapers](https://apify.com/store/categories?search=facebook\&managedBy=APIFY) are ethical and do not extract any private user data. They only extract what the user has chosen to share publicly. However, you should be aware that your results could contain personal data. You should not scrape personal data unless you have a legitimate reason to do so.

If you're unsure whether your reason is legitimate, consult your lawyers. You can also read our blog post on the [legality of 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 Groups Scraper not working?

We're always working on improving the performance of our Actors. So if you've got any technical feedback for Facebook Groups Scraper or simply found a bug, please create an issue on the Actor's [Issues tab](https://apify.com/apify/facebook-groups-scraper/issues/open).

# Actor input Schema

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

Insert a URL of a valid Facebook group. Only <strong>public</strong> Facebook groups can be scraped.

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

Select the number of posts you want to scrape. If this limit is not set, as many results as possible will be returned.

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

Select sorting order by which the posts should be scraped. Please note that the <strong>Number of results</strong> field will be applied to New posts only. The BuySell items sorting will return results for BuySell groups only.

## `searchGroupKeyword` (type: `string`):

Without logging in, search results are VERY limited, so searching by word will return nothing in most cases. To get more messages, it is recommended to use a one or two letter search and change the year.

## `searchGroupYear` (type: `string`):

The scraper will extract Facebook posts by this year. To use this field, you need to fill in the <strong>Search by letter</strong> field above ↑.

## `onlyPostsNewerThan` (type: `string`):

Scrapes post from the provided date to the present day. The date should be in YYYY-MM-DD or full ISO absolute format or in relative format e.g. 1 days, 2 months, 3 years. The JSON input also supports adding time units (UTC timezone): Full or partial ISO timestamp (e.g., `2025-09-23T10:02:01`) as absolute time and relative time, e.g., `1 hour` or `2 minutes`.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/groups/874728723021553"
    }
  ],
  "resultsLimit": 20,
  "viewOption": "CHRONOLOGICAL",
  "searchGroupKeyword": "a",
  "searchGroupYear": "2024",
  "onlyPostsNewerThan": "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/groups/874728723021553"
        }
    ],
    "resultsLimit": 20,
    "viewOption": "CHRONOLOGICAL"
};

// Run the Actor and wait for it to finish
const run = await client.actor("apify/facebook-groups-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/groups/874728723021553" }],
    "resultsLimit": 20,
    "viewOption": "CHRONOLOGICAL",
}

# Run the Actor and wait for it to finish
run = client.actor("apify/facebook-groups-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/groups/874728723021553"
    }
  ],
  "resultsLimit": 20,
  "viewOption": "CHRONOLOGICAL"
}' |
apify call apify/facebook-groups-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Groups Scraper",
        "description": "Extract data from one or multiple public Facebook groups. Get group and post URLs, post text, comments, timestamp, likes and comments count, and basic commentator info. Download the data in JSON, CSV, and Excel and use it in apps, spreadsheets, and reports.",
        "version": "0.0",
        "x-build-id": "ZcWAuM0KgtHaeTT2b"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/apify~facebook-groups-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-apify-facebook-groups-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-groups-scraper/runs": {
            "post": {
                "operationId": "runs-sync-apify-facebook-groups-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-groups-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-apify-facebook-groups-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 group URLs",
                        "type": "array",
                        "description": "Insert a URL of a valid Facebook group. Only <strong>public</strong> Facebook groups can be scraped.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "resultsLimit": {
                        "title": "✍️ Number of posts",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Select the number of posts you want to scrape. If this limit is not set, as many results as possible will be returned."
                    },
                    "viewOption": {
                        "title": "📜 Sorting order",
                        "enum": [
                            "CHRONOLOGICAL",
                            "RECENT_ACTIVITY",
                            "TOP_POSTS",
                            "CHRONOLOGICAL_LISTINGS"
                        ],
                        "type": "string",
                        "description": "Select sorting order by which the posts should be scraped. Please note that the <strong>Number of results</strong> field will be applied to New posts only. The BuySell items sorting will return results for BuySell groups only.",
                        "default": "CHRONOLOGICAL"
                    },
                    "searchGroupKeyword": {
                        "title": "Search by letter (words are allowed, but will not return any results in most cases)",
                        "type": "string",
                        "description": "Without logging in, search results are VERY limited, so searching by word will return nothing in most cases. To get more messages, it is recommended to use a one or two letter search and change the year."
                    },
                    "searchGroupYear": {
                        "title": "🗓 Search keyword by year",
                        "type": "string",
                        "description": "The scraper will extract Facebook posts by this year. To use this field, you need to fill in the <strong>Search by letter</strong> field above ↑."
                    },
                    "onlyPostsNewerThan": {
                        "title": "Posts 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": "Scrapes post from the provided date to the present day. The date should be in YYYY-MM-DD or full ISO absolute format or in relative format e.g. 1 days, 2 months, 3 years. The JSON input also supports adding time units (UTC timezone): Full or partial ISO timestamp (e.g., `2025-09-23T10:02:01`) as absolute time and relative time, e.g., `1 hour` or `2 minutes`."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
