# Facebook Group Posts Scraper (`khadinakbar/facebook-group-posts-scraper`) Actor

Scrape public Facebook group posts by group URL or ID, with post text, author, reaction, comment and share counts, media URLs, top comments and pagination cursors. No login or cookies needed.

- **URL**: https://apify.com/khadinakbar/facebook-group-posts-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, MCP servers, Lead generation
- **Security:** Limited permissions
- **Stats:** 5 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 facebook group 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/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

### What is Facebook Group Posts Scraper — Text, Engagement & Comments?

Facebook Group Posts Scraper is an Apify Actor for public Facebook group content. It accepts one or more public group URLs or numeric group IDs and returns one dataset record per post. Each record can include post text, author details, publish time, reaction/comment/share counts, media URLs, top-comment previews, pagination cursors, and execution provenance fields such as source and scrape timestamp. The Actor is usable through Apify MCP and through the Apify API.

### Best fit and connected workflows

This Actor fits workflows that start with a public Facebook group and end with structured post data for analysis, review, or downstream automation.

Use it when you want to:

- collect public group posts from a known group URL or group ID
- compare post activity using reaction, comment, and share counts
- capture author and media context alongside the post text
- resume a feed with a saved cursor from a previous run
- feed an AI agent or internal pipeline with stable JSON records

Connected workflows can stay inside the Facebook post surface:

- pass a returned post into Facebook Post Comments Scraper when you need deeper comment extraction for a specific post
- pass public reaction or profile data into Facebook Likes Scraper -- Public Reactions & Profiles when the next step is reaction or profile-oriented analysis

### Practical scenario

Maya, a community researcher, starts with a public group URL for a local gardening group and sets a maximum post count for the run. The Actor returns rows with `text`, `authorName`, `publishedAt`, `reactionCount`, `commentCount`, `shareCount`, `imageUrl`, and `topComments`. Maya reviews the posts with the highest engagement, then opens the linked post URLs to compare recurring themes and decide which discussion thread to summarize next.

### Input

| Field | Type | Purpose |
|---|---:|---|
| `groupUrls` | array\[string] | One or more public Facebook group URLs |
| `groupIds` | array\[string] | Numeric Facebook group IDs when the URL is unknown |
| `maxPosts` | integer | Maximum post records to save across all groups |
| `maxPagesPerGroup` | integer | Maximum provider pages to request per group |
| `startCursor` | string | Cursor from `RUN_SUMMARY.nextCursors` for resuming a feed |
| `sortBy` | string | Provider-side ordering: `RECENT_ACTIVITY`, `TOP_POSTS`, `CHRONOLOGICAL`, `CHRONOLOGICAL_LISTINGS` |
| `dataSource` | string | `auto`, `provider`, or `browser` |
| `providerOrder` | string | The routing options listed in the input schema |
| `useBrowserFallback` | boolean | Enables Playwright browser fallback when provider APIs are unavailable, empty, or disabled |
| `maxBrowserScrolls` | integer | Maximum scrolls in browser fallback mode |
| `facebookCookies` | string | Optional cookie input for browser fallback using an authorized session |
| `proxy` | object | Proxy settings for browser fallback |
| `includeRawData` | boolean | Adds the raw source object to each dataset row |

#### Focused input example

```json
{
  "groupUrls": [
    "https://www.facebook.com/groups/homemakingtips/"
  ],
  "maxPosts": 25,
  "maxPagesPerGroup": 4,
  "sortBy": "RECENT_ACTIVITY",
  "dataSource": "auto",
  "useBrowserFallback": true,
  "includeRawData": false
}
```

### Output

One dataset record represents one public Facebook group post.

| Field | Type | Purpose |
|---|---:|---|
| `groupUrl` | string | Canonical group URL used for the record |
| `groupId` | string or null | Numeric group ID when available |
| `groupSlug` | string or null | Group slug extracted from the URL |
| `sourceInput` | string | Original input URL or group ID |
| `postId` | string or null | Post identifier when available |
| `postUrl` | string or null | Direct post permalink |
| `text` | string or null | Post text or browser-extracted visible text |
| `authorName` | string or null | Public author display name |
| `authorId` | string or null | Public author identifier |
| `authorUrl` | string or null | Public author profile URL |
| `publishedAt` | string or null | ISO timestamp or provider timestamp string |
| `publishTime` | integer or null | Provider Unix timestamp when available |
| `reactionCount` | integer or null | Reaction total |
| `commentCount` | integer or null | Comment total |
| `shareCount` | integer or null | Share total |
| `videoViewCount` | integer or null | Video views when available |
| `engagementCount` | integer or null | Sum of reactions, comments, and shares when available |
| `imageUrl` | string or null | Image or thumbnail URL |
| `videoUrl` | string or null | Direct provider video URL |
| `videoDetails` | object or null | Provider video metadata |
| `topComments` | array or null | Top-comment preview objects |
| `sortBy` | string | Sort mode used for the record |
| `page` | integer | Provider page or browser fallback page number |
| `cursor` | string or null | Cursor used for this page when available |
| `source` | string | Data source used for the record |
| `scrapedAt` | string | ISO timestamp when the row was saved |
| `rawPost` | object or null | Raw source object when `includeRawData` is enabled |

