# Facebook Scraper — Pages, Groups & Profiles (`smrtai-ops/facebook-scraper`) Actor

Extract posts, reactions, comments, and shares from any public Facebook Page, Group, or Profile — all in one tool. 10x faster with cursor pagination. No API key or login needed. Ideal for market research, social listening. AI training, and competitor analysis.

- **URL**: https://apify.com/smrtai-ops/facebook-scraper.md
- **Developed by:** [Smrt AI](https://apify.com/smrtai-ops) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 5 total users, 3 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

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

## Facebook Scraper — Pages, Groups & Profiles

Extract posts, reactions, comments, and shares from any public Facebook Page, Group, or Profile — all in one tool. No API key or login required for public content.

### What does Facebook Scraper do?

Facebook's official API severely restricts access to Page and Group data. This scraper bypasses those limitations with a high-speed extraction engine that delivers **reliable, structured data in seconds**.

**Why pay for 3 separate scrapers?** Most competitors sell Pages, Groups, and Profiles as separate tools. Ours combines all three with a single, faster engine.

#### ✅ Key Features

| Feature | Description |
|---|---|
| **All-in-One** | Pages + Groups + Profiles in a single tool |
| **High-Speed Engine** | Optimized extraction — faster than traditional scrapers |
| **Public Pages** | Scrape any public Facebook Page feed |
| **Public Groups** | Extract posts from open Facebook Groups |
| **Profile Scraping** | Collect public posts from user timelines |
| **Smart Sessions** | Efficient session reuse across multiple targets |
| **Anti-Detection** | Residential proxy support + stealth browsing |
| **No Login Required** | Works with public content — no Facebook API key needed |

### Pricing

| Plan | Price | What you get |
|---|---|---|
| **Free** | $0 | Use your Apify free credits (~2,000 results/month) |
| **Basic** | **$1 per 1,000 results** | Pages + Groups + Profiles |
| **Enterprise** | Contact us | Archive mode, bulk scraping, monitoring, dedicated support |

> 💡 **One tool, three scrapers.** Competitors charge separately for Pages, Groups, and Profiles. Ours delivers all three from one actor.

### How to Scrape Facebook

No coding skills required:

1. **Create** a free Apify account
2. **Open** the Facebook Scraper
3. **Add** one or more Facebook Page names, Group IDs, or Profile usernames
4. **Select** the target type (Page, Group, or Profile)
5. **Click "Start"** and wait for results
6. **Download** your data in JSON, CSV, XML, Excel, or HTML format

### Use Cases

- 📊 **Brand Monitoring** — Track engagement and reactions on Facebook Pages in real-time
- 🔍 **Competitor Analysis** — Monitor competitor page activity and audience sentiment
- 💡 **Pain Point Detection** — Find complaints, feature requests, and frustrations in public Groups
- 📈 **Content Research** — Analyze top-performing post formats, topics, and engagement patterns
- 🤖 **AI & LLM Training** — Gather real-world social media data for model fine-tuning
- 📋 **Lead Generation** — Extract author data from Groups for outreach campaigns

### Input Examples

#### Scrape a Facebook Page
```json
{
    "targets": ["NASA"],
    "target_type": "page",
    "limit": 20
}
````

#### Scrape a Public Group

```json
{
    "targets": ["groups/169822606822288"],
    "target_type": "group",
    "limit": 50,
    "days_limit": 30
}
```

#### Scrape Multiple Targets

```json
{
    "targets": ["NASA", "SpaceX", "ESA"],
    "target_type": "page",
    "limit": 20
}
```

### Input Parameters

| Parameter | Type | Description | Default |
|---|---|---|---|
| `targets` | Array | Facebook Page names, Group IDs, or Profile usernames | Required |
| `target_type` | String | Type of target: `page`, `group`, or `profile` | `page` |
| `limit` | Integer | Max posts per target (1–500) | `20` |
| `days_limit` | Integer | Stop scraping posts older than N days (1–365) | `90` |
| `proxy` | Object | Proxy configuration (residential recommended) | Apify Proxy |

### Output

Each post is returned as a structured JSON object:

```json
{
    "post_id": "pfbid02abc123",
    "post_url": "https://www.facebook.com/NASA/posts/pfbid02abc123",
    "author_name": "NASA",
    "content": "Today we announced a new mission to Mars...",
    "reaction_count": 45200,
    "comment_count": 1823,
    "share_count": 12500,
    "created_at": "2026-05-01T14:30:00Z",
    "image_urls": ["https://scontent.facebook.com/..."],
    "source_platform": "facebook",
    "target_type": "page",
    "scrape_mode": "feed",
    "scraped_at": "2026-05-15T10:00:00Z"
}
```

#### Data Extracted

| Field | Description |
|---|---|
| `post_id` | Unique Facebook post identifier |
| `post_url` | Direct URL to the post |
| `author_name` | Name of the post author |
| `content` | Full text content of the post |
| `reaction_count` | Total reactions (likes, love, etc.) |
| `comment_count` | Number of comments |
| `share_count` | Number of shares |
| `created_at` | Post creation timestamp (ISO 8601) |
| `image_urls` | Array of attached image URLs |

### Performance

| Metric | Value |
|---|---|
| **First Target** | ~25 seconds (session setup) |
| **Additional Targets** | ~5 seconds per 10 posts |
| **3 targets × 20 posts** | ~50 seconds total |
| **Memory** | Recommended 2048–4096 MB |

### Tips for Best Results

1. For Groups, use the numeric Group ID (e.g., `groups/169822606822288`)
2. For Pages, use the page username (e.g., `NASA`, `apifytech`)
3. Set `days_limit` to control how far back the scraper goes
4. Use residential proxies for best reliability
5. Keep `limit` under 100 for optimal performance

### FAQ

#### Is Facebook login required?

No. This scraper works with **public content only** and does not require any Facebook credentials or API keys.

#### Can I scrape private groups?

No. Only public groups with open visibility are supported.

#### How is this different from other Facebook scrapers?

Most scrapers sell Pages, Groups, and Profiles as **separate actors**. Ours combines all three in one tool — saving you time and money.

### Enterprise & Custom Solutions

Need high-volume scraping, custom integrations, or dedicated support?

- 🗄️ **Archive mode** for deep historical data extraction
- 🔄 **Monitoring mode** for real-time alerts on new posts
- 🔗 **API integration** with your data pipeline
- 📞 **Priority support**

Contact us for enterprise pricing and custom solutions.

### Limitations

- Only **public** content is accessible without authentication
- Facebook may temporarily rate-limit requests during high-volume scraping
- Some Pages with restricted regions may not be accessible

# Actor input Schema

## `targets` (type: `array`):

Facebook URLs or names to scrape. Example: NASA, groups/169822606822288

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

What kind of Facebook target are you scraping

## `limit` (type: `integer`):

Maximum number of posts to extract from each target

## `days_limit` (type: `integer`):

Stop fetching posts older than this many days

## `proxy` (type: `object`):

Select the proxy to use. Residential proxies are recommended for Facebook.

## Actor input object example

```json
{
  "targets": [
    "NASA"
  ],
  "target_type": "page",
  "limit": 20,
  "days_limit": 90,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "targets": [
        "NASA"
    ],
    "target_type": "page",
    "limit": 20,
    "days_limit": 90,
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("smrtai-ops/facebook-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 = {
    "targets": ["NASA"],
    "target_type": "page",
    "limit": 20,
    "days_limit": 90,
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("smrtai-ops/facebook-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 '{
  "targets": [
    "NASA"
  ],
  "target_type": "page",
  "limit": 20,
  "days_limit": 90,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call smrtai-ops/facebook-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Scraper — Pages, Groups & Profiles",
        "description": "Extract posts, reactions, comments, and shares from any public Facebook Page, Group, or Profile — all in one tool. 10x faster with cursor pagination. No API key or login needed. Ideal for market research, social listening. AI training, and competitor analysis.",
        "version": "1.0",
        "x-build-id": "fGfeVvFHJa1Z7Tqg4"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/smrtai-ops~facebook-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-smrtai-ops-facebook-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/smrtai-ops~facebook-scraper/runs": {
            "post": {
                "operationId": "runs-sync-smrtai-ops-facebook-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/smrtai-ops~facebook-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-smrtai-ops-facebook-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": [
                    "targets"
                ],
                "properties": {
                    "targets": {
                        "title": "Targets",
                        "type": "array",
                        "description": "Facebook URLs or names to scrape. Example: NASA, groups/169822606822288",
                        "items": {
                            "type": "string"
                        }
                    },
                    "target_type": {
                        "title": "Target Type",
                        "enum": [
                            "page",
                            "group",
                            "profile"
                        ],
                        "type": "string",
                        "description": "What kind of Facebook target are you scraping",
                        "default": "page"
                    },
                    "limit": {
                        "title": "Posts per Target",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of posts to extract from each target",
                        "default": 20
                    },
                    "days_limit": {
                        "title": "Days Limit",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Stop fetching posts older than this many days",
                        "default": 90
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select the proxy to use. Residential proxies are recommended for Facebook."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
