# Facebook Group Scraper - Posts, Comments & Reactions (`whoareyouanas/facebook-group-scraper`) Actor

Scrape posts from public & private Facebook groups. Extract post text, author info, reactions, comments, shares, images, videos, and group metadata. Cookie auth for private groups. Clean JSON/CSV output. No API key needed.

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

## Pricing

from $5.00 / 1,000 post scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/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

## Facebook Group Scraper - Posts, Comments & Members

Scrape posts, comments, reactions, and group metadata from public and private Facebook groups. Supports cookie-based authentication for private group access.

### What does this scraper do?

This scraper extracts data from Facebook Groups including:

- **Posts** — text content, timestamps, author info, media attachments
- **Reactions** — like, love, haha, wow, sad, angry counts
- **Comments** — top comments with author info
- **Group metadata** — name, member count, description, privacy, admins
- **Media** — images and video URLs from posts

Supports both public and private groups (with cookie authentication).

### Features

- Scrape posts from any Facebook group URL
- Full reaction breakdown (not just total count)
- Top comments extraction per post
- Group metadata (name, members, description, privacy)
- Cookie-based auth for private groups you're a member of
- Date filtering — only scrape posts newer than a specific date
- Sort by Recent Activity, Top Posts, or Chronological
- Streaming output — partial results saved even if scraper times out
- Memory-efficient scroll loop with cleanup (handles groups with 10K+ posts)
- Residential proxy support (Apify + external)

### How much does it cost?

| Volume | Price |
|--------|-------|
| Per post scraped | ~$0.003 |
| 1,000 posts | ~$3.00 |
| 10,000 posts | ~$30.00 |

Platform compute costs are separate.

### Input

#### Public group (may require cookies)