#### Illustrative output record

```json
{
  "groupUrl": "https://www.facebook.com/groups/homemakingtips/",
  "groupId": "1234567890",
  "groupSlug": "homemakingtips",
  "sourceInput": "https://www.facebook.com/groups/homemakingtips/",
  "postId": "2065680910795061",
  "postUrl": "https://www.facebook.com/groups/homemakingtips/permalink/2065680910795061/",
  "text": "Looking for ideas to organize a small pantry.",
  "authorName": "Jane D.",
  "authorId": "1000123456789",
  "authorUrl": "https://www.facebook.com/profile.php?id=1000123456789",
  "publishedAt": "2025-02-14T10:30:00Z",
  "reactionCount": 42,
  "commentCount": 18,
  "shareCount": 3,
  "videoViewCount": null,
  "engagementCount": 63,
  "imageUrl": "https://example.com/image.jpg",
  "videoUrl": null,
  "videoDetails": null,
  "topComments": [],
  "sortBy": "RECENT_ACTIVITY",
  "page": 1,
  "cursor": "cursor_value",
  "source": "provider",
  "scrapedAt": "2025-02-14T10:31:00Z",
  "rawPost": null
}
```

### How it works

The Actor accepts public Facebook group URLs or group IDs, then tries configured provider APIs first. The provider chain is the primary and fallback data providers, with a selectable order. If browser fallback is enabled, it can use a Playwright scrape path. Provider pagination returns up to 3 posts per request and uses cursors, which are exposed in execution summaries for resuming later. The Actor stores the dataset rows in the default dataset and writes `RUN_SUMMARY` and `OUTPUT` to the default key-value store.

### Pricing

Facebook Group Posts Scraper — Text, Engagement & Comments uses Pay per event pricing with Apify platform usage included. The primary event is one saved Facebook group post. There is also a small actor-start event, and Apify platform usage is included in the event price. For the current pricing details, see the live Pricing tab on the Actor page.

For example, a run that saves ten posts creates ten post-scraped events, plus the actor-start event, and Apify platform usage is added according to the execution configuration.

### Use with AI agents (MCP)

This Actor is available as an Apify Actor usable through Apify MCP. It provides structured public Facebook group post data that agent workflows can read, filter, summarize, or pass into follow-up tools.

Tool identity: `khadinakbar/facebook-group-posts-scraper`

> Scrape the public Facebook group at `https://www.facebook.com/groups/homemakingtips/`, return up to 20 recent posts, and include post text, author, counts, media URLs, and top comments. Use the dataset rows as the source of truth, then summarize the most engaging posts.

Output interpretation:

- each dataset row is one public group post
- `postUrl` is the canonical link for record-level follow-up
- `reactionCount`, `commentCount`, `shareCount`, and `engagementCount` help rank activity
- `topComments` gives a preview of visible provider comments when available
- `source`, `cursor`, `page`, and `scrapedAt` provide provenance for agent reasoning

Provenance and scope:

- the Actor targets public Facebook group posts
- it accepts group URLs or group IDs
- it writes dataset rows plus execution summaries to key-value store records
- browser fallback is available when configured through the input

Pagination and cost guidance:

- provider responses return up to 3 posts per request
- use `maxPagesPerGroup` to expand coverage in one run
- reuse `RUN_SUMMARY.nextCursors` with `startCursor` to continue a feed
- event-based pricing means saved posts drive the main cost

### API example

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

const client = new ApifyClient({
  token: process.env.APIFY_TOKEN,
});

const run = await client.actor('khadinakbar/facebook-group-posts-scraper').call({
  groupUrls: ['https://www.facebook.com/groups/homemakingtips/'],
  maxPosts: 10,
  sortBy: 'RECENT_ACTIVITY',
});

const dataset = client.dataset(run.defaultDatasetId);
const { items } = await dataset.listItems({ clean: true });

