# Facebook Pages Scraper (`caprolok/facebook-pages-scraper`) Actor

📘 Unlock the power of social media with Facebook Post Scraper! Extract detailed insights from posts, including likes 👍, comments 💬, shares 🔁, and more. Download in JSON, CSV, Excel. Perfect for market research, trend analysis, and competitive monitoring. 🚀

- **URL**: https://apify.com/caprolok/facebook-pages-scraper.md
- **Developed by:** [Caprolok](https://apify.com/caprolok) (community)
- **Categories:** Social media, SEO tools
- **Stats:** 1,178 total users, 6 monthly users, 100.0% runs succeeded, 16 bookmarks
- **User rating**: 2.19 out of 5 stars

## Pricing

$40.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

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

## 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 Page Scraper

### 🚀 What is Facebook Page Scraper?

Facebook Page Scraper is an advanced tool designed to meticulously extract data from Facebook pages, providing a wealth of information for various applications. This tool is indispensable for those looking to tap into the rich vein of data available on Facebook for enhancing applications, reports, and research. Whether it's for market research or trend analysis, Facebook Page Scraper delivers the insights you need in accessible formats such as JSON, CSV, and Excel.

### 🛠 Enhanced Features

Facebook Page Scraper offers an array of features that extend beyond simple data extraction, offering deep insights into page dynamics and user interactions. The key features include:

- 📄 **Page Content:** Dive into the content of pages to understand messaging trends, user engagement, and content strategy.
- 🔗 **Page URL:** Direct links to the pages for in-depth analysis and easy reference.
- 🕒 **Timestamp:** Track the timing of page updates to identify patterns and peak activity times.
- 👍 **Engagement Metrics:** Get a detailed look into the interaction dynamics with metrics such as:
  - ❤️ **Likes Count:** Assess the popularity and appeal of pages.
  - 💬 **Comments Count:** Gauge audience engagement and feedback on page posts.
  - 🔁 **Shares Count:** Understand the virality and reach of the page's content.
  - 👀 **Video View Count:** For pages with video content, get view counts to evaluate content reach and viewer engagement.
- 🗂 **Detailed Page Insights:** Extract comprehensive information about the pages including bio, category, and follower count.
- 📊 **Customizable Data Export:** Export data in formats like JSON, CSV, and Excel, ensuring compatibility with various tools and workflows.

### 🎯 Why Choose Facebook Page Scraper?

Facebook Page Scraper is your go-to tool for a range of analytical and strategic applications:

- 🕵️‍♂️ **Competition Monitoring:** Monitor competitors' Facebook strategies, engagement levels, and audience interactions to stay ahead.
- 🔍 **Market Research:** Extract detailed data from pages to uncover market trends, consumer preferences, and industry insights.
- 📈 **Trend Analysis:** Identify trending topics and sentiments across Facebook to inform your content and marketing strategies.
- 📡 **Social Media Analysis:** Conduct thorough analyses to detect misinformation, track engagement trends, and understand overall content performance on pages.

### 📋 Easy to Start

Kickstart your data extraction journey with Facebook Page Scraper effortlessly:

1. Open the Facebook Page Scraper tool.
2. Enter the URL(s) of the Facebook page(s) you wish to analyze.
3. Click "Save & Start" to initiate the data extraction process.
4. Download the compiled data in your preferred format to analyze and integrate into your projects.

### 🌟 Transform Your Data Insights

Elevate your projects and strategies with comprehensive insights from Facebook with the Facebook Page Scraper. Begin leveraging the vast data on Facebook pages today to make informed decisions that propel your success.

# Actor input Schema

## `profile_urls` (type: `array`):

Enter a valid Facebook page URL, e.g. https://www.facebook.com/KFC. Note that you can only scrape public pages with this actor, not personal profiles.

## `post_urls` (type: `array`):

Enter a valid Facebook post URL, e.g. https://www.facebook.com/KFC/posts/pfbid024T3kAGQP4U9idufad1nH5eP94FX2vvoVcbFHHvyNF4G2xnMuG1QFAcirwRLAPerWl.

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

If this limit is not set, by default 15 posts will be returned

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

Scrapes post from the provided date to the present day (or date set in 'Older than'). The date should be in YYYY-MM-DD format.

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

Scrapes post from the provided date to the past (or date set in 'Newer than'). The date should be in YYYY-MM-DD format.

## Actor input object example

```json
{
  "profile_urls": [
    {
      "url": "https://www.facebook.com/KFC"
    },
    {
      "url": "https://www.facebook.com/McDonalds"
    }
  ],
  "post_urls": [
    {
      "url": "https://www.facebook.com/KFC/posts/pfbid024T3kAGQP4U9idufad1nH5eP94FX2vvoVcbFHHvyNF4G2xnMuG1QFAcirwRLAPerWl"
    },
    {
      "url": "https://www.facebook.com/KFC/posts/pfbid0zLkXSow3WwA2eo3Tr1DkiKYwgK13YEYDkCeYUw21CdujXRnH8PYWVzyLAwgPQAbSl"
    }
  ],
  "max_results": 15
}
```

# 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 = {
    "profile_urls": [
        {
            "url": "https://www.facebook.com/KFC"
        },
        {
            "url": "https://www.facebook.com/McDonalds"
        }
    ],
    "post_urls": [
        {
            "url": "https://www.facebook.com/KFC/posts/pfbid024T3kAGQP4U9idufad1nH5eP94FX2vvoVcbFHHvyNF4G2xnMuG1QFAcirwRLAPerWl"
        },
        {
            "url": "https://www.facebook.com/KFC/posts/pfbid0zLkXSow3WwA2eo3Tr1DkiKYwgK13YEYDkCeYUw21CdujXRnH8PYWVzyLAwgPQAbSl"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("caprolok/facebook-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 = {
    "profile_urls": [
        { "url": "https://www.facebook.com/KFC" },
        { "url": "https://www.facebook.com/McDonalds" },
    ],
    "post_urls": [
        { "url": "https://www.facebook.com/KFC/posts/pfbid024T3kAGQP4U9idufad1nH5eP94FX2vvoVcbFHHvyNF4G2xnMuG1QFAcirwRLAPerWl" },
        { "url": "https://www.facebook.com/KFC/posts/pfbid0zLkXSow3WwA2eo3Tr1DkiKYwgK13YEYDkCeYUw21CdujXRnH8PYWVzyLAwgPQAbSl" },
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("caprolok/facebook-pages-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 '{
  "profile_urls": [
    {
      "url": "https://www.facebook.com/KFC"
    },
    {
      "url": "https://www.facebook.com/McDonalds"
    }
  ],
  "post_urls": [
    {
      "url": "https://www.facebook.com/KFC/posts/pfbid024T3kAGQP4U9idufad1nH5eP94FX2vvoVcbFHHvyNF4G2xnMuG1QFAcirwRLAPerWl"
    },
    {
      "url": "https://www.facebook.com/KFC/posts/pfbid0zLkXSow3WwA2eo3Tr1DkiKYwgK13YEYDkCeYUw21CdujXRnH8PYWVzyLAwgPQAbSl"
    }
  ]
}' |
apify call caprolok/facebook-pages-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/iKRDqb590bAYWxy4q/builds/VJOJn1ipgdyNEeAcf/openapi.json
