# Facebook Public Group Directory & Discovery (`xyrelith-data/fb-group-directory-scraper`) Actor

Find public Facebook groups by keyword or location and enrich each one from its public About page: exact member count, posts today and last month, creation date, privacy, rules, description, location tags and contact links. Cookieless, no login, automatic proxy.

- **URL**: https://apify.com/xyrelith-data/fb-group-directory-scraper.md
- **Developed by:** [Xyrelith Data](https://apify.com/xyrelith-data) (community)
- **Categories:** Social media, Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

## Facebook Public Group Directory & Discovery

Find public Facebook groups for any topic, city or niche and turn them into a clean, filterable directory. Every row is read from the group's logged-out public About page, so you get exact member counts, current activity, creation dates, privacy and visibility, rules, location tags and contact details without a Facebook account, cookies or a browser.

Use it to map communities in a market, build partnership or outreach lists, research where a topic is discussed, compare group activity, or collect moderation and rules data at scale.

### What you get

One row per group, de-duplicated by Facebook's numeric group ID. Empty values are omitted, never filled with placeholders.

| Field | What it contains |
|---|---|
| `groupId` | Numeric Facebook group ID |
| `groupName` | Group name |
| `groupUrl` | Stable canonical group URL |
| `aboutUrl` | Public About URL |
| `vanitySlug` | Human-readable group slug when the group uses one |
| `privacy` / `privacyType` | Facebook's privacy label and a normalized `public` / `private` value |
| `visibility` / `visibilityType` | Facebook's visibility label and a normalized `visible` / `hidden` value |
| `memberCount` | Exact member count parsed from the displayed total |
| `memberCountFormatted` | The member total exactly as Facebook displays it |
| `postsToday` | Posts in the last day reported by Facebook |
| `postsLastMonth` | Posts in the last month reported by Facebook |
| `createdAt` / `createdAtTimestamp` | Group creation date in ISO 8601 and Unix time |
| `description` | Public group description |
| `rules` | Rule title and full text for each published rule |
| `locations` | Location tags shown on the About page |
| `tags` | Topic tags shown on the About page |
| `adminNames` / `adminCount` | Public admin names and admin count when Facebook exposes them |
| `profileImageUrl` | Profile image, copied to stable storage by default |
| `coverImageUrl` | Cover image, copied to stable storage by default |
| `profileImageUrlOriginal` / `coverImageUrlOriginal` | Original Facebook CDN image URLs |
| `websites` | Outside websites published in the description or rules |
| `emails` | Email addresses published in the description or rules |
| `searchKeyword` | Keyword that found the group |
| `discoverySource` | Public source that found the group |
| `scrapedAt` | When the row was collected |

### Inputs

| Input (`field`) | Default | What it does |
|---|---|---|
| `searchQueries` | – | One or more topics. Each keyword is searched separately. Add a city, country or niche in the same line for a qualified search. |
| `groupUrls` | – | Direct group URLs, vanity URLs, numeric IDs, share links or Facebook group-search URLs. These are enriched even without a keyword. |
| `location` | – | Optional city, country or region appended to every keyword. |
| `maxResults` | `100` | Hard cap for the whole run. |
| `maxGroupsPerKeyword` | `50` | Stops a keyword after this many matching groups. |
| `maxSearchPages` | `2` | Widens the candidate pool when one page is not enough. |
| `discoverySources` | `["duckduckgo","bing","yahoo","facebook_catalog","slug_guess"]` | Public web indexes and the Facebook public category catalog. |
| `privacy` | `any` | Keep any group, public groups only, or private groups only. |
| `minMemberCount` | `0` | Drop groups below an exact member count. |
| `minPostsLastMonth` | `0` | Keep only groups active at or above the threshold. |
| `requireKeywordMatch` | `true` | Keep only groups whose name, description, rules, tags or locations contain every word of the keyword. |
| `mustContainKeyword` | – | An extra phrase that must appear in the group details. |
| `rehostImages` | `true` | Copy signed image URLs into stable storage. Turn it off for a faster, smaller run. |

### Examples

#### Discover public groups for a topic

```json
{
  "searchQueries": ["python developers"],
  "privacy": "public",
  "maxResults": 50,
  "minMemberCount": 1000,
  "minPostsLastMonth": 5
}
```

#### Qualified local search

```json
{
  "searchQueries": ["real estate investors"],
  "location": "Dubai",
  "maxGroupsPerKeyword": 30,
  "requireKeywordMatch": true
}
```

#### Enrich groups you already know

```json
{
  "groupUrls": [
    "https://www.facebook.com/groups/python/",
    "2249498416",
    "https://www.facebook.com/share/g/1ABCdEfGhI/"
  ],
  "rehostImages": true
}
```

Paste several keywords or URLs on separate lines in the input form. A group found by two keywords, or through both a vanity and a numeric URL, is returned once.

### How discovery works

The actor combines several logged-out public sources:

- public web indexes restricted to Facebook group URLs;
- Facebook's public group category pages;
- direct validation of likely group slugs when a keyword is very specific;
- any direct URLs, IDs or share links you provide.

Each candidate is then read from its public About page, filtered, and de-duplicated by numeric group ID. The discovery source and the keyword that found the group are kept on the row, so you can see where each result came from.

### FAQ

**Do I need a Facebook account, cookies or a proxy?**
No. The actor reads only logged-out public pages and selects its connections automatically. You do not need to configure a proxy.

**Does it return private groups?**
Yes, when their public About page is visible. Facebook shows the name, size, description, rules and activity of many private groups to logged-out visitors; only the posts are restricted. Use the privacy filter to keep public groups only.

**Why are some fields missing on a row?**
Facebook does not publish every field for every group. The actor omits a field instead of inventing a value. Exact member counts, activity, rules, locations, images and contacts are all optional on Facebook.

**Why did I get fewer groups than I asked for?**
The keyword-match and activity filters remove off-topic or inactive groups. Facebook also rate-limits bursts of About-page reads. Try a broader keyword, fewer filters, more search pages, or feed exact group URLs.

**Is the member count exact?**
Yes. It is parsed from the total-members text Facebook displays, for example `76,766 total members`. If Facebook does not display an exact total, the numeric field is omitted and the formatted text may still be present.

**What do `postsToday` and `postsLastMonth` mean?**
They are Facebook's own counts for the last day and last month at the time of the run. They are activity snapshots, not a full post archive.

**Can I search in any language or country?**
Yes. Discovery is keyword-driven, so you can use localized keywords and add a city or country as a qualifier. Field labels and descriptions come back in the language Facebook serves.

**Are the images permanent?**
By default the profile and cover images are copied into the run's key-value store and returned as stable links. The original signed Facebook URLs are retained in the `...Original` fields.

**Does it collect posts or comments?**
No. This actor is a group directory and profile enricher. It reads group-level public data, not the post feed.

### Limits

- Group discovery depends on public web indexes and Facebook's public category pages. Facebook's own group search is not available to logged-out visitors, so very new or unindexed groups can be missed.
- Secret groups are not discoverable outside the group.
- Activity counts and member totals are whatever Facebook shows publicly; they can change between runs.
- Facebook rate-limits repeated About-page requests. The actor retries with fresh connections, but a very large run may return fewer groups than requested.
- Location is a search qualifier and a location tag, not a strict geographic boundary.

### Data source

All data comes from public, logged-out Facebook pages and public search indexes. No Facebook account is used, no login is performed and no private content is accessed. You are responsible for using the data in line with Facebook's terms and applicable privacy law.

# Actor input Schema

## `searchQueries` (type: `array`):

One keyword or topic per line. Each query is searched with public web indexes restricted to Facebook group URLs, then every candidate is checked against its public About page. Add a city, country or niche in the same line for a location-qualified search.

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

Direct group URLs, vanity URLs, numeric group IDs, share links or Facebook group-search URLs. These are enriched even when no keyword is given.

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

Optional city, country or region appended to every search keyword. Example: `Miami` or `Kenya`.

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

Hard cap on the number of enriched group rows returned by the whole run.

## `maxGroupsPerKeyword` (type: `integer`):

Stop enriching candidates for a keyword after this many matching groups.

## `maxSearchPages` (type: `integer`):

How many public web-index pages to read for each keyword (1-5). One page is usually enough; more pages widen the candidate pool.

## `discoverySources` (type: `array`):

Which public discovery sources to use: `duckduckgo`, `bing`, `yahoo`, `facebook_catalog` (public Facebook category pages) or `slug_guess` (direct validation of likely group slugs).

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

Keep any group, only public groups, or only private groups. Private groups expose their public About page; only their posts are hidden.

## `minMemberCount` (type: `integer`):

Drop groups below this exact member count. Set 0 to keep every group.

## `minPostsLastMonth` (type: `integer`):

Drop groups with fewer posts in the last month than this. Set 0 to keep every group.

## `requireKeywordMatch` (type: `boolean`):

Keep only groups whose name, description, rules, tags or locations contain every word of the search keyword. Turn this off for broader discovery.

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

Extra phrase that must appear in the group name, description, rules, tags or locations. Leave empty to skip this check.

## `rehostImages` (type: `boolean`):

Copy signed Facebook image URLs into this run's key-value store so the links stay accessible after Facebook's signed URL expires.

## Actor input object example

```json
{
  "searchQueries": [
    "python developers"
  ],
  "groupUrls": [],
  "maxResults": 1,
  "maxGroupsPerKeyword": 1,
  "maxSearchPages": 1,
  "discoverySources": [
    "duckduckgo",
    "bing",
    "slug_guess"
  ],
  "privacy": "public",
  "minMemberCount": 0,
  "minPostsLastMonth": 0,
  "requireKeywordMatch": true,
  "rehostImages": false
}
```

# Actor output Schema

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

Dataset containing every discovered and enriched public group.

# 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 = {
    "searchQueries": [
        "python developers"
    ],
    "groupUrls": [],
    "maxResults": 1,
    "maxGroupsPerKeyword": 1,
    "maxSearchPages": 1,
    "discoverySources": [
        "duckduckgo",
        "bing",
        "slug_guess"
    ],
    "privacy": "public",
    "minMemberCount": 0,
    "minPostsLastMonth": 0,
    "requireKeywordMatch": true,
    "rehostImages": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("xyrelith-data/fb-group-directory-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 = {
    "searchQueries": ["python developers"],
    "groupUrls": [],
    "maxResults": 1,
    "maxGroupsPerKeyword": 1,
    "maxSearchPages": 1,
    "discoverySources": [
        "duckduckgo",
        "bing",
        "slug_guess",
    ],
    "privacy": "public",
    "minMemberCount": 0,
    "minPostsLastMonth": 0,
    "requireKeywordMatch": True,
    "rehostImages": False,
}

# Run the Actor and wait for it to finish
run = client.actor("xyrelith-data/fb-group-directory-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 '{
  "searchQueries": [
    "python developers"
  ],
  "groupUrls": [],
  "maxResults": 1,
  "maxGroupsPerKeyword": 1,
  "maxSearchPages": 1,
  "discoverySources": [
    "duckduckgo",
    "bing",
    "slug_guess"
  ],
  "privacy": "public",
  "minMemberCount": 0,
  "minPostsLastMonth": 0,
  "requireKeywordMatch": true,
  "rehostImages": false
}' |
apify call xyrelith-data/fb-group-directory-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xyrelith-data/fb-group-directory-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/LZXFu5nLZIKtELud7/builds/AQ6WlRues4YjcphOa/openapi.json
