# Facebook Group Feed & Engagement Extractor (`vexaloom-labs/facebook-group-feed-and-engagement-extractor`) Actor

Pull posts from any public Facebook group with full text, media, reaction breakdown, top comments and reshares, plus optional group member count, admins and rules.

- **URL**: https://apify.com/vexaloom-labs/facebook-group-feed-and-engagement-extractor.md
- **Developed by:** [vexaloom-labs](https://apify.com/vexaloom-labs) (community)
- **Categories:** Social media, Automation, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.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 Feed & Engagement Extractor

Collect public Facebook group posts as structured data: full text, author, timestamp, media, reaction breakdown, comment and share counts, top comments, reshares, and optional full comment threads. Add group profiles, paste individual post links, or monitor a group on a schedule — without logging in or supplying cookies.

### What this actor does

- **Scrape public group feeds** from a group URL, bare slug, or numeric group ID.
- **Scrape individual group posts** by pasting one or more post links.
- **Fetch full comment threads** with comment text, author, reactions, timestamps, and nested replies.
- **Include group profiles**: name where available, description, exact member count, creation date, privacy, rules, plus admins and tags when Facebook exposes them.
- **Work with private groups honestly**: their posts are not public, but their public profile data (description, member count, rules, privacy) is returned when group enrichment is enabled.
- **Four feed orders**: top posts, chronological, recent activity, and buy/sell listings.
- **Filter while collecting**: date range, keyword, and monitor mode for new posts only.
- **Handle mixed languages and formats**: English, Arabic, Vietnamese, and other group content is returned as written.
- **Omit empty fields** at every level — no nulls or blank placeholders.

### Output per post

| Field | Type | Description |
|---|---|---|
| `postId` | string | Facebook post ID |
| `id` | string | Facebook's internal post identifier |
| `permalinkUrl` | string | Direct link to the post |
| `groupId` | string | Group ID |
| `groupUrl` | string | Group URL |
| `text` | string | Full post text |
| `postType` | string | `text`, `photo`, `video`, `link`, or `share` |
| `hashtags` | array | Hashtag links found in the post |
| `mentions` | array | Mentioned profiles or pages, when present |
| `externalLinks` | array | Clean destination links found in the post |
| `creationTime` | integer | Unix timestamp |
| `authorId` | string | Post author ID |
| `authorName` | string | Post author name |
| `authorUrl` | string | Author profile URL; a profile.php fallback is flagged |
| `authorUrlIsFallback` | boolean | `true` when the author URL was built from the numeric ID |
| `attachments` | array | Photos/videos with direct media URLs, dimensions and image captions |
| `reactionsTotal` | integer | Total reactions |
| `reactionBreakdown` | array | Reactions by type (Like, Love, Care, Haha, Wow, Sad, Angry) |
| `commentsCount` | integer | Total comments including replies |
| `commentsVisible` | integer | Comments visible without a login, when a full thread is fetched |
| `comments` | array | Full comment thread, when enabled; each comment can include `replies` |
| `sharesCount` | integer | Share count |
| `topComments` | array | Inline top comments with author, reactions and reply count |
| `sharedPost` | object | Original post details when this post is a reshare |
| `group` | object | Group profile data when enrichment is enabled |
| `inputUrl` | string | The input URL that produced this record |
| `scrapedAt` | string | ISO 8601 scrape time |

#### Comment fields

Comments carry `id`, `text`, `authorId`, `authorName`, `authorUrl`, `createdAt`, `reactionsTotal`, `replyCount`, and `permalinkUrl` when Facebook exposes them; missing fields are omitted. Comments fetched with replies enabled also carry a `replies` array using the same shape.

#### Group profile fields

`id`, `name` when available (post-link mode; some group-feed About payloads omit it), `url`, `description`, `memberCount`, `memberCountFormatted`, `createdAt`, `admins`, `rules`, `privacy`, `discoverability`, and `tags`.

Private and empty groups produce a status row with `_status`, `_inputUrl`, `_groupUrl`, `_message`, `scrapedAt`, and the public `group` object when enrichment is enabled.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `startUrls` | array | — | Group URLs, bare slugs, numeric group IDs, or group post URLs (required) |
| `sortBy` | select | `top` | `top`, `chronological`, `recent_activity`, `listings` |
| `maxItems` | integer | 50 | Posts per group (1–500); post links always return one |
| `includeTopComments` | boolean | true | Include inline top comments |
| `fetchAllComments` | boolean | false | Fetch each post's full comment thread |
| `maxCommentsPerPost` | integer | 20 | Comment budget per post, including replies |
| `includeCommentReplies` | boolean | true | Attach replies to fetched comments |
| `onlyPostsNewerThan` | string | — | `YYYY-MM-DD`, ISO date, or relative value such as `7 days` |
| `onlyPostsOlderThan` | string | — | Same formats; keeps older posts |
| `searchKeyword` | string | — | Case-insensitive keyword filter |
| `enrichGroupInfo` | boolean | false | Attach group profile data to posts; also returns a profile row for private/empty groups |
| `monitoringMode` | boolean | false | Return only posts not seen in a previous run |

### Examples

Scrape the newest 50 posts from a group:

```json
{
    "startUrls": ["https://www.facebook.com/groups/pythondevelopers/"],
    "sortBy": "chronological",
    "maxItems": 50
}
```

Fetch full comment threads for two group posts:

```json
{
    "startUrls": [
        "https://www.facebook.com/groups/pythondevelopers/posts/29000349089604342/",
        "https://www.facebook.com/groups/OPonemillion/posts/29298552993071994/"
    ],
    "fetchAllComments": true,
    "maxCommentsPerPost": 50,
    "includeCommentReplies": true
}
```

Monitor a group and include its profile:

```json
{
    "startUrls": ["https://www.facebook.com/groups/pythondevelopers/"],
    "sortBy": "recent_activity",
    "maxItems": 100,
    "enrichGroupInfo": true,
    "monitoringMode": true
}
```

### Supported URL formats

- `https://www.facebook.com/groups/pythondevelopers/`
- `https://www.facebook.com/groups/527595400639758/`
- `pythondevelopers` or `527595400639758`
- `https://www.facebook.com/groups/pythondevelopers/posts/29000349089604342/`
- `https://www.facebook.com/groups/pythondevelopers/permalink/29000349089604342/`
- Mobile and web variants of the same links

### FAQ

**Do I need a Facebook account, cookies, or a proxy?**
No. The actor reads public data without logging in and chooses its connection automatically. You do not need to configure a proxy.

**Can it scrape private groups?**
Private group posts are not available without membership. The actor returns the group's public profile when group enrichment is enabled, and a clear status message explaining that posts are private.

**Why are some engagement fields missing, and why do others show 0?**
Facebook reports 0 for some posts with no reactions, comments, or shares; those exact zeros are kept. Fields Facebook does not return at all are omitted, along with empty strings, arrays, objects, and nulls. Counts are preserved exactly as Facebook reports them, never rounded up or fabricated.

**Are date and keyword filters applied by Facebook?**
No. Facebook's group feed does not expose a server-side date or keyword filter, so the actor applies these filters while collecting posts. A very narrow filter can stop after the configured scan ceiling; the status message explains this.

**Why is `videoUrl` missing on some video posts?**
Facebook exposes a direct MP4 for some group videos only. When it does not, the actor returns the thumbnail, duration, dimensions, and permalink instead of inventing a URL.

**How many comments can I get?**
Facebook serves comments in pages of ten. Set `maxCommentsPerPost` to control the budget. Public visibility can be lower than the total shown on the post; `commentsVisible` reports what was available.

**Why is a group feed shorter than the requested number of posts?**
Facebook returns three posts per request and may stop serving older posts. The actor stops when the feed ends or the requested number is reached.

**Does this actor use cookies or a login for post links?**
No. Public group post links and their comment threads are read without authentication.

**Can I export the results?**
Yes. Any run's dataset can be exported to JSON, CSV, Excel, XML, or pushed to Google Sheets from the run page.

# Actor input Schema

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

Facebook group URLs, bare group slugs or numeric IDs, or links to individual group posts.

## `sortBy` (type: `string`):

How to order each group's feed.

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

Maximum number of posts to return per group. Post links always return one post.

## `includeTopComments` (type: `boolean`):

Include each post's inline top comments, with comment text, author, reactions and reply count.

## `fetchAllComments` (type: `boolean`):

Fetch the full comment thread for each post, not just the inline top comments. This is slower and can add many rows of comment data.

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

Comment budget per post, including replies. Only used when full comment threads are enabled.

## `includeCommentReplies` (type: `boolean`):

Attach replies to each fetched comment. Only used when full comment threads are enabled.

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

Keep posts created after this date. Use YYYY-MM-DD or a relative value such as '7 days' or '24 hours'. Applied while collecting posts.

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

Keep posts created before this date. Use YYYY-MM-DD or a relative value such as '30 days'.

## `searchKeyword` (type: `string`):

Keep only posts whose text contains this keyword (case-insensitive). Applied while collecting posts.

## `enrichGroupInfo` (type: `boolean`):

Add the group's name, description, member count, creation date, privacy, rules and admins to posts. Works for public groups; private groups return their public profile only.

## `monitoringMode` (type: `boolean`):

Return only posts not seen in a previous run for the same group or post link, so scheduled runs return just what is new.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.facebook.com/groups/pythondevelopers/"
  ],
  "sortBy": "top",
  "maxItems": 3,
  "includeTopComments": true,
  "fetchAllComments": false,
  "maxCommentsPerPost": 5,
  "includeCommentReplies": true,
  "enrichGroupInfo": false,
  "monitoringMode": false
}
```

# Actor output Schema

## `posts` (type: `string`):

Dataset containing all scraped Facebook group posts and status rows.

# 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/pythondevelopers/"
    ],
    "maxItems": 3,
    "includeTopComments": true,
    "fetchAllComments": false,
    "maxCommentsPerPost": 5,
    "includeCommentReplies": true,
    "enrichGroupInfo": false,
    "monitoringMode": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("vexaloom-labs/facebook-group-feed-and-engagement-extractor").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/pythondevelopers/"],
    "maxItems": 3,
    "includeTopComments": True,
    "fetchAllComments": False,
    "maxCommentsPerPost": 5,
    "includeCommentReplies": True,
    "enrichGroupInfo": False,
    "monitoringMode": False,
}

# Run the Actor and wait for it to finish
run = client.actor("vexaloom-labs/facebook-group-feed-and-engagement-extractor").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/pythondevelopers/"
  ],
  "maxItems": 3,
  "includeTopComments": true,
  "fetchAllComments": false,
  "maxCommentsPerPost": 5,
  "includeCommentReplies": true,
  "enrichGroupInfo": false,
  "monitoringMode": false
}' |
apify call vexaloom-labs/facebook-group-feed-and-engagement-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vexaloom-labs/facebook-group-feed-and-engagement-extractor"
        }
    }
}
```

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/aFlHZPCMOjot2Ym8e/builds/Dg4WzPhie7Uh9fl7g/openapi.json
