# Facebook Page Scraper (`datascrapers/facebook-page-scraper`) Actor

Scrape public posts from Facebook pages, with an optional list of people who liked each post.

- **URL**: https://apify.com/datascrapers/facebook-page-scraper.md
- **Developed by:** [Data Scrapers](https://apify.com/datascrapers) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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 Page Scraper** creates a structured dataset of public posts collected from Facebook pages. Each dataset item can include the post id, text, publish time, reaction counts, and the page name. Query the source with page URLs, control the result limit with maxItems, and retrieve records through the Apify Dataset API or export them as JSON, CSV, Excel, XML, or another supported format.

[![Facebook Page Scraper — input to structured data](https://raw.githubusercontent.com/faizanalii/apify-actor-assets/main/facebook-page-scraper/facebook-page-scraper-value-demo.gif)](https://apify.com/datascrapers/facebook-page-scraper)

### Dataset at a glance

| Property | Value |
|---|---|
| Source | facebook.com |
| Record unit | One public page post |
| Input methods | startUrls |
| Main identifiers | postId, url |
| Delivery | Apify Dataset and API |
| Export formats | JSON, CSV, Excel, XML |
| Update model | Fresh records per Actor run |
| Pricing | $1.50 per 1,000 posts on the free plan |

### Coverage and available records

Pass public Facebook page URLs in startUrls. Each post row includes text, publish time, and the public reaction, like, comment, share, and view counts when the page exposes them. The stored Planet Raw example is a reel published on 2026-10-15 with 13 reactions and 12 likes.

Set includeLikers to true to add public liker profiles. Those profiles are a separate profile event, capped by maxLikersPerPost. The Actor does not post, comment, or log into a private account.

### Data dictionary

| Field | Type | Nullable | Description | Example |
|---|---|---:|---|---|
| postId | string | no | Post id. Use this field to deduplicate. | 122296428854169766 |
| url | string | yes | Public post URL. | https://www.facebook.com/reel/1838297883995021/ |
| text | string | yes | Post text. | |
| publishedAt | string | yes | Publish time in ISO 8601. | 2026-10-15T14:44:59+00:00 |
| pageId | string | yes | Page id. | 61555093004368 |
| pageName | string | yes | Page name. | Planet Raw |
| pageUrl | string | yes | Page URL. | |
| reactionCount | number | yes | Public reaction count. | 13 |
| likeCount | number | yes | Public like count. | 12 |
| commentCount | number | yes | Public comment count. | |
| shareCount | number | yes | Public share count. | |
| likers | array | yes | Liker profiles. Present when includeLikers is true. | |

### Example dataset record

```json
{
  "postId": "122296428854169766",
  "url": "https://www.facebook.com/reel/1838297883995021/",
  "publishedAt": "2026-10-15T14:44:59+00:00",
  "pageName": "Planet Raw",
  "pageId": "61555093004368",
  "reactionCount": 13,
  "likeCount": 12
}
```

This is a stored public reel from the Planet Raw page. The saved row also includes the post text.

### Query and input reference

| Input | Type | Required | Default | Accepted values | Description |
|---|---|---:|---|---|---|
| startUrls | array | no | empty | page URLs | Facebook page URLs. |
| maxItems | integer | no | schema default | positive integer | Post cap. |
| includeLikers | boolean | no | false | true or false | Collect public liker profiles. |
| maxLikersPerPost | integer | no | schema default | positive integer | Liker cap per post. |
| maxConcurrency | integer | no | schema default | positive integer | Parallel page reads. |
| proxyConfiguration | object | no | Apify proxy off | Apify proxy input | Optional proxy. |

Minimal request:

```json
{"startUrls": [{"url": "https://www.facebook.com/planetraw.my"}], "maxItems": 5}
```

### Retrieve the data through the API

Start the Actor with JSON input, wait for the run, then read the default dataset.

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("datascrapers/facebook-page-scraper").call(run_input={
    "startUrls": [{"url": "https://www.facebook.com/planetraw.my"}],
    "maxItems": 5,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["postId"], item.get("reactionCount"))
```

### Data quality and record handling

Deduplicate on postId. Counts are the public figures at request time. likers is omitted unless includeLikers is true. A hidden count stays null rather than zero.

### Pricing and cost examples

Pay per event. post is $1.50 per 1,000 on Free, $1.40 on Bronze, $1.30 on Silver, and $1.20 on Gold. profile is $2.00, $1.90, $1.80, and $1.70 per 1,000 on those plans. Platinum and Diamond use the Gold price. Platform usage is included. Saving 1,000 posts without likers costs $1.50 on Free. Each saved liker profile adds a profile event.

### Limitations and responsible data use

The Actor reads public page posts. It does not publish or message. Facebook can hide counts or block a session. Use the data in line with Facebook terms.

### Dataset questions

#### What is one record?

One public page post, keyed by postId.

#### Which field should I use to deduplicate?

postId.

#### Are likers included by default?

No. Set includeLikers to true. Those rows are billed as profile events.

### Related datasets from Data Scrapers

- [Instagram Hashtag Scraper](https://apify.com/datascrapers/instagram-hashtag-scraper)
- [Reddit Scraper](https://apify.com/datascrapers/reddit-scraper)
- [YouTube Channel Scraper](https://apify.com/datascrapers/youtube-channel-scraper)
- [Trustpilot Scraper](https://apify.com/datascrapers/trustpilot-scraper)

### Data Scrapers support

Questions about this dataset: stardustspotlight@gmail.com.

# Actor input Schema

## `startUrls` (type: `array`):

Public Facebook page URLs. Profile links such as facebook.com/pagename and profile.php?id= are accepted. Several pages are scraped at the same time.

## `maxItems` (type: `integer`):

Maximum number of posts to extract across all pages. Use 0 for no limit.

## `includeLikers` (type: `boolean`):

When enabled, each post includes people who reacted to it: like, love, or any other reaction. Each profile is a separate charge. Leave this off to scrape posts only.

## `maxLikersPerPost` (type: `integer`):

Cap on liker profiles saved for each post when likers are enabled. Use 0 for no cap.

## `maxConcurrency` (type: `integer`):

How many page URLs to scrape at the same time.

## `proxyConfiguration` (type: `object`):

Proxy used for page requests. Residential proxies are the default.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/planetraw.my"
    }
  ],
  "maxItems": 30,
  "includeLikers": false,
  "maxLikersPerPost": 20,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset of scraped posts.

## `runStats` (type: `string`):

Post count, liker count, and run timestamps.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.facebook.com/planetraw.my"
        }
    ],
    "maxItems": 30,
    "includeLikers": false,
    "maxLikersPerPost": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascrapers/facebook-page-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 = {
    "startUrls": [{ "url": "https://www.facebook.com/planetraw.my" }],
    "maxItems": 30,
    "includeLikers": False,
    "maxLikersPerPost": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("datascrapers/facebook-page-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 '{
  "startUrls": [
    {
      "url": "https://www.facebook.com/planetraw.my"
    }
  ],
  "maxItems": 30,
  "includeLikers": false,
  "maxLikersPerPost": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call datascrapers/facebook-page-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datascrapers/facebook-page-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/pTdguPM5zUlH2SaeJ/builds/64nVO5LKRaXfoeRai/openapi.json
