# Facebook Group Scraper: All-in-One (`scraper-fleet/facebook-group-scraper`) Actor

Facebook Group Scraper: All-in-One extracts Facebook group posts, comments, members, profiles, and engagement data for research and lead generation. 高效抓取 Facebook 群组帖子、评论、成员、个人资料及互动数据，助力市场研究与精准获客。

- **URL**: https://apify.com/scraper-fleet/facebook-group-scraper.md
- **Developed by:** [Scraper Fleet](https://apify.com/scraper-fleet) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 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

### What is Facebook Group Scraper? · Facebook 群组数据采集

![What is Facebook Group Scraper? · Facebook 群组数据采集](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-03970cbc5521a563.svg)
**Facebook Group Scraper** collects accessible **Facebook group posts**, optional comments, group information, and administrator or moderator profiles in structured datasets. Choose a collection mode, provide group URLs or a search query, and use the Apify input form to prepare a small first run without writing code. It helps community teams and researchers turn group activity into searchable records instead of manually copying posts into spreadsheets.

The four operations serve different tasks: `posts` reads group feeds, `group_info` collects group details, `members` lists available admins and moderators, and `search` discovers groups by keyword. Posts, group info, and administrator collection do not require a supplied Facebook login cookie; search does. Residential proxy configuration is enabled by default because the Actor needs it for reliable requests from Apify's cloud infrastructure.

中文说明：本工具支持群组帖子、基础信息、管理员与版主资料，以及关键词搜索。`members` 不代表完整成员名单；搜索需要你自己的登录 Cookie。先选择操作，再填写对应输入，运行后可导出数据或通过 API 读取。

### Why use Facebook Group Scraper? · 功能与平台优势

![Why use Facebook Group Scraper? · 功能与平台优势](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-c6fce831a457480b.svg)
The Actor gives you several collection workflows through one input interface. Apify supplies the cloud execution, storage, scheduling, and integration tools around those workflows.

- **Choose the data you need.** Collect posts for discussion analysis, group details for a directory, or admin profiles for understanding community management.
- **Control post collection.** Select a sort order and apply date filters rather than manually scrolling through an entire feed.
- **Add conversation context.** Keep the top comment by default, or request up to 20 top-level comments per post.
- **Reuse one list of group URLs.** Switch between supported URL-based operations without designing a separate scraper for each data type.
- **Use residential proxy routing.** The default configuration directs requests through Apify Proxy; request retries help with temporary connection failures.
- **Retrieve structured records.** Download JSON, CSV, or Excel from the dataset, or use the API for downstream processing.
- **Schedule recurring runs.** Apify scheduling can revisit the same inputs at a chosen interval, while webhooks notify another workflow when a run finishes.
- **Inspect run status.** Console logs, usage details, and stored datasets help you understand which runs produced useful results.

This combination is useful when you want a repeatable Facebook group data workflow without maintaining your own server. Target-site changes can still affect extraction, so monitor results and contact our team when a previously working input changes behavior.

#### Select a mode before choosing a workflow

For a discussion report, start with posts and keep the publication time, post URL, text, and engagement data. For a community directory, start with group info and compare descriptions and available member counts. For group search, use a focused search query with your own authenticated session. These modes return different row shapes, so separate their datasets or add the operation name in your downstream storage.

### How to scrape Facebook groups step by step · 快速开始

![How to scrape Facebook groups step by step · 快速开始](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-618a817b1c185abb.svg)
Start with one accessible group and a low result limit. This makes it easier to review the output before collecting from several groups or adding comment enrichment.

1. Open [Facebook Group Scraper](https://apify.com/scraper-fleet/facebook-group-scraper) and sign in to Apify.
2. Choose `posts` in the Operation field for your first feed collection.
3. Paste a group URL into `urls`. Use a group you can inspect on Facebook so you can compare the resulting records with the visible page.
4. Set `maxPosts` to a small number, such as five. The limit applies across all supplied groups combined.
5. Keep `sortingOrder` at `newest_posts` for a recent-post sample. Leave date filters empty until you confirm the basic input works.
6. Keep the residential `proxyOptions` configuration. Leave `cookie` empty for this operation.
7. Click Start, review the run status, and open its dataset when collection finishes.
8. Compare a returned post URL, text, and time with the source, then download the results or connect a downstream workflow.

#### Add date filters after the first sample

Use `postsNewerThan` to set the beginning of a publication window and `postsOlderThan` to set its end. Relative values such as `2 days` suit recurring recent-activity collection; absolute dates suit a report covering a fixed period. Use explicit ISO timestamps when the exact time boundary matters.

When several group URLs share one `maxPosts` budget, an earlier group can consume the limit before later groups contribute records. If you need a comparable sample from each community, run groups separately with the same settings. Raising the shared limit does not guarantee equal representation from every URL.

#### Collect group information or administrators

Switch to `group_info` when you need descriptions, privacy labels, available total counts, and rules. Switch to `members` when you need the identified admins and moderators that the group exposes. The same group URL input works for both modes, but their output structures differ from post records.

For an optional exact total count in members mode, supply your own Facebook cookie. That count does not unlock collection of ordinary group members. 中文提示：帖子数量上限是所有群组共用的；如果需要每个群组相同数量的样本，请分别运行。

### Facebook Group Scraper input parameters · 输入参数

![Facebook Group Scraper input parameters · 输入参数](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-14fe16484557936c.svg)

![Facebook Group Scraper input parameters · 输入参数](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-0f3c0fb331e50869.svg)
The [input form](https://console.apify.com/actors/nzmFpQ4sHWncQTD1c/input) shows the current field descriptions. Only `operation` is required across the schema; the selected operation determines which other inputs are needed.

| Parameter | Description | Required | Example |
| --- | --- | --- | --- |
| `operation` | Select posts, group details, admin/moderator profiles, or search | Yes | `posts` |
| `urls` | Group URLs or numeric group IDs | For posts, group_info, members | `https://www.facebook.com/groups/claudeaicommunity` |
| `searchQuery` | Keywords for group search | For search | `urban gardening` |
| `maxPosts` | Total post limit across supplied groups; default 20 | No; posts only | `5` |
| `maxItems` | Item limit for members or search; default 20 | No | `10` |
| `maxRetries` | Request retry setting, default 3; range 1–10 | No | `3` |
| `sortingOrder` | Feed ordering: newest_posts, newest_activity, most_relevant | No; posts only | `newest_posts` |
| `postsNewerThan` | Lower publication-time boundary | No; posts only | `2 days` |
| `postsOlderThan` | Upper publication-time boundary | No; posts only | `2026-11-01` |
| `includeTopComment` | Include a single top comment; default true | No; posts only | `true` |
| `fetchAllComments` | Collect up to 20 top-level comments per post; default false | No; posts only | `false` |
| `cookie` | Your authenticated Facebook session | Required for search; optional count enrichment for members | Enter privately in the secret field |
| `proxyOptions` | Residential Apify Proxy configuration used by default | Retain for platform runs | `RESIDENTIAL` group |

Illustrative input for a small post collection:

```json
{
  "operation": "posts",
  "urls": ["https://www.facebook.com/groups/claudeaicommunity"],
  "maxPosts": 5,
  "sortingOrder": "newest_posts",
  "includeTopComment": true,
  "fetchAllComments": false,
  "proxyOptions": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

#### Date windows, sorting, and scanning limits

![Date windows, sorting, and scanning limits](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-78927e9386d4f0d4.svg)
Sort order controls the feed requested from Facebook; it does not produce an exhaustive ranking of every historical post. Date filters select records from the pages the Actor visits. The feed implementation has safeguards of 500 pages and 3,000 scanned posts, so a very narrow historical filter can finish without finding the requested number of results.

Check that the newer boundary comes before the older boundary. For the newest activity view, an older post can reappear because discussion is active, while its publication timestamp remains old. Choose newest posts when your report is primarily about publication dates.

#### When a cookie is needed

Search needs a logged-in Facebook session because anonymous group-search requests are rejected. The input accepts a Cookie header value or a supported Cookie-Editor JSON export from your own browser session. Provide it through the secret input field, and replace it when your session expires.

There is no login cookie requirement for basic posts, group info, or exposed admins and moderators. This describes the Actor's input requirements, not universal access to every group. Visibility, Facebook restrictions, and connection behavior still determine what a run can retrieve.

### Facebook Group Scraper output examples · 数据输出

![Facebook Group Scraper output examples · 数据输出](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-99dee537af42aba0.svg)

![Facebook Group Scraper output examples · 数据输出](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-dbc357bd43026931.svg)
The Actor returns mode-specific dataset records. The following post example uses fictional text and identities to illustrate the structure for the group URL in the input; it is not a captured conversation.

```json
{
  "facebookUrl": "https://www.facebook.com/groups/claudeaicommunity",
  "url": "https://www.facebook.com/groups/claudeaicommunity/posts/1234567890123456/",
  "id": "1234567890123456",
  "time": "2026-11-07T09:30:00.000Z",
  "text": "Illustrative discussion about organizing a shared project.",
  "user": {
    "id": "100000000000001",
    "name": "Example Contributor",
    "url": "https://www.facebook.com/profile.php?id=100000000000001",
    "type": "User"
  },
  "likesCount": 12,
  "sharesCount": 1,
  "commentsCount": 4,
  "topComments": [
    {
      "id": "1234567890123457",
      "text": "Illustrative comment about the proposed workflow.",
      "author": {
        "id": "100000000000002",
        "name": "Example Participant",
        "url": "https://www.facebook.com/profile.php?id=100000000000002"
      },
      "time": "2026-11-07T10:00:00.000Z",
      "likesCount": 2,
      "repliesCount": 0,
      "feedbackId": "EXAMPLE_FEEDBACK"
    }
  ],
  "isVideo": false
}
```

#### How to read post fields

`facebookUrl` identifies the group, while `url` identifies the individual post. Preserve both when combining results from multiple communities. `time` represents the publication time when available, and `text` contains the extracted post body. The nested `user` object holds available author details.

`likesCount`, `sharesCount`, and `commentsCount` are separate engagement measures. Missing values should remain missing instead of becoming zero automatically. `topComments` contains collected comment objects when comment extraction succeeds; it may be null when there is no comment data. `isVideo` identifies a video attachment without downloading a video file.

Additional source fields include identifiers, attachment references, and compatibility fields that can be null. Their presence does not promise marketplace prices, location extraction, or complete video-view statistics. Build your report around the fields relevant to the selected operation.

#### Group info, members, and search records

Group info records include `groupUrl`, `groupId`, `description`, `privacyLabel`, `totalMembersCount`, `postsLastDay`, `rules`, and available administrator statistics. Members records contain `groupUrl`, a nested `member` profile, optional `groupMemberCount`, and collection time. The member object can include id, name, profileUrl, role, verification status, and profile image.

Search records include id, name, url, visibility, and `memberInfo`, plus available picture and post-frequency text. Member information in a search snippet is descriptive text, which may be rounded; it should not be treated as an exact count without checking its representation.

Use JSON to retain nested authors and comments. CSV and Excel are convenient for a post-level report, but configure selected fields or flatten nested objects in your downstream workflow. A spreadsheet with one row per comment requires your own transformation from the post's comment array.

For that transformation, copy the parent post ID, group URL, and post time onto each comment row before expanding the array. This keeps a comment connected to its original discussion after filtering or sorting the spreadsheet. Retain the comment's own ID and timestamp separately, since publication times for the post and its comments are different. Keep posts with no collected comments in the post table so the comment export does not silently remove them from your activity report.

### Facebook Group Scraper use cases · 应用场景

![Facebook Group Scraper use cases · 应用场景](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-a26609bce1a6c0d8.svg)

#### Community reporting and social listening

Community teams use post text, publication times, and comments to understand recurring questions or feedback. A weekly collection can feed a review sheet where staff classify topics and link back to the original discussion. The Actor provides records; topic labeling and sentiment analysis belong in your own analysis workflow.

For social listening, keep the group URL and collection date alongside each post. That context helps distinguish a newly published discussion from an older post revisited in another run. Comment samples add context, but they do not represent the complete conversation or every participant's opinion.

#### Market research across selected communities

Researchers can compare discussion themes in groups relevant to a product or service. Start with a defined group list and consistent date filters, then use the same post limit and sort order for comparable samples. Group descriptions and available membership figures help document why each community was included.

Facebook groups differ in size, moderation, and posting frequency. A dataset collected from several groups is a sample of accessible activity, not a survey of all Facebook users. Report the groups, time window, and collection settings alongside findings so another analyst can interpret the scope.

#### Group directories and partnership planning

Group info can populate a directory containing descriptions, privacy labels, rules, and source links. Administrator and moderator records can help a team understand who manages a community before proposing a relevant partnership. Review group rules and use appropriate public contact channels.

For lead generation, focus on qualifying communities and understanding relevant topics. This Actor does not extract an ordinary-member contact database or private contact information. Do not infer email addresses or outreach permission from a profile URL or participation in a discussion.

#### Application and spreadsheet workflows

Developers can store post IDs and source URLs in a database, combine repeated collections, and build a dashboard around observed activity. Spreadsheet users can export a dataset and review post text or engagement counts without learning the request logic. Keep mode-specific tables separate, and deduplicate repeated post IDs when scheduled collections overlap.

### How much does Facebook group scraping cost? · 价格

![How much does Facebook group scraping cost? · 价格](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-2c07e7fa410b3491.svg)
The Actor uses pay-per-event pricing. Result-event charges vary by your Apify plan, and platform resource usage is paid separately. Current USD rates, checked on November 8, 2026:

| Plan tier | Result event | 1,000 result events |
| --- | --- | --- |
| Free | $0.00300 | $3.00 |
| Bronze | $0.00285 | $2.85 |
| Silver | $0.00255 | $2.55 |
| Gold, Platinum, Diamond | $0.00240 | $2.40 |

The start event costs $0.00005 per GB of allocated memory, with a minimum of one event. At an illustrative 1 GB allocation, five result events on the Free tier cost $0.015 plus $0.00005 to start: $0.01505 in Actor event charges. Compute, proxy traffic, storage, and other platform usage are additional. Check the run's actual memory allocation when estimating its start charge.

In posts mode, collected comments are nested in post records rather than billed as separate dataset rows. In members mode, each emitted admin or moderator record is a result. Larger comment requests can still increase request traffic and runtime even when the number of post result events is unchanged.

#### Is Facebook group scraping free?

Apify's [Free plan](https://apify.com/pricing) includes $5 in monthly usage credit, with no credit card required to sign up. This Actor still has result and start events, and accounts without a paid plan are capped at 20 results per run. Credit availability, platform charges, and the run cap are separate constraints.

Start with a small input and review the usage breakdown before adding more groups. Check the [Pricing tab](https://apify.com/scraper-fleet/facebook-group-scraper/pricing) before a larger job. A 1,000-result calculation illustrates unit pricing; it is not a promise that an unpaid account can collect that many records in one run.

### Facebook Group Scraper API and automation · API 与自动化

![Facebook Group Scraper API and automation · API 与自动化](https://api.apify.com/v2/key-value-stores/PT8o6tOhdQ7oR8sdl/records/readme-31a806b27020c98e.svg)
The [API tab](https://apify.com/scraper-fleet/facebook-group-scraper/api) provides the Actor's programmatic interface. The [Apify Python client](https://docs.apify.com/api/client/python/docs/quick-start) can start a run with the same input fields and retrieve its dataset:

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("scraper-fleet/facebook-group-scraper").call(
    run_input={
        "operation": "posts",
        "urls": ["https://www.facebook.com/groups/claudeaicommunity"],
        "maxPosts": 5,
        "includeTopComment": True,
    }
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("url"), item.get("text"))
```

Executing this example starts a charged run. Keep the token in your application's environment, and provide any required Facebook cookie through a protected configuration rather than putting it in shared code.

#### Scheduling, webhooks, and integrations

Use Apify scheduling for recurring collections. Relative date filters are useful for a moving window, while fixed dates preserve a specific reporting interval. Overlap consecutive windows when appropriate, then deduplicate by post ID in your own storage so a post appearing in two runs is counted once.

Configure a run-completion webhook to trigger processing after successful collection. Zapier, Make, n8n, and Google Sheets workflows can retrieve dataset items and route them to a spreadsheet, database, or notification channel. These are platform workflows you configure; the Actor itself does not send every result to an external application automatically.

#### Copy to your AI assistant · 复制给 AI 助手

```text
Help me use scraper-fleet/facebook-group-scraper on Apify. Read https://apify.com/scraper-fleet/facebook-group-scraper and its input instructions. I want a small sample of accessible group posts with their top comments. Prepare the input, explain the shared post limit, and show how to export the dataset. Do not interpret members as a full member roster. Ask before starting a charged run. Keep API tokens and cookies private. 可以用中文解释，JSON 字段保持英文。
```

An assistant needs browsing or connected tools to retrieve documentation or act on your account. Copying the prompt helps it understand the task; it does not create a connection by itself.

#### Facebook Group Scraper MCP server · MCP 连接

Select this Actor when connecting an MCP-capable client to Apify:

```text
https://mcp.apify.com?tools=scraper-fleet/facebook-group-scraper
```

Complete the client's supported Apify authentication flow and follow the [MCP setup documentation](https://docs.apify.com/platform/integrations/mcp). A compatible client can expose the Actor's input schema to its assistant. Executing the Actor tool starts a normal run with the same prerequisites, limits, and charges; connecting does not grant access to every Facebook group.

### More scrapers by Scraper Fleet · 更多工具

| Actor | Complementary task |
| --- | --- |
| [Zhihu Scraper](https://apify.com/scraper-fleet/zhihu-scraper) | Collect supported Zhihu answers, articles, comments, and trends with your own cookie |
| [Bilibili Video Scraper](https://apify.com/scraper-fleet/bilibili-video-scraper) | Collect video statistics and optional top-level comments for Chinese video research |
| [TikTok Video Downloader](https://apify.com/scraper-fleet/tiktok-video-downloader) | Save authorized TikTok videos as MP4 files with metadata and download links |

### Facebook Group Scraper FAQ · 常见问题

#### Can I collect every member of a Facebook group?

No. Members mode returns the admins and moderators exposed by the group information endpoint. An optional authenticated cookie can add an exact total member count when available, but the ordinary-member roster is outside the implemented collection scope.

#### Does search return every matching group?

Group search parses the first results page. `maxItems` limits saved results from that page; raising it does not enable additional search-page pagination. Use specific queries and review the returned group links before selecting communities for further collection.

#### Does fetchAllComments include all replies?

The setting collects up to 20 top-level comments per post. It does not retrieve nested replies or guarantee every comment. A comment's `repliesCount` can describe available reply volume without the replies themselves appearing in the dataset.

#### Why did a run return fewer posts than requested?

A result limit is a maximum. Visibility restrictions, an exhausted feed, date filters, scan safeguards, unavailable pages, or request failures can reduce the final count. Test one group with empty date filters, inspect the run log, and verify the residential proxy configuration before widening the input.

#### Does this replace Facebook's official API?

The Actor collects through Facebook web requests and exposes its own Apify API interface. It is not an official Meta API or a promise of permissions available through Meta's products. Compare the data you need, your approved access method, and applicable platform terms before choosing a collection approach.

#### Can I schedule it and export to Excel?

Yes. Apify schedules can run saved input repeatedly, and datasets support Excel, CSV, and JSON exports. Preserve post IDs and source links across scheduled runs, and choose JSON when you need nested comment or author objects intact.

#### What happens when Facebook changes its layout?

A website change can affect parsing, identifiers, or request behavior. Check the run output and logs, then report the affected operation and a redacted example through this Actor's Issues tab. Our team can investigate; no fixed update frequency or automatic repair time is promised here.

### Is it legal to scrape Facebook groups? · 数据与合规

Legality depends on the jurisdiction, data, access method, purpose, and applicable terms. Facebook Group Scraper uses web requests, with your authenticated session required for search and optional for member-count enrichment. Public visibility alone does not establish permission to collect, redistribute, or use personal data commercially.

Review [Facebook's terms](https://www.facebook.com/terms.php), group rules, and applicable privacy requirements, including GDPR or CCPA where relevant. Group posts, names, and profile links can contain personal data. Limit collection to an appropriate purpose, protect access to stored results, and avoid publishing private session credentials or sensitive discussion content. Commercial reuse requires its own assessment of permissions and rights.

### Need help with Facebook Group Scraper? · 联系我们

[Contact our team through the Actor's Issues tab](https://apify.com/scraper-fleet/facebook-group-scraper/issues) for troubleshooting, feature requests, or a custom version. Include the operation, a suitable group URL, expected output, and a redacted error or run reference. Never include a Facebook cookie or API token in a public issue.

For custom work, describe the collection scope, result fields, frequency, and destination. Tell us whether you need a community directory, a recurring post report, or a downstream integration so we can discuss the workflow directly with you. 中文用户也可以通过 Issues 联系我们的团队，说明操作类型、所需字段和问题现象即可。

# Actor input Schema

## `operation` (type: `string`):

What to scrape. posts/group_info/members work WITHOUT a cookie. 选择要执行的操作。posts/group_info/members 无需 Cookie 即可使用。

## `urls` (type: `array`):

posts / group_info / members: one or more Facebook group URLs or numeric group IDs. 适用于上述三种操作，填入小组链接或纯ID。

## `searchQuery` (type: `string`):

search only. Requires the Cookie field below (Facebook 404s group search for anonymous requests). 仅用于 search，需要下方 Cookie 字段。

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

posts only. Total cap across all group URLs combined, not per group. 仅用于 posts，跨所有小组的总上限。

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

members / search only. 仅用于 members 和 search。

## `maxRetries` (type: `integer`):

Retries for a single failed HTTP request before giving up on it. 单个请求失败后的重试次数。

## `sortingOrder` (type: `string`):

posts only. 仅用于 posts。

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

posts only. Relative ("2 days", "1 month") or absolute (YYYY-MM-DD / ISO timestamp). Leave empty for no filter. 仅用于 posts，支持相对或绝对时间。

## `postsOlderThan` (type: `string`):

posts only. Same format as above. 仅用于 posts。

## `includeTopComment` (type: `boolean`):

posts only: fetch each post's single top comment. 仅用于 posts，获取每条帖子的一条热评。

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

posts only: fetch up to 20 top-level comments per post instead of just the top one. Comment replies are not supported. 仅用于 posts，每条帖子最多获取 20 条一级评论。

## `cookie` (type: `string`):

Paste a `Cookie:` header string (DevTools → Network → any www.facebook.com request → Copy as cURL, take the -b/--cookie value) OR a Cookie-Editor/EditThisCookie JSON export, from a logged-in facebook.com session. Leave empty for posts/group_info, or for members without an exact total count. 登录后从浏览器导出的 Cookie。

## `proxyOptions` (type: `object`):

Apify Proxy configuration. Defaults to Residential, which this Actor needs on the Apify platform.

## Actor input object example

```json
{
  "operation": "posts",
  "urls": [
    "https://www.facebook.com/groups/claudeaicommunity"
  ],
  "maxPosts": 20,
  "maxItems": 20,
  "maxRetries": 3,
  "sortingOrder": "newest_posts",
  "includeTopComment": true,
  "fetchAllComments": false,
  "proxyOptions": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `mainDatasetId` (type: `string`):

No description

## `viewApiUrl` (type: `string`):

No description

# 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 = {
    "operation": "posts",
    "urls": [
        "https://www.facebook.com/groups/claudeaicommunity"
    ],
    "maxPosts": 20,
    "maxItems": 20,
    "proxyOptions": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-fleet/facebook-group-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 = {
    "operation": "posts",
    "urls": ["https://www.facebook.com/groups/claudeaicommunity"],
    "maxPosts": 20,
    "maxItems": 20,
    "proxyOptions": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("scraper-fleet/facebook-group-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 '{
  "operation": "posts",
  "urls": [
    "https://www.facebook.com/groups/claudeaicommunity"
  ],
  "maxPosts": 20,
  "maxItems": 20,
  "proxyOptions": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call scraper-fleet/facebook-group-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scraper-fleet/facebook-group-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/nzmFpQ4sHWncQTD1c/builds/0wRG1Gkmkb4jDlsQV/openapi.json