```json
{
    "startUrls": [{"url": "https://www.facebook.com/groups/1280379818654162"}],
    "maxPosts": 100,
    "includeComments": true,
    "includeGroupInfo": true
}
````

#### Private group (requires cookies)

```json
{
    "startUrls": [{"url": "https://www.facebook.com/groups/YOUR_PRIVATE_GROUP"}],
    "maxPosts": 50,
    "cookies": [
        {"name": "c_user", "value": "YOUR_C_USER_VALUE"},
        {"name": "xs", "value": "YOUR_XS_VALUE"}
    ]
}
```

#### How to get cookies

1. Open Facebook in your browser and log in
2. Press **F12** to open Developer Tools
3. Go to **Application** tab (Chrome) or **Storage** tab (Firefox)
4. Click **Cookies** > **facebook.com**
5. Find and copy the values of `c_user` and `xs`
6. Paste them into the `cookies` input field

### Output

```json
{
    "postId": "1234567890",
    "postUrl": "https://www.facebook.com/groups/123456/permalink/1234567890/",
    "groupName": "Web Scraping & Automation",
    "groupUrl": "https://www.facebook.com/groups/123456",
    "authorName": "John Doe",
    "authorProfileUrl": "https://www.facebook.com/johndoe",
    "text": "Has anyone tried using Playwright for Facebook scraping?",
    "postType": "text",
    "timestamp": "2026-03-28T14:30:00.000Z",
    "formattedDate": "2h",
    "totalReactions": 42,
    "commentsCount": 15,
    "sharesCount": 3,
    "images": [],
    "videos": [],
    "topComments": [
        {
            "authorName": "Jane Smith",
            "text": "Yes! Works great with stealth plugin."
        }
    ],
    "source": "facebook_group",
    "scrapeDate": "2026-03-28T16:00:00.000Z"
}
```

### Tips

1. **Cookies are usually required** — Facebook gates most group content behind login, even for public groups. Always provide cookies for reliable results.
2. **Use residential proxies** — Facebook blocks datacenter IPs aggressively. Apify Residential proxy recommended.
3. **Start small** — Test with `maxPosts: 10` first, then scale up.
4. **Cookie expiry** — Facebook cookies last ~365 days but can be invalidated by security events. Re-export if scraping stops working.
5. **Rate limiting** — The scraper uses human-like delays. Don't increase concurrency above 2.

### Why use this over competitors?

| Feature | Apify Official (24K users) | Ours |
|---------|---------------------------|------|
| Posts | Yes | Yes |
| Group metadata | No | **Yes** |
| Reaction breakdown | Partial (like + love only) | **Full** (6 types) |
| Comments with author info | Top comments only, no names | **Top comments with names** |
| Cookie auth for private groups | No | **Yes** |
| Post type detection | No | **Yes** (text/photo/video/link) |
| Images/videos | No | **Yes** |
| Memory-efficient scrolling | Basic | **Advanced** (cleanup every 20 iterations) |
| Streaming (crash recovery) | No | **Yes** |
| Price per 1K posts | ~$5.00 | **~$3.00** |

### Other scrapers you might like

- [Meta (Facebook) Ad Library Scraper](https://apify.com/whoareyouanas/meta-ad-scraper)
- [TikTok Ad Library & Creative Center Scraper](https://apify.com/whoareyouanas/tiktok-ad-scraper)
- [Google Ads Transparency Center Scraper](https://apify.com/whoareyouanas/google-ads-transparency-scraper)

### Legal disclaimer

This scraper accesses publicly available data from Facebook. For private groups, users must be authorized members and provide their own authentication cookies. Users are responsible for ensuring their use complies with all applicable laws, Facebook's Terms of Service, and data protection regulations (GDPR, etc.).

# Actor input Schema

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

URLs of Facebook groups to scrape. Each URL should point to a Facebook group (e.g. https://www.facebook.com/groups/123456789).

## `maxPosts` (type: `integer`):

Maximum number of posts to scrape per group. The scraper will stop scrolling once this limit is reached. Set to a lower value for faster runs.

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

How posts should be sorted when scraping the group feed.

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

Only scrape posts published after this date. Use ISO 8601 format (e.g. 2024-01-01 or 2024-06-15T00:00:00Z). Leave empty to scrape all posts up to maxPosts limit.

## `includeComments` (type: `boolean`):

Whether to scrape top-level comments for each post. Enabling this will increase run time but provides richer data.

## `includeGroupInfo` (type: `boolean`):

Whether to scrape group metadata (name, description, member count, privacy status, admins, rules, etc.). Useful for group analysis and research.

## `cookies` (type: `array`):

Paste your Facebook cookies as a JSON array to access private/closed groups. You need at minimum the 'c\_user' and 'xs' cookies from your browser. Export cookies using a browser extension like 'EditThisCookie' or 'Cookie-Editor' and paste the JSON array here.

## `maxConcurrency` (type: `integer`):

Number of browser tabs to run in parallel. Keep at 1 for stability. Increase to 2-3 only if you need faster scraping and have sufficient memory. Higher values increase memory usage.

## `requestHandlerTimeoutSecs` (type: `integer`):

Maximum time in seconds to spend scraping a single group page. Groups with many posts need longer timeouts. Default of 600 seconds (10 minutes) handles most groups.

## `proxyUrl` (type: `string`):

Add your Apify Proxy URL for reliable scraping. Format: http://groups-RESIDENTIAL:YOUR\_APIFY\_TOKEN@proxy.apify.com:8000. Get your token from Apify Console. External proxies (BrightData, Oxylabs) also work.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/groups/1280379818654162"
    }
  ],
  "maxPosts": 100,
  "viewOption": "RECENT_ACTIVITY",
  "includeComments": true,
  "includeGroupInfo": true,
  "maxConcurrency": 1,
  "requestHandlerTimeoutSecs": 600
}
```

# Actor output Schema

## `overview` (type: `string`):

Overview of all scraped posts with key metrics and details

## `allPosts` (type: `string`):

Complete dataset with all fields including metadata, comments, and media

# 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/1280379818654162"
        }
    ],
    "maxPosts": 100,
    "maxConcurrency": 1,
    "requestHandlerTimeoutSecs": 600
};

// Run the Actor and wait for it to finish
const run = await client.actor("whoareyouanas/facebook-group-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/1280379818654162" }],
    "maxPosts": 100,
    "maxConcurrency": 1,
    "requestHandlerTimeoutSecs": 600,
}

