# Facebook Groups Scraper With Engagement Analytics (`api-empire/facebook-groups-scraper`) Actor

Scrape Facebook Groups with names, descriptions, member counts, categories, posts, comments, reactions, and engagement metrics. Analyze group activity, audience interests, content performance, and engagement trends for market research, competitor analysis, and lead generation.

- **URL**: https://apify.com/api-empire/facebook-groups-scraper.md
- **Developed by:** [API Empire](https://apify.com/api-empire) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 9 total users, 1 monthly users, 77.1% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 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.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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 Groups Scraper — Extract Posts, Reactions & Analytics as JSON

Facebook Groups Scraper With Engagement Analytics extracts public Facebook group posts and turns them into ready-to-use engagement data: a full 7-type reaction breakdown, engagement rate, virality score, reaction sentiment, and per-run rank and percentile — plus one summary row per group with averages, the top post, posting cadence and top contributors. Every response returns typed, normalized JSON — no HTML, no selectors, no parsing. Point it at one or more public group URLs and get post-level and group-level analytics ready for a spreadsheet, a dashboard, or an LLM pipeline.

### What is Facebook Groups Scraper With Engagement Analytics?

Facebook Groups Scraper With Engagement Analytics is an Apify Actor that reads public Facebook group feeds and returns two structured row types in one dataset: individual posts enriched with engagement analytics, and one summary row per group. No Facebook account is required to analyze public groups — the Actor reads them logged out through Apify's residential proxy network, and only needs a session cookie if you want to reach a private group you already belong to. It's callable as an HTTP API and, through Apify's Actors MCP Server, as a tool for AI agents.

- Scrape public Facebook group posts by URL, logged out, via residential proxy
- Get the full 7-type reaction breakdown (like, love, care, haha, wow, sad, angry) on every post
- Compute engagement rate, virality score, reaction sentiment and rank/percentile locally — no AI, no external calls
- Get one per-group summary row: averages, top post, posting cadence, top contributors
- Export to JSON, CSV or Excel from the Apify dataset

### What data does Facebook Groups Scraper With Engagement Analytics collect?

Every run returns post-level content and reactions, computed engagement metrics, and a per-group summary — all in the same dataset, distinguished by the `type` field.

| Data Type | Key Fields | JSON Field Names |
| --- | --- | --- |
| Post content & author | text, author name/id, profile link, attached media | `text`, `user`, `authorProfileUrl`, `attachments` |
| Reaction breakdown | all 7 reaction types plus total | `reactionLikeCount`, `reactionLoveCount`, `reactionCareCount`, `reactionHahaCount`, `reactionWowCount`, `reactionSadCount`, `reactionAngryCount`, `topReactionsCount` |
| Computed engagement analytics | rate, rank, percentile, virality, sentiment | `engagementRate`, `engagementRank`, `engagementPercentile`, `viralityScore`, `reactionSentimentRatio` |
| Per-group summary | averages, top post, posting cadence, top contributors | `avgReactions`, `avgEngagementRate`, `topPostUrl`, `postsPerDay`, `topContributors` |

#### Need more Facebook data?

If you don't already have your group list, Facebook Groups Search Scraper With Member Filters discovers public groups by keyword and filters them by member count and posting activity before you feed the URLs into this Actor. To go deeper on the people behind the engagement, Facebook Comments Scraper With Author Lead Enrichment turns commenters into enriched leads with bios, follower counts and contact details pulled from their comment text.

### How does Facebook Groups Scraper With Engagement Analytics differ from the official Facebook API?

Meta's Graph API gives programmatic access to Facebook data, but its Groups endpoints are the most restricted part of the platform: reading a group's feed generally requires the requesting app to pass Meta's App Review process, and access is typically limited to groups the app or an admin account already manages. Facebook Groups Scraper With Engagement Analytics reads public group feeds directly and computes engagement analytics the Graph API doesn't provide.

| Feature | Facebook Graph API | Facebook Groups Scraper With Engagement Analytics |
| --- | --- | --- |
| App review | Required before any group-feed access | Not required — runs directly as an Apify Actor |
| Access scope | Mostly limited to groups the app/account administers | Any public group, by URL |
| Setup time | Application, review and access-token setup | Paste group URLs and start the run |
| Reaction detail | Aggregate reaction count | Full 7-type reaction breakdown per post |
| Derived metrics | None — raw counts only | Engagement rate, virality score, sentiment, rank/percentile computed automatically |
| Credentials | OAuth app plus a page/user access token | None for public groups; a cookie only for groups you already belong to |

The Graph API is the right choice if you already run an approved app that manages the groups you need. For reading public groups you don't administer, or for engagement analytics Facebook's own API doesn't compute, Facebook Groups Scraper With Engagement Analytics is the faster path.

### Why do developers and teams scrape Facebook?

#### For marketers and brand teams

Brand and community teams use Facebook Groups Scraper With Engagement Analytics to see which posts actually resonate in a niche group before running a campaign or partnership there. Setting `postsPerGroup` and `sortBy: "highest_engagement"` surfaces the content format — a photo album, a question, a Buy/Sell listing — that drives the highest `engagementRate` and `viralityScore` in a community. The per-group summary row's `topContributors` list also identifies the members driving the most engagement, useful for outreach or ambassador programs, without needing a Business account or ad access to any of the groups being monitored.

#### For researchers and analysts

Academic and market researchers use the Actor to study engagement patterns in public communities — support groups, hobbyist groups, local Buy/Sell groups — without needing membership inside them. Because `reactionSentimentRatio`, `engagementPercentile` and `viralityScore` are computed identically on every run, a researcher can compare posting cadence (`postsPerDay`) and sentiment across dozens of public groups on a consistent scale. Filtering with `postsNewerThan` and `yearFilter` keeps a study bounded to a specific period, and the Actor only reads what Facebook already serves a logged-out visitor.

#### For AI engineers and agent builders

AI teams feed the typed JSON straight into a RAG index or an agent's tool call — no HTML to parse, no reaction icons to classify. A monitoring agent can call the Actor nightly with `groupUrls` set to a watchlist, filter on `minEngagementRate`, and pass only the highest-scoring `text` and `topComments` into an LLM summarizer, citing the source with `engagementRank` and `topPostUrl`. Because field names and types stay stable between runs, the same prompt template keeps working without re-mapping fields after each scrape.

#### For developers building data products

Developers building social-analytics dashboards or reporting tools call the Actor on a schedule and store each run's summary row (`type: "summary"`) as one time-series data point per group — `avgEngagementRate`, `postsPerDay` and `totalEngagement` become the metrics a chart tracks over time. Because post rows and summary rows share one dataset and are told apart by the `type` field, a single ingestion pipeline routes both into a warehouse table without a second scraper or a custom parser for group-level aggregates. The same JSON structure works whether the pipeline runs hourly, daily, or on demand from a webhook.

### How to scrape Facebook (step by step)

1. Open Facebook Groups Scraper With Engagement Analytics on the Apify Store and start a run.
2. Add one or more public group URLs to `groupUrls` — no Facebook login is required for public groups.
3. Choose what to sample and how to sort: `feedSortStrategy` picks which slice of the feed Facebook returns (chronological, recent activity, top posts, or Buy/Sell listings), while `sortBy` orders the analytics output by newest, most reactions, or highest engagement.
4. Start the run. The Actor always routes requests through Apify's residential proxies; provide `facebookSessionCookie` only if you need to reach a private group you belong to.
5. Open the Dataset tab when the run finishes and export the post and summary rows as JSON, CSV or Excel, or pull them by API.

#### What to do when Facebook changes its structure

Facebook's GraphQL feed structure and document IDs change without notice. The extractor checks several alternate paths and rediscovers the query's document ID from the page's own JavaScript each run, so most front-end changes don't need a rebuild. The Actor is maintained, and output field names and types stay the same on your end even as Facebook's internal structure shifts.

### ⬇️ Input

Every input field is optional — there is no required parameter in the schema.

| Parameter | Required | Type | Description | Example Value |
| --- | --- | --- | --- | --- |
| `groupUrls` | No | array | One or more public Facebook group URLs to analyze. Only public groups can be read without a login cookie. | `["https://www.facebook.com/groups/cheapmealideas/"]` |
| `postsPerGroup` | No | integer | How many posts to pull from each group before engagement analytics are computed. Larger samples make averages, rank and percentile more stable. | `30` |
| `feedSortStrategy` | No | string (enum) | Which slice of the group's feed Facebook returns for analysis: `CHRONOLOGICAL`, `RECENT_ACTIVITY`, `TOP_POSTS`, or `CHRONOLOGICAL_LISTINGS` (Buy/Sell groups). | `"TOP_POSTS"` |
| `sortBy` | No | string (enum) | How to order the post rows after analytics are computed: `newest`, `most_reactions`, or `highest_engagement`. Default `"highest_engagement"`. | `"highest_engagement"` |
| `minReactions` | No | integer | Keep only posts with at least this many total reactions. Default `0` (no filter). | `5` |
| `minEngagementRate` | No | integer | Keep only posts whose engagement rate is at least this value (`1` = run average, `2` = twice average). Default `0` (no filter). | `2` |
| `textFilterKeyword` | No | string | Local substring match over the sampled feed — keep only posts whose text contains this keyword or letter. Not a Facebook search. | `"recipe"` |
| `yearFilter` | No | string | Keep only posts from a specific year. Best combined with `textFilterKeyword`. | `"2024"` |
| `postsNewerThan` | No | string | Keep only posts newer than this date/time. Absolute (`YYYY-MM-DD`) or relative (`"7 days"`, `"2 weeks"`, `"1 month"`, `"1 year"`). | `"30 days"` |
| `proxyConfiguration` | No | object | Proxy configuration. Residential proxies are used automatically for Facebook requests. | `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}` |
| `facebookSessionCookie` | No | string (secret) | Optional Facebook session cookie (must include at least `c_user` and `xs`). Leave empty for logged-out public-group analysis. | `"c_user=100000...; xs=12%3A...;"` |

#### Example input

```json
{
  "groupUrls": ["https://www.facebook.com/groups/cheapmealideas/"],
  "postsPerGroup": 30,
  "feedSortStrategy": "TOP_POSTS",
  "sortBy": "highest_engagement",
  "minReactions": 5,
  "minEngagementRate": 0,
  "textFilterKeyword": "",
  "yearFilter": "",
  "postsNewerThan": "30 days",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  },
  "facebookSessionCookie": ""
}
```

The most common input mistake is expecting `textFilterKeyword` to run a Facebook search — it's a local substring match over the posts already sampled by `feedSortStrategy`, so a long phrase on a small `postsPerGroup` sample without a login cookie often returns zero rows; start with a single letter or a short common word.

### ⬆️ Output

Every row is typed, normalized JSON. Export the dataset as JSON, CSV or Excel. Two row shapes share the dataset, told apart by the `type` field: `"post"` and `"summary"`.

#### Scraped Facebook group post (`type: "post"`)

```json
{
  "type": "post",
  "facebookUrl": "https://www.facebook.com/groups/cheapmealideas/",
  "url": "https://www.facebook.com/groups/cheapmealideas/posts/1234567890/",
  "time": "2026-06-30T14:10:00.000Z",
  "date": "2026-06-30T14:10:00.000Z",
  "user": {
    "id": "100000123456789",
    "name": "Jane Doe",
    "profileUrl": "https://www.facebook.com/jane.doe",
    "profilePicture": "https://scontent.xx.fbcdn.net/v/jane.jpg"
  },
  "text": "Budget dinner idea: one-pan chicken and rice for under $8.",
  "topReactionsCount": 120,
  "feedbackId": "ZmVlZGJhY2s6MTIzNDU2Nzg5MA==",
  "reactionLikeCount": 70,
  "reactionLoveCount": 30,
  "id": "UzpfSTEwMDAwMDEyMzQ1Njc4OTA6MTIzNDU2",
  "legacyId": "1234567890",
  "attachments": [
    {
      "thumbnail": "https://scontent.xx.fbcdn.net/v/thumb.jpg",
      "__typename": "Photo",
      "is_playable": false,
      "image": { "uri": "https://scontent.xx.fbcdn.net/v/photo.jpg", "height": 720, "width": 960 },
      "id": "9876543210",
      "ocrText": null
    }
  ],
  "likesCount": 120,
  "sharesCount": 6,
  "commentsCount": 34,
  "topComments": [
    {
      "commentUrl": "https://www.facebook.com/groups/cheapmealideas//permalink/1234567890/?comment_id=555",
      "id": "Y29tbWVudDo1NTU=",
      "text": "Making this tonight, thank you!",
      "profileUrl": "https://www.facebook.com/some.commenter",
      "profileName": "Alex Rivera",
      "likesCount": "4"
    }
  ],
  "facebookId": "111222333",
  "groupTitle": "Cheap Meal Ideas",
  "pageAdLibrary": { "is_business_page_active": false, "id": "111222333" },
  "inputUrl": "https://www.facebook.com/groups/cheapmealideas/",
  "authorProfileUrl": "https://www.facebook.com/jane.doe",
  "authorProfilePicture": "https://scontent.xx.fbcdn.net/v/jane.jpg",
  "reactionCareCount": 10,
  "reactionHahaCount": 6,
  "reactionWowCount": 2,
  "reactionSadCount": 1,
  "reactionAngryCount": 1,
  "scrapedAt": "2026-07-25T12:00:00.000Z",
  "engagementTotal": 160,
  "ageHours": 4.2,
  "viralityScore": 38.095,
  "reactionsBreakdown": { "like": 70, "love": 30, "care": 10, "haha": 6, "wow": 2, "sad": 1, "angry": 1 },
  "positiveReactions": 118,
  "negativeReactions": 2,
  "reactionSentimentRatio": 0.9833,
  "engagementRate": 2.13,
  "engagementRank": 1,
  "engagementPercentile": 100.0
}
```

#### Group engagement summary (`type: "summary"`)

```json
{
  "type": "summary",
  "facebookUrl": "https://www.facebook.com/groups/cheapmealideas/",
  "inputUrl": "https://www.facebook.com/groups/cheapmealideas/",
  "groupTitle": "Cheap Meal Ideas",
  "totalPosts": 30,
  "avgReactions": 54.2,
  "avgComments": 12.7,
  "avgShares": 3.1,
  "avgEngagementTotal": 70.0,
  "avgEngagementRate": 1.0,
  "avgViralityScore": 9.84,
  "avgReactionSentimentRatio": 0.91,
  "totalReactions": 1626,
  "totalComments": 381,
  "totalShares": 93,
  "totalEngagement": 2100,
  "reactionTotals": { "like": 980, "love": 420, "care": 120, "haha": 60, "wow": 30, "sad": 10, "angry": 6 },
  "topPostUrl": "https://www.facebook.com/groups/cheapmealideas/posts/1234567890/",
  "topPostEngagement": 160,
  "avgPostingIntervalHours": 6.4,
  "postsPerDay": 3.75,
  "topContributors": [
    { "id": "100000123456789", "name": "Jane Doe", "profileUrl": "https://www.facebook.com/jane.doe", "postCount": 4, "totalEngagement": 410 }
  ],
  "scrapedAt": "2026-07-25T12:00:00.000Z"
}
```

### How many results can you scrape with Facebook Groups Scraper With Engagement Analytics?

There's no hard result cap in the Actor's input schema — `postsPerGroup` only has a minimum of 1, so you set the target per group yourself (the prefilled default is 20). List multiple `groupUrls` in one run and each group is scraped and analyzed independently up to its own `postsPerGroup` target. In practice, the number of posts returned also depends on how many posts Facebook's feed actually serves before pagination runs out or a login wall appears — when that happens the run stops and returns whatever it collected rather than padding the result set. Engagement filters (`minReactions`, `minEngagementRate`) are applied after scraping, so a narrow filter on a small sample can return fewer rows than `postsPerGroup` requested. No separate pagination parameter is needed — raise `postsPerGroup` for a larger sample per group.

### Integrate Facebook Groups Scraper With Engagement Analytics and automate your workflow

Facebook Groups Scraper With Engagement Analytics works with any language or tool that can send an HTTP request.

#### REST API integration

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_API_TOKEN>")
run = client.actor("<your-username>/facebook-groups-scraper-with-engagement-analytics").call(
    run_input={
        "groupUrls": ["https://www.facebook.com/groups/cheapmealideas/"],
        "postsPerGroup": 30,
        "sortBy": "highest_engagement",
    }
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item["type"] == "post":
        print(item["text"], item["engagementRate"])
```

Works in Python, Node.js, Go, Ruby, cURL.

#### MCP for AI agents

The Actor is callable through Apify's Actors MCP Server, which exposes any Apify Actor as a tool for MCP-compatible clients (Claude Code, Cursor, VS Code and others). Register it locally with `npx -y @apify/actors-mcp-server` (set `APIFY_TOKEN` in the environment), or use the hosted server at `https://mcp.apify.com?tools=<your-username>/facebook-groups-scraper-with-engagement-analytics`.

#### Automation platforms (n8n, Make)

In n8n, install the community node `@apify/n8n-nodes-apify`, add an Apify credential with your API token, and use the Apify node's **Run Actor** action with this Actor's ID, then chain a **Get Dataset Items** action to pull the post and summary rows into the rest of your workflow. In Make, the Apify app's **Run an Actor** module starts the scrape synchronously, and a follow-up **Get Dataset Items** module retrieves the results for routing into Google Sheets, a database, or any of Make's other app connectors.

### Is it legal to scrape Facebook?

Yes — Facebook Groups Scraper With Engagement Analytics only reads posts and comments Facebook already serves to a logged-out visitor of a public group; it does not bypass any login wall or read a private group without a cookie belonging to a member. Post and comment rows include personal data — author names, profile URLs and profile pictures — so GDPR and CCPA govern how you store, process and reuse that data, particularly for EU or California residents. Facebook's Terms of Service also apply to any account or cookie you choose to use. Consult legal counsel for commercial use cases involving bulk personal data.

### Frequently asked questions

#### Does Facebook Groups Scraper With Engagement Analytics work without a Facebook account?

Yes. Public groups are read logged out through Apify's residential proxy; no Facebook login or cookie is required. Provide `facebookSessionCookie` only if you want to reach a private or closed group you already belong to.

#### How often is the scraped data updated?

Every run fetches the group's feed live from Facebook at the time you start it — nothing is served from a cache. Engagement metrics (rate, rank, percentile, summary averages) are recomputed fresh for that run's post set every time.

#### What happens if a group has no public posts, or Facebook returns an error?

If Facebook serves no posts for a URL — an empty group, a login wall, or a feed exhausted by filters — that group produces no post rows and no summary row rather than a fabricated result. Check the run log for a login-wall, CSRF or rate-limit message if a URL you expect to return posts comes back empty.

#### Can I scrape private or restricted Facebook groups?

No, not without membership. Only public groups are read logged out. To read a private or closed group's posts you must supply a `facebookSessionCookie` for an account that already belongs to that group — the Actor does not bypass group membership or privacy settings.

#### How does pricing work for this Actor?

The Actor charges per `row_result` event — each post row and each per-group summary row pushed to the dataset is one billed event. Filters like `minReactions` and `minEngagementRate` reduce the row count, and therefore the cost, by dropping low-engagement posts before they're pushed.

#### Does Facebook Groups Scraper With Engagement Analytics work for AI agent workflows and LLM pipelines?

Yes. It's callable as an HTTP endpoint by any agent framework, and it's also reachable through Apify's Actors MCP Server as a tool for MCP-compatible clients. Every response is typed JSON with stable field names, so agents can consume post and summary rows without an HTML-parsing step.

#### How does Facebook Groups Scraper With Engagement Analytics handle Facebook's anti-bot system?

Requests always route through Apify's residential proxies, warm up a guest session before requesting group content, and detect and log login walls, CSRF token failures and rate-limit responses instead of silently returning zero posts. The document ID and node ID the GraphQL request needs are rediscovered from the page on every run rather than hard-coded, so routine front-end churn doesn't require a manual fix.

#### Does Facebook Groups Scraper With Engagement Analytics return data in a format LLMs can use directly?

Yes. Every post and summary row is typed, normalized JSON with stable field names — no HTML, no selectors, no reaction icons to classify. Pass rows directly into an LLM context window, index them in a vector store, or route them through an agent tool call.

#### Can I use Facebook Groups Scraper With Engagement Analytics without managing proxies?

Yes. The Actor always uses Apify's residential proxy group for Facebook requests; there's no separate proxy infrastructure to maintain beyond the `proxyConfiguration` field the input schema exposes for advanced overrides.

#### What happens when Facebook changes its structure or blocks the scraper?

The Actor is maintained, and its output schema stays stable — field names and types don't change on your end. The extractor already tries multiple fallback paths for feed data, group title and document ID discovery, so many Facebook front-end changes are absorbed without breaking existing integrations.

### Your feedback

Found a bug, a missing field, or a group type the Actor doesn't handle well? We want to know. Open an issue on the Actor's Apify Store page or reach out through Apify's support channels — reports like this directly shape the next update.

# Actor input Schema

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

One or more public Facebook group URLs to analyze, e.g. https://www.facebook.com/groups/cheapmealideas/. Only public groups can be read without a login cookie. List several groups to benchmark them side by side; each group is scored and summarized separately.

## `postsPerGroup` (type: `integer`):

How many posts to pull from each group before engagement analytics are computed. A larger sample makes averages, rank and percentile more stable. Example: 50. Placeholder is 20.

## `feedSortStrategy` (type: `string`):

Which slice of the group's feed Facebook returns for analysis: CHRONOLOGICAL (newest→oldest), RECENT\_ACTIVITY (most recently active), TOP\_POSTS (most engaged), CHRONOLOGICAL\_LISTINGS (Buy/Sell groups). This decides WHICH posts are sampled; use `sortBy` below to order the analytics output rows.

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

How to order the post rows in the output dataset after analytics are computed: newest (by post time), most\_reactions (by total reactions), or highest\_engagement (reactions + comments + shares). Example: highest\_engagement puts the most engaging posts first.

## `minReactions` (type: `integer`):

Only keep posts with at least this many total reactions (all reaction types combined). Example: 10 drops posts with fewer than 10 reactions. Default 0 (no filter).

## `minEngagementRate` (type: `integer`):

Only keep posts whose engagement rate is at least this value. Engagement rate is relative to the run average: 1 = average, 2 = twice the average engagement. Example: 2 keeps only posts with at least double the average engagement. Default 0 (no filter).

## `textFilterKeyword` (type: `string`):

Keep only posts whose text contains this keyword or letter. This is a local substring match over the sampled feed, not a Facebook search. Without a login cookie, single or double letters work best. Example: "a".

## `yearFilter` (type: `string`):

Keep only posts from a specific year (e.g. 2024). Best combined with the Keyword Text Filter above.

## `postsNewerThan` (type: `string`):

Keep only posts newer than this date/time for the analytics. Absolute: YYYY-MM-DD (e.g. 2024-01-15). Relative: "7 days", "2 weeks", "1 month", "1 year".

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

Proxy configuration. Residential proxies are used automatically for Facebook requests.

## `facebookSessionCookie` (type: `string`):

Optional Facebook session cookie string (must include at least c\_user and xs). Format: c\_user=100000...; xs=12%3A...; datr=...; fr=... . Leave empty for logged-out public-group analysis.

## Actor input object example

```json
{
  "groupUrls": [
    "https://www.facebook.com/groups/cheapmealideas/"
  ],
  "postsPerGroup": 5,
  "feedSortStrategy": "CHRONOLOGICAL",
  "sortBy": "highest_engagement",
  "minReactions": 0,
  "minEngagementRate": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped items in the Actor's default dataset.

# 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/cheapmealideas/"
    ],
    "postsPerGroup": 5,
    "feedSortStrategy": "CHRONOLOGICAL",
    "textFilterKeyword": "",
    "yearFilter": "",
    "postsNewerThan": "",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("api-empire/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 = {
    "groupUrls": ["https://www.facebook.com/groups/cheapmealideas/"],
    "postsPerGroup": 5,
    "feedSortStrategy": "CHRONOLOGICAL",
    "textFilterKeyword": "",
    "yearFilter": "",
    "postsNewerThan": "",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("api-empire/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 '{
  "groupUrls": [
    "https://www.facebook.com/groups/cheapmealideas/"
  ],
  "postsPerGroup": 5,
  "feedSortStrategy": "CHRONOLOGICAL",
  "textFilterKeyword": "",
  "yearFilter": "",
  "postsNewerThan": "",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call api-empire/facebook-groups-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,api-empire/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/AK4pLN7WcKScv40kC/builds/ePfbkvGlI1uHmlgPe/openapi.json
