# Facebook Profiles and Pages Scraper (`devninja/facebook-profiles-pages-scraper`) Actor

This actor extracts comprehensive data from Facebook profiles and pages quickly. Collect posts, comments, reactions, and media from public Facebook profiles and pages with advanced filtering, date range selection, and smart anti-bot detection for reliable data extraction.

- **URL**: https://apify.com/devninja/facebook-profiles-pages-scraper.md
- **Developed by:** [Devinja](https://apify.com/devninja) (community)
- **Categories:** Automation, Social media, Integrations
- **Stats:** 142 total users, 2 monthly users, 0.0% runs succeeded, 4 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Facebook Profiles and Pages Scraper

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-blue?logo=apify)](https://apify.com)
[![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org/)

This actor extracts comprehensive data from Facebook profiles and pages quickly. Collect posts, comments, reactions, and media from public Facebook profiles and pages with advanced filtering, date range selection, and smart anti-bot detection for reliable data extraction.

### **Key Features**

- **Fast and Efficient**: Collects Facebook profile and page data quickly without slowing down
- **Comprehensive Data**: Gathers posts, comments, reactions, author details, images, and engagement metrics
- **Scalable**: Designed to handle large volumes of profile data smoothly
- **Reliable for Business Use**: Built to run consistently with smart error handling

### Use Cases

- **Social Media Monitoring**: Track brand mentions and profile activity
- **Market Research**: Analyze competitor profiles and engagement patterns
- **Content Analysis**: Study successful posts and engagement strategies
- **Competitor Intelligence**: Monitor competitor social media presence
- **Academic Research**: Collect data for social science studies
- **Influencer Analysis**: Identify high-engagement profiles and content

### Sample Output

```json
[
    {
        "post_id": "752211920250854",
        "type": "post",
        "url": "https://www.facebook.com/story.php?story_fbid=752211920250854&id=100063861587219&_rdr",
        "message": "🌙 Midnight Cravings Alert! 🌙\n\nIndulge in a foodie's dream at Food Market Manila's Midnight Breakfast Buffet in the heart of BGC! 🍽️ For just 499 pesos, you can savor mouthwatering Filipino dishes ALL YOU CAN! 🇵🇭✨\n\nGather your friends and family, and join us for a gastronomic adventure under the stars. 🌟",
        "timestamp": 1755594566,
        "comments_count": 30,
        "reactions_count": 64,
        "reshare_count": 21,
        "author": {
            "id": "100063861587219",
            "name": "The Food Market Manila",
            "url": "https://www.facebook.com/FoodMarketManila",
            "profile_picture_url": ""
        },
        "image": null,
        "images": null,
        "reactions": {
            "angry": 0,
            "care": 1,
            "haha": 0,
            "like": 37,
            "love": 22,
            "sad": 0,
            "wow": 4
        },
        "video": {
            "id": "999820931139886",
            "title": "Video",
            "url": "https://www.facebook.com/FoodMarketManila/videos/999820931139886/",
            "is_live_streaming": false,
            "__typename": "Video"
        },
        "comments": [
            {
                "id": "comment123",
                "author_name": "John Doe",
                "author_id": "123456789",
                "text": "Looks amazing! Will definitely try this.",
                "timestamp": 1755594800,
                "reactions_count": 5
            }
        ],
        "profile_info": {
            "account_type": "business",
            "is_verified": false,
            "page_category": "Restaurant",
            "followers_count": 15420
        }
    }
]
```

### Input Parameters

| Property           | Description                                                                               |
|--------------------|-------------------------------------------------------------------------------------------|
| `urls`             | Array of Facebook profile/page URLs to scrape.                                           |
| `max_results`      | Maximum number of posts to extract per profile (up to 1000).                             |
| `webhook_url`      | URL where results will be sent after scraping completes (optional).                      |
| `webhook_token`    | Bearer token for webhook authentication (optional but recommended).                      |
| `webhook_method`   | HTTP method to use when sending data to webhook (`POST` or `PUT`).                       |

### Related Actors

Explore our comprehensive suite of data extraction and AI-powered tools:

#### 📄 Facebook & Social Media Scrapers

##### [Facebook Post Scraper](https://apify.com/devninja/facebook-post-scraper)

[![Rating](https://img.shields.io/badge/Rating-5.0-green)](https://apify.com/devninja/facebook-post-scraper)

This actor helps you collect Facebook posts quickly. Extract public posts from Facebook pages, profiles, and groups with keyword-based filtering, date range selection, and smart anti-bot detection for reliable data extraction.

##### [Facebook Comments Scraper | Webhook Support](https://apify.com/devninja/facebook-comments-scraper-webhook-support)

[![Rating](https://img.shields.io/badge/Rating-5.0-green)](https://apify.com/devninja/facebook-comments-scraper-webhook-support)

This actor is designed for businesses, teams, and individuals—supporting video URLs, post URLs, photo URLs, and reels—without the hassle of manual scraping or complex setups, making it perfect for analyzing conversations, monitoring engagement, and gathering insights from Facebook.

##### [Facebook Profiles and Pages Scraper](https://apify.com/devninja/facebook-profiles-pages-scraper)

[![Rating](https://img.shields.io/badge/Rating-5.0-green)](https://apify.com/devninja/facebook-profiles-pages-scraper)

This actor provides a powerful data extraction tool for collecting posts, comments, reactions, and media from public Facebook profiles and pages. Perfect for social media analysis, content research, and market intelligence.

##### [Facebook Groups Scraper](https://apify.com/devninja/facebook-groups-scraper)

[![Rating](https://img.shields.io/badge/Rating-5.0-green)](https://apify.com/devninja/facebook-groups-scraper)

Extract posts, reactions, and media from public Facebook groups for social media analysis and market research.

#### 📄 AI-Powered Tools

##### [AI Facebook Post Analyzer](https://apify.com/devninja/ai-facebook-post-analyzer)

[![Rating](https://img.shields.io/badge/Rating-5.0-green)](https://apify.com/devninja/ai-facebook-post-analyzer)

This actor transforms Facebook posts into actionable business insights. Search for posts about any topic, analyze them with AI, and get intelligent answers to your business questions. Perfect for market research, brand monitoring, trend analysis, and competitive intelligence.

##### [AI Document Assistant](https://apify.com/devninja/ai-document-assistant)

[![Rating](https://img.shields.io/badge/Rating-5.0-green)](https://apify.com/devninja/ai-document-assistant)

This actor analyzes uploaded documents using AI to extract and process information. It helps businesses quickly get answers from their documents and automate decision-making.

##### [AI Humor and Quotes Generator](https://apify.com/devninja/ai-humor-quotes-generator)

[![Rating](https://img.shields.io/badge/Rating-5.0-green)](https://apify.com/devninja/ai-humor-quotes-generator)

Generate original jokes, inspirational quotes, or a mix of both based on your keywords. Perfect for content creators, social media managers, greeting cards, presentations, and entertainment apps. Uses advanced prompt engineering to create family-friendly, engaging content.

#### 📄 Specialized Scrapers

##### [Streem Article Scraper](https://apify.com/devninja/streem-article-scraper)

[![Rating](https://img.shields.io/badge/Rating-5.0-green)](https://apify.com/devninja/streem-article-scraper)

Extract full-text articles and metadata from Streem article links with ease. This actor is built for reliability and scalability—simply provide a list of Streem URLs, and it will crawl each page, clean the content, and return structured results.

***

*All actors are developed by [Devinja](https://apify.com/devninja) and maintained with regular updates for optimal performance and reliability.*

# Actor input Schema

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

List of Facebook profile/page URLs to scrape

## `max_results` (type: `integer`):

Maximum number of posts to scrape per profile

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

URL where results will be sent after scraping completes (optional)

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

Bearer token for webhook authentication (optional but recommended)

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

HTTP method to use when sending data to webhook

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://www.facebook.com/IRONMANtri",
      "method": "GET"
    }
  ],
  "max_results": 15,
  "webhook_url": "https://your-api.com/webhook",
  "webhook_token": "your-secret-token",
  "webhook_method": "POST"
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("devninja/facebook-profiles-pages-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("devninja/facebook-profiles-pages-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 '{}' |
apify call devninja/facebook-profiles-pages-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devninja/facebook-profiles-pages-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/DuZNBAIwLAuAflo9b/builds/JJmA6j38C1U3ZofzF/openapi.json
