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

Scrape public Facebook group posts by group URL or group ID. Export post text, author, reaction/comment/share counts, media URLs, top comments, and pagination cursors. No login or cookies required. MCP/API-ready.

- **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
- **Stats:** 1 total users, 0 monthly users, 0.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 and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Posts Scraper

Scrape **public Facebook group posts** by group URL or group ID — no login, no cookies, no browser extension. The actor returns clean, MCP-friendly dataset records with post text, author details, publish time, reaction/comment/share counts, media URLs, top-comment previews, and resumable pagination cursors.

### What it does

Give it one or more public Facebook group URLs (or numeric group IDs) and it returns one structured row per post. It pulls data through a managed provider chain (ScrapeCreators → SociaVault) so you never have to supply a Facebook session, fight Cloudflare, or maintain cookies. An optional cookieless Playwright fallback covers edge cases.

### When to use it

- Monitor discussion and engagement inside public Facebook groups
- Build datasets of group posts for social listening, research, or trend analysis
- Track top posts and top comments by reaction and comment volume
- Feed an AI agent / MCP client structured Facebook group data on demand

**When NOT to use it:** for a Facebook *Page* feed, Marketplace listings, or the Ad Library — those are different surfaces. For private/closed groups you are not a member of, no public data is returned.

### Output

One dataset record per post:

| Field | Description |
|---|---|
| `groupUrl`, `groupId`, `groupSlug` | Canonical group identifiers |
| `postId`, `postUrl` | Post identifier and direct permalink |
| `text` | Post text (absent for media-only posts) |
| `authorName`, `authorId`, `authorUrl` | Public author identity when available |
| `publishedAt`, `publishTime` | ISO 8601 timestamp + unix seconds |
| `reactionCount`, `commentCount`, `shareCount`, `videoViewCount` | Engagement metrics |
| `engagementCount` | Sum of available reactions + comments + shares |
| `imageUrl`, `videoUrl`, `videoDetails` | Media URLs and video metadata |
| `topComments` | Preview of top comments (author + text + time) |
| `sortBy`, `page`, `cursor`, `source`, `scrapedAt` | Run provenance |

Run-level summaries are written to the default key-value store:

- `RUN_SUMMARY` — full telemetry: counts, provider status codes, pagination cursors (`nextCursors`), and stop reason.
- `OUTPUT` — compact agent-friendly summary.

### Pricing

Pay-per-event: **$0.005 per saved post** plus a tiny `$0.00005` actor-start event. Pay-Per-Usage (compute + proxy) is also available — pick at run time. Each run prints its cost cap up front and the actual amount billed at the end, so there are no billing surprises.

### Input

- `groupUrls` — public group URLs, e.g. `https://www.facebook.com/groups/homemakingtips/`
- `groupIds` — optional numeric group IDs (use when you have an ID but no URL)
- `maxPosts` — max posts saved across all groups (default 100)
- `maxPagesPerGroup` — provider pages per group; providers return ~3 posts/page and paginate by cursor (default 5)
- `startCursor` — resume a group feed using a cursor from `RUN_SUMMARY.nextCursors`
- `sortBy` — `RECENT_ACTIVITY`, `TOP_POSTS`, `CHRONOLOGICAL`, or `CHRONOLOGICAL_LISTINGS`
- `dataSource` — `auto` (providers then browser), `provider`, or `browser`
- `providerOrder` — which managed provider is tried first
- `facebookCookies` — optional JSON cookie array / raw Cookie header, browser fallback only
- `includeRawData` — adds the raw source object to each row for custom parsing

### Pagination

Providers return up to 3 posts per request and paginate with a cursor. Raise `maxPagesPerGroup` to collect more in one run, or grab a cursor from `RUN_SUMMARY.nextCursors` and pass it as `startCursor` to resume later without re-scraping.

### Example (API)

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~facebook-group-posts-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"groupUrls":["https://www.facebook.com/groups/homemakingtips/"],"maxPosts":30,"sortBy":"RECENT_ACTIVITY"}'
```

### MCP / AI agents

Exposed in the Apify MCP server as `apify--facebook-group-posts-scraper`. Input is a single group URL or ID; output is flat, stable JSON sized for agent context. Empty/private groups return a graceful empty result with a `_note`; a total source failure returns an actionable error rather than a silent success.

### FAQ

**Do I need a Facebook login or cookies?** No. The default path is provider-backed and cookieless. Cookies are only for the optional browser fallback on content you are authorized to access.

**Why only ~3 posts per page?** That is the provider's per-request cap for Facebook groups. The actor paginates automatically via cursor up to `maxPagesPerGroup`.

**Can it read private/closed groups?** Only public group content is returned. Private content requires an authorized session you supply yourself, and even then is subject to Facebook's terms.

**What happens if a group is empty or unavailable?** The run ends gracefully with a summary and `stopReason`. If every data source is blocked or errors, the run honestly fails with a clear message — it never reports a fake success.

### Limits & compliance

Closed, private, deleted, age-gated, or membership-only content may return no records. Only scrape public data and data you are authorized to access. You are responsible for complying with Facebook's Terms of Service and applicable data-protection laws (including GDPR/CCPA). This actor does not collect private personal data on your behalf and is provided for lawful, authorized use only.

# 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.

## `providerOrder` (type: `string`):

Choose which managed provider API is tried first.

## `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",
  "providerOrder": "scrapecreators-first",
  "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("💾 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 '{
  "groupUrls": [
    "https://www.facebook.com/groups/homemakingtips/"
  ]
}' |
apify call khadinakbar/facebook-group-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/hfPwOw0vcVcuYhJVB/builds/0mwRaG5ztm1xkVU7u/openapi.json