# Run the Actor and wait for it to finish
run = client.actor("whoareyouanas/facebook-group-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/1280379818654162"
    }
  ],
  "maxPosts": 100,
  "maxConcurrency": 1,
  "requestHandlerTimeoutSecs": 600
}' |
apify call whoareyouanas/facebook-group-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Group Scraper - Posts, Comments & Reactions",
        "description": "Scrape posts from public & private Facebook groups. Extract post text, author info, reactions, comments, shares, images, videos, and group metadata. Cookie auth for private groups. Clean JSON/CSV output. No API key needed.",
        "version": "0.0",
        "x-build-id": "6pMnHdGcaP4oXuIfc"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/whoareyouanas~facebook-group-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-whoareyouanas-facebook-group-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/whoareyouanas~facebook-group-scraper/runs": {
            "post": {
                "operationId": "runs-sync-whoareyouanas-facebook-group-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/whoareyouanas~facebook-group-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-whoareyouanas-facebook-group-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": "Group URLs",
                        "type": "array",
                        "description": "URLs of Facebook groups to scrape. Each URL should point to a Facebook group (e.g. https://www.facebook.com/groups/123456789).",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL",
                                    "description": "Facebook group URL (e.g. https://www.facebook.com/groups/123456789)",
                                    "pattern": "^https?://(www\\.)?facebook\\.com/groups/.*$"
                                }
                            }
                        }
                    },
                    "maxPosts": {
                        "title": "Max Posts",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of posts to scrape per group. The scraper will stop scrolling once this limit is reached. Set to a lower value for faster runs.",
                        "default": 100
                    },
                    "viewOption": {
                        "title": "Post View / Sort Order",
                        "enum": [
                            "RECENT_ACTIVITY",
                            "TOP_POSTS",
                            "CHRONOLOGICAL"
                        ],
                        "type": "string",
                        "description": "How posts should be sorted when scraping the group feed.",
                        "default": "RECENT_ACTIVITY"
                    },
                    "onlyPostsNewerThan": {
                        "title": "Only Posts Newer Than",
                        "type": "string",
                        "description": "Only scrape posts published after this date. Use ISO 8601 format (e.g. 2024-01-01 or 2024-06-15T00:00:00Z). Leave empty to scrape all posts up to maxPosts limit."
                    },
                    "includeComments": {
                        "title": "Include Comments",
                        "type": "boolean",
                        "description": "Whether to scrape top-level comments for each post. Enabling this will increase run time but provides richer data.",
                        "default": true
                    },
                    "includeGroupInfo": {
                        "title": "Include Group Info",
                        "type": "boolean",
                        "description": "Whether to scrape group metadata (name, description, member count, privacy status, admins, rules, etc.). Useful for group analysis and research.",
                        "default": true
                    },
                    "cookies": {
                        "title": "Facebook Cookies (for Private Groups)",
                        "type": "array",
                        "description": "Paste your Facebook cookies as a JSON array to access private/closed groups. You need at minimum the 'c_user' and 'xs' cookies from your browser. Export cookies using a browser extension like 'EditThisCookie' or 'Cookie-Editor' and paste the JSON array here."
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrency",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Number of browser tabs to run in parallel. Keep at 1 for stability. Increase to 2-3 only if you need faster scraping and have sufficient memory. Higher values increase memory usage.",
                        "default": 1
                    },
                    "requestHandlerTimeoutSecs": {
                        "title": "Page Timeout (seconds)",
                        "minimum": 60,
                        "maximum": 1200,
                        "type": "integer",
                        "description": "Maximum time in seconds to spend scraping a single group page. Groups with many posts need longer timeouts. Default of 600 seconds (10 minutes) handles most groups.",
                        "default": 600
                    },
                    "proxyUrl": {
                        "title": "Your Proxy URL",
                        "type": "string",
                        "description": "Add your Apify Proxy URL for reliable scraping. Format: http://groups-RESIDENTIAL:YOUR_APIFY_TOKEN@proxy.apify.com:8000. Get your token from Apify Console. External proxies (BrightData, Oxylabs) also work."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