console.log(items);
```

### Best results and outcome guidance

Start with a single public group URL or a small set of related group IDs when you are validating a workflow. Use `RECENT_ACTIVITY` for current discussion flow, or `TOP_POSTS` when you want engagement-ranked posts. Set `maxPosts` to the number of rows your pipeline needs, and raise `maxPagesPerGroup` when you want broader coverage from the same group feed. If you need to continue from a previous run, copy the cursor from `RUN_SUMMARY.nextCursors` into `startCursor`. When a downstream process only needs structured records, read the dataset items; when it also needs run context, read `RUN_SUMMARY` and `OUTPUT` from the default key-value store.

### Continue the workflow

- Then use [Facebook Groups Scraper](https://apify.com/khadinakbar/facebook-groups-scraper) to extend Facebook Group Posts Scraper — Text, Engagement & Comments research with a complementary content contract.
- Then use [Facebook Groups Search Scraper](https://apify.com/khadinakbar/facebook-groups-search-scraper) to extend Facebook Group Posts Scraper — Text, Engagement & Comments research with a complementary discovery contract.

### Design note

I found that the output contract includes both `RUN_SUMMARY` and `OUTPUT` in the default key-value store, which makes the Actor straightforward to use from both scripts and agents.

### FAQ

**How do I choose between group URLs and group IDs?** Use a group URL when you have the canonical public link. Use a group ID when that is the identifier you already store in another system.

**How do I continue a partially collected group feed?** Read the cursor from `RUN_SUMMARY.nextCursors` and pass it back as `startCursor`.

**Which field should I use for engagement ranking?** `engagementCount` is the combined total of available reactions, comments, and shares. The individual counts are also available.

**How do I connect this Actor to comment collection?** Use the returned `postUrl` or post identifier with Facebook Post Comments Scraper when your workflow needs a post-level comment pass.

**How do I connect this Actor to reaction or profile analysis?** Pass returned Facebook records into Facebook Likes Scraper -- Public Reactions & Profiles when the next step needs public reaction or profile data.

### Responsible use

This Actor is designed for public Facebook group content and for data you are authorized to access. Respect Facebook's terms, applicable laws, and any rights or permissions that apply to the content you process. Use authorized sessions only for browser fallback, and keep your collection aligned with your organization's compliance and data-handling requirements.

# Changelog

This Actor's version history is a separate document: https://apify.com/khadinakbar/facebook-group-posts-scraper/changelog.md

# Actor input Schema

## `groupUrls` (type: `array`):

One or more public Facebook group URLs, for example https://www.facebook.com/groups/homemakingtips/.

## `groupIds` (type: `array`):

Optional numeric Facebook group IDs. Use this when you know the group ID and do not have a URL.

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

Maximum number of group post records to save across all groups.

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

Provider APIs currently return up to 3 posts per request and paginate with a cursor.

## `startCursor` (type: `string`):

Optional provider pagination cursor. Use a cursor from RUN_SUMMARY.nextCursors to resume a group feed.

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

Provider-side Facebook group post ordering.

## `dataSource` (type: `string`):

Auto tries configured providers first, then browser fallback when enabled. Provider only skips browser fallback. Browser only skips provider APIs.

## `useBrowserFallback` (type: `boolean`):

Try a Playwright browser scrape when provider APIs are unavailable, empty, or disabled.

## `maxBrowserScrolls` (type: `integer`):

Maximum page scrolls in browser fallback mode.

## `facebookCookies` (type: `string`):

Optional JSON cookie array or raw Cookie header for browser fallback only. Use your own authorized session; do not use this for data you are not allowed to access.

## `proxy` (type: `object`):

Proxy settings for browser fallback.

## `includeRawData` (type: `boolean`):

Include raw source objects in each dataset row for debugging and custom downstream parsing.

## Actor input object example

```json
{
  "groupUrls": [
    "https://www.facebook.com/groups/homemakingtips/"
  ],
  "maxPosts": 100,
  "maxPagesPerGroup": 5,
  "sortBy": "RECENT_ACTIVITY",
  "dataSource": "auto",
  "useBrowserFallback": true,
  "maxBrowserScrolls": 8,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "includeRawData": false
}
```

# Actor output Schema

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

Structured dataset records for scraped public Facebook group posts.

## `postsCsv` (type: `string`):

CSV export of the same Facebook group post records.

## `runSummary` (type: `string`):

Machine-readable telemetry with post counts, groups processed, providers used, provider status codes, cursors, and stop reason.

## `outputSummary` (type: `string`):

Compact agent-friendly summary with posts scraped, groups processed, groups with results, providers used, and stop reason.

# 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 = {
    "groupUrls": [
        "https://www.facebook.com/groups/homemakingtips/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/facebook-group-posts-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 = { "groupUrls": ["https://www.facebook.com/groups/homemakingtips/"] }

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/facebook-group-posts-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 '{
  "groupUrls": [
    "https://www.facebook.com/groups/homemakingtips/"
  ]
}' |
apify call khadinakbar/facebook-group-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/facebook-group-posts-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/hfPwOw0vcVcuYhJVB/builds/9qsVHXviKhTHCveKU/openapi.json
