# Facebook Pages Scraper (`powerful_bachelor/facebook-posts-scraper`) Actor

Unlock the power of Facebook data with 📘 Facebook Pages Scraper! Dive deep into page analytics, trends, and audience engagement. Curious what insights are hidden in plain sight? Let's explore together!!
Output rich with data! 🙌

- **URL**: https://apify.com/powerful_bachelor/facebook-posts-scraper.md
- **Developed by:** [Powerful Bachelor](https://apify.com/powerful_bachelor) (community)
- **Categories:** SEO tools
- **Stats:** 186 total users, 0 monthly users, 100.0% runs succeeded, 7 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

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

[![Actor status](https://apify.com/actor-badge?actor=powerful_bachelor/Facebook-Posts-Scraper)](https://apify.com/powerful_bachelor/Facebook-Posts-Scraper)

### 🚀 Introduction to Facebook Pages Scraper

The Facebook Pages Scraper is a sophisticated utility for extracting comprehensive data from Facebook pages, crucial for enhancing various projects, reports, and analytical work. It serves as an essential resource for those aiming to utilize the extensive data available on Facebook for market research, trend analysis, and more, delivering actionable insights in formats like JSON, CSV, and Excel.

### 🛠 Key Features

With its broad range of functionalities, the Facebook Pages Scraper goes beyond mere data extraction to provide deep insights into page activities and audience engagement. Its main features include:

- 📄 **Content Analysis:** Explore the narratives, user engagement, and content strategies of Facebook pages.
- 🔗 **Direct Page Links:** Easily access pages for comprehensive study and reference.
- 🕒 **Update Timings:** Observe the scheduling of posts to pinpoint activity trends and peak times.
- 👍 **Interaction Metrics:** Delve into the metrics of user interactions, including:
  - ❤️ **Likes:** Measure the page's popularity and appeal.
  - 💬 **Comments:** Evaluate audience response and engagement with posts.
  - 🔁 **Shares:** Analyze the content's virality and reach.
  - 👀 **Video Views:** For video content, examine the reach and engagement through view counts.
- 🗂 **In-Depth Page Insights:** Obtain detailed data on pages, such as bio, category, and followers.
- 📊 **Flexible Data Export:** Choose from JSON, CSV, and Excel formats for data export, compatible with diverse analytical tools.

### 🎯 Benefits of Using Facebook Pages Scraper

The Facebook Pages Scraper is indispensable for various analytical and strategic needs:

- 🕵️‍♂️ **Competitive Analysis:** Keep an eye on the Facebook strategies and audience engagements of your competitors.
- 🔍 **Market Insights:** Extract and analyze page data to discern market trends, consumer preferences, and industry dynamics.
- 📈 **Trend Discovery:** Identify and analyze trending topics and sentiments on Facebook for strategic content planning.
- 📡 **Social Media Monitoring:** Conduct detailed analyses for detecting misinformation, tracking engagement trends, and assessing content performance.

### 📋 Getting Started

Begin your data extraction journey with the Facebook Pages Scraper in a few simple steps:

1. Launch the Facebook Pages Scraper.
2. Input the URL(s) of the Facebook page(s) you're interested in.
3. Hit "Save & Start" to begin extracting data.
4. Download your data in the preferred format for your analysis and integration needs.

### 🌟 Enhance Your Data Insights

Boost your projects and strategies with in-depth data insights from Facebook using the Facebook Pages Scraper. Start tapping into the wealth of information available on Facebook pages to make well-informed decisions that drive your success forward.

# 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
}
```

# 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 = {
    "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("powerful_bachelor/facebook-posts-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("powerful_bachelor/facebook-posts-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 '{
  "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 powerful_bachelor/facebook-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,powerful_bachelor/facebook-posts-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/GKmW7aq3Bq5PUBMEe/builds/4t4gafHvaLhjolWFR/openapi.json
