# Facebook Groups Scraper (`api-ninja/facebook-groups-scraper`) Actor

📘 Extract Facebook group posts, future events, and group details from one or more group URLs, handles, or IDs.

- **URL**: https://apify.com/api-ninja/facebook-groups-scraper.md
- **Developed by:** [API ninja](https://apify.com/api-ninja) (community)
- **Categories:** Social media, Automation, Developer tools
- **Stats:** 41 total users, 37 monthly users, 94.2% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

### What does Facebook Groups Scraper do?

**Facebook Groups Scraper** helps you extract **group posts**, **future events**, and **group details** from Facebook groups using a simple input of URLs, handles, or numeric group IDs. It is built for people who want structured Facebook group data without building their own extraction workflow.

Paste one or more Facebook group references such as `https://www.facebook.com/groups/874728723021553`, `https://www.facebook.com/groups/stolvik`, `874728723021553`, or `stolvik`, choose the data you want, and run the Actor. You can use it on the [Apify platform](https://apify.com/platform) with API access, scheduling, monitoring, dataset export, and integrations.

### Why use Facebook Groups Scraper?

Facebook groups contain active discussions, local communities, buy-and-sell activity, hobby groups, event promotion, and niche audience signals that are hard to track manually at scale.

Use this Actor when you want to:

- Track new posts in public Facebook groups
- Collect upcoming events shared in Facebook groups
- Monitor group growth signals such as member count and privacy
- Build lead lists, research communities, or follow category-specific conversations
- Export group data to JSON, CSV, Excel, or connect it to your automation stack

Compared to manual browsing, this Actor gives you repeatable, structured output that is easier to search, filter, and reuse.

### How to use Facebook Groups Scraper

1. Open the Actor in Apify Console.
2. In the **Input** tab, add one or more Facebook group URLs, handles, or IDs.
3. Choose **Data to Extract**:
   - `Group Posts`
   - `Group Future Events`
   - `Group Details`
4. If you selected posts, optionally choose the post sort order.
5. Set **Maximum Results per Group** or enable **Parse All Results**.
6. Run the Actor.
7. Open the **Output** tab to view results, or download the dataset in your preferred format.

### Input

The Actor accepts the following main input fields:

- **Facebook Group URLs, Handles, or IDs**: one or more group references
- **Data to Extract**: posts, future events, or group details
- **Post Sort Order**: applies only to post extraction
- **Maximum Results per Group**: limits saved posts or events
- **Parse All Results**: keeps paginating until no more posts or events are available

Example input:

```json
{
  "urls": [
    "https://www.facebook.com/groups/gieldagryplanszowe",
    "stolvik",
    "874728723021553"
  ],
  "type": "posts",
  "sort": "CHRONOLOGICAL",
  "maxResults": 100,
  "parseAllResults": false
}
````

### Output

The output depends on the selected extraction mode.

#### Example output for group posts

```json
[
  {
    "post_id": "4365215547053891",
    "type": "post",
    "url": "https://www.facebook.com/groups/gieldagryplanszowe/posts/4365215547053891/",
    "message": "Witam :) Poszukuję do swojej kolekcji dodatku Turbo: Widzenie tunelowe.",
    "timestamp": 1777713816,
    "comments_count": 0,
    "reactions_count": 0,
    "reshare_count": 0,
    "associated_group_id": "1439220986320043"
  }
]
```

#### Example output for future events

```json
[
  {
    "type": "search_event",
    "event_id": "1252523000374875",
    "title": "Game Con XIX",
    "url": "https://www.facebook.com/events/1252523000374875/",
    "day_time_sentence": "Sat, 2 May at 08:00 MDT"
  }
]
```

#### Example output for group details

```json
[
  {
    "id": "1571965316444595",
    "name": "Colorado Springs Music, Karaoke, Concerts & Events",
    "url": "https://www.facebook.com/groups/1571965316444595",
    "privacy": "Public group",
    "members_count": 7200
  }
]
```

You can download the dataset in various formats such as **JSON, HTML, CSV, or Excel**.

### Data table

| Field | Description |
| --- | --- |
| `post_id` | Unique Facebook post ID |
| `message` | Post text content |
| `timestamp` | Post publication timestamp |
| `comments_count` | Number of comments on a post |
| `reactions_count` | Number of reactions on a post |
| `event_id` | Unique Facebook event ID |
| `title` | Event title |
| `day_time_sentence` | Human-readable event time string |
| `id` | Facebook group ID |
| `name` | Group name |
| `privacy` | Group privacy label |
| `members_count` | Group member count |

### Pricing / Cost estimation

How much does it cost to scrape Facebook group data?

That depends mainly on:

- how many groups you process
- whether you extract posts, events, or details
- how many paginated results you request

If you only need a few groups and a modest number of results, the cost is typically low. Group details are usually the lightest mode, while post and event extraction can cost more when **Parse All Results** is enabled.

For the best cost control:

- start with a few groups
- keep `maxResults` modest during testing
- enable full pagination only when you really need complete coverage

### Tips and advanced options

- Use **Group Details** first if you want a quick health check of many groups.
- Use **Latest (Most Recent)** sorting when monitoring fresh posts.
- Use **Top (Most Popular)** sorting when you care more about visibility and engagement than recency.
- If you are testing multiple groups, begin with a low `maxResults` value to validate output structure.
- If you need recurring monitoring, schedule the Actor in Apify and send results to your app through the API or integrations.

### FAQ, disclaimers, and support

#### Does this Actor support group URLs, handles, and numeric IDs?

Yes. You can provide full Facebook group URLs, plain handles, or plain numeric group IDs.

#### Does sort work for every extraction mode?

No. Sorting only applies to **Group Posts**. Future events and group details use the format returned by the source endpoint.

#### Can I extract all results?

Yes. Enable **Parse All Results** to keep paginating until there are no more results available for posts or future events.

#### Are there any limitations?

Yes. Available fields and result volume depend on the Facebook group and the data exposed by the source. Some groups or result types may provide less information than others.

#### Is it okay to collect Facebook group data?

Make sure your use complies with the target website’s terms, applicable law, and your own internal privacy or compliance rules.

#### Where can I get help or request improvements?

Use the **Issues** tab on the Actor page to report bugs, request improvements, or share feature ideas. If you need a custom workflow or tailored output structure, a custom version can be built on top of this Actor.

# Actor input Schema

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

Add one or more Facebook group references. You can paste a full group URL, a group handle such as stolvik, or a numeric group ID. Personal profiles and Facebook pages are not supported.

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

Choose whether to extract group posts, upcoming events, or the group profile details.

## `sort` (type: `string`):

Choose how to sort posts. This setting applies only when Data to Extract is set to Group Posts.

## `maxResults` (type: `integer`):

Choose how many items to save for each group. Applies to posts and future events. Ignored when Parse All Results is enabled.

## `parseAllResults` (type: `boolean`):

When enabled, the Actor keeps paginating until there are no more posts or future events available. Group Details always returns a single result per group.

## Actor input object example

```json
{
  "urls": [
    "https://www.facebook.com/groups/gieldagryplanszowe"
  ],
  "type": "posts",
  "sort": "CHRONOLOGICAL",
  "maxResults": 20,
  "parseAllResults": false
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://www.facebook.com/groups/gieldagryplanszowe"
    ]
};

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Groups Scraper",
        "description": "📘 Extract Facebook group posts, future events, and group details from one or more group URLs, handles, or IDs.",
        "version": "0.0",
        "x-build-id": "sOvixfBKyUE8aJclq"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/api-ninja~facebook-groups-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-api-ninja-facebook-groups-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/api-ninja~facebook-groups-scraper/runs": {
            "post": {
                "operationId": "runs-sync-api-ninja-facebook-groups-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/api-ninja~facebook-groups-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-api-ninja-facebook-groups-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "🔗 Facebook Group URLs, Handles, or IDs",
                        "type": "array",
                        "description": "Add one or more Facebook group references. You can paste a full group URL, a group handle such as stolvik, or a numeric group ID. Personal profiles and Facebook pages are not supported.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "type": {
                        "title": "🧩 Data to Extract",
                        "enum": [
                            "posts",
                            "future_events",
                            "group_details"
                        ],
                        "type": "string",
                        "description": "Choose whether to extract group posts, upcoming events, or the group profile details.",
                        "default": "posts"
                    },
                    "sort": {
                        "title": "⇅ Post Sort Order",
                        "enum": [
                            "CHRONOLOGICAL",
                            "TOP_POSTS"
                        ],
                        "type": "string",
                        "description": "Choose how to sort posts. This setting applies only when Data to Extract is set to Group Posts.",
                        "default": "CHRONOLOGICAL"
                    },
                    "maxResults": {
                        "title": "Maximum Results per Group",
                        "minimum": 20,
                        "type": "integer",
                        "description": "Choose how many items to save for each group. Applies to posts and future events. Ignored when Parse All Results is enabled.",
                        "default": 20
                    },
                    "parseAllResults": {
                        "title": "Parse All Results",
                        "type": "boolean",
                        "description": "When enabled, the Actor keeps paginating until there are no more posts or future events available. Group Details always returns a single result per group.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
