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

Facebook Group Scraper SD - Facebook Group Scraper is a social media data tool that extracts posts of public Facebook groups: text, author, date, reactions by type, comments, shares, photos, videos and links, plus group details (members, privacy, rules, admins), no login.

- **URL**: https://apify.com/neuro-scraper/facebook-groups-scraper.md
- **Developed by:** [Neuro Scraper](https://apify.com/neuro-scraper) (community)
- **Categories:** Social media, Lead generation
- **Security:** Limited permissions
- **Stats:** 3 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Facebook Group Scraper - posts and details of public groups

Facebook Group Scraper exports the posts of public Facebook groups without logging in: post text,
author, date, reactions (total and per type), comments and shares counts, photos, videos, shared
links and, if you want, the comments themselves. Two more modes return the group details (members,
privacy, visibility, description, created date, admins, moderators, rules) or the group's events.
Export to JSON, CSV or Excel, or plug it into the Apify API, webhooks, Make, Zapier, n8n or Google
Sheets.

#### How it works

A public group's page preloads its discussion feed (the first post and the cursor) together with the
session values. The Actor reads them, then follows Facebook's own group-feed pagination query; its id,
variable list and provider values are read from the page and its JavaScript bundles on every run.
The details mode reads the group's /about page the same way, the events mode its /events page
(upcoming events first, then past events, each with Facebook's own pagination query).

#### Input

| Field | What it does |
|---|---|
| `startUrls` | Group URLs (www or m.), vanity names or numeric group ids |
| `mode` | `posts`, `about` (one row of group details per group) or `events` |
| `maxItems` | Max posts (or events) per group (default 20) |
| `sortOrder` | `CHRONOLOGICAL` (new posts), `RECENT_ACTIVITY`, `TOP_POSTS`, `CHRONOLOGICAL_LISTINGS` |
| `onlyPostsNewerThan` / `onlyPostsOlderThan` | Date window (`2026-09-01`, ISO, `7 days`); stops early with new-posts order |
| `keywords` | Keep only posts containing any of these words |
| `maxComments`, `commentsSort`, `maxRepliesPerComment` | Attach comments and replies |
| `privacyMode` | Include, hash or omit the author fields |
| `downloadImages` | Store post photos in the key-value store |
| `onlyNewPosts` | Skip posts delivered in earlier runs (monitoring) |
| `maxPagesPerGroup`, `maxTotalItems`, `proxyConfiguration` | Safety stop, total limit and proxy (RESIDENTIAL by default) |

#### Output

Posts mode: `postId`, `storyId`, `feedbackId`, `url`, `text`, `time`, `timestamp`, `postFormat`,
`authorName`, `authorId`, `authorUrl`, `authorProfilePictureUrl`, `reactionsCount`,
`reactionLikeCount` ... `reactionAngryCount`, `commentsCount`, `sharesCount`, `viewsCount`, `media[]`,
`imageUrls[]`, `videoUrls[]`, `linkUrl`, `linkTitle`, `linkDescription`, `sharedPost`, `hashtags`,
`mentions`, `comments[]`, `imageFiles[]`, `groupId`, `groupName`, `groupUrl`, `groupPrivacy`,
`groupMembersText`, `groupMembersCount`, `sortOrder`, `inputUrl`, `scrapedAt`.

About mode: `groupId`, `groupName`, `groupUrl`, `vanity`, `privacy`, `privacyDescription`,
`visibility`, `visibilityDescription`, `membersText`, `membersCount`, `description`, `historyText`,
`createdDate`, `adminsAndModeratorsText`, `adminsCount`, `admins[]`, `moderators[]`, `rules[]`,
`hasMembershipQuestions`, `aboutItems[]`, `themeColor`, `coverPhotoUrl`.

Events mode: `eventId`, `name`, `url`, `timeText` (Facebook's date text, e.g. "Fri, 5 Dec 2025"),
`isPast`, `section` (upcoming / past), `eventKind`, `creatorName`, `creatorId`, `coverPhotoUrl`,
`groupId`, `groupName`, `groupUrl`.

#### Measured limits (local runs, 2026-10-03, see TEST_REPORT.md)

- Only PUBLIC groups: a private group preloads no feed logged out (reported in the log); its details
  (members, rules, created date) are still available in `about` mode when the group is visible.
- 3 posts per request whatever page size is asked: 118 posts from 40 requests in 90 s, still more.
- Member counts are Facebook's rounded text ("17.1K members", "5.5M members").
- Events: 3 per request; "Maths Formulas" 8 past events across 2 requests. The upcoming lists of the
  measured groups were empty, so upcoming events are implemented the same way but not yet seen with data.
- Group member lists are not available logged out (the /members page preloads nothing).
- Group searches by keyword need login (`/search` answers 404).

#### Example

```json
{"startUrls": ["https://www.facebook.com/groups/874728723021553", "uscitizenshipwithugo"],
 "maxItems": 100, "sortOrder": "CHRONOLOGICAL", "onlyPostsNewerThan": "7 days", "maxComments": 10}
```

# Actor input Schema

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

Group URLs (www or m.), vanity names or numeric group ids, one per line. Only PUBLIC groups can be read without logging in.

## `mode` (type: `string`):

Posts of the group, its details (description, members, privacy, visibility, created date, admins, moderators, rules), or its events.

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

Facebook returns 3 posts per request logged out (measured).

## `sortOrder` (type: `string`):

The group's own sorting options.

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

Keep posts published on or after this date: 2026-09-01, a full ISO time, or a relative period such as "7 days", "2 weeks", "3 months", "1 year". Empty = no limit.

## `onlyPostsOlderThan` (type: `string`):

Keep posts published on or before this date (same formats). Empty = no limit.

## `keywords` (type: `array`):

Keep only posts whose text contains any of these words (one per line).

## `maxComments` (type: `integer`):

Also read up to this many public comments of every post and attach them as "comments". Each comment page is one extra request (about 10 comments per request).

## `commentsSort` (type: `string`):

Order of the comments Facebook returns.

## `maxRepliesPerComment` (type: `integer`):

Also read replies of each comment (nested under "replies").

## `privacyMode` (type: `string`):

How post authors appear in the output.

## `downloadImages` (type: `boolean`):

Save every post photo into the key-value store and add the file links.

## `onlyNewPosts` (type: `boolean`):

Remember delivered post ids (named key-value store "facebook-group-scraper-state") and skip them in later runs - for monitoring a group.

## `maxPagesPerGroup` (type: `integer`):

Safety stop (3 posts per page).

## `maxTotalItems` (type: `integer`):

Stops the whole run after this many dataset rows (all inputs together).

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

Facebook limits logged-out visitors per IP address. Residential proxies (the default) give the most reliable results; the Actor switches to a fresh IP when Facebook refuses one.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.facebook.com/groups/359370103235663/"
  ],
  "mode": "posts",
  "maxItems": 20,
  "sortOrder": "CHRONOLOGICAL",
  "maxComments": 0,
  "commentsSort": "relevant",
  "maxRepliesPerComment": 0,
  "privacyMode": "include",
  "downloadImages": false,
  "onlyNewPosts": false,
  "maxPagesPerGroup": 2000,
  "maxTotalItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

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

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        "https://www.facebook.com/groups/359370103235663/"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/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": ["https://www.facebook.com/groups/359370103235663/"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

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

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

```

## CLI example

```bash
echo '{
  "startUrls": [
    "https://www.facebook.com/groups/359370103235663/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call neuro-scraper/facebook-groups-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,neuro-scraper/facebook-groups-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/by8vBEtMIUftto9FF/builds/GwynxdZ1oS1YGaIxD/openapi.json
