# Facebook Page Posts Scraper (`automation-lab/facebook-pages-posts-scraper`) Actor

Extract public Facebook Page posts, Page identity, post text, media links, timestamps when exposed, and visible engagement for brand monitoring.

- **URL**: https://apify.com/automation-lab/facebook-pages-posts-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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 Page Posts Scraper

Extract public **facebook page posts** into structured records for brand, publisher, and competitor monitoring.

Facebook Page Posts Scraper opens the same public Page surface available to a logged-out visitor and saves one dataset row per visible post. Each row can include Page identity, post text, public post or reel URL, media links, machine-readable publication time when Facebook exposes it, and visible reaction, comment, share, or view counts.

No Facebook account or user cookies are required. The Actor is intentionally limited to public Pages: it does not scrape groups, private Pages, individual profiles, or comment records.

### What can you do with Facebook Page Posts Scraper?

- Collect a Page's current public posts for content analysis.
- Compare posting activity across selected brand or competitor Pages.
- Schedule recurring runs and compare datasets to detect newly visible posts.
- Export post captions, media URLs, and engagement signals to Sheets, a warehouse, or a dashboard.
- Feed public Page content into a permitted research, classification, or RAG workflow.

### Who is it for?

**Brand and social teams** can review competitors' publishing cadence and creative formats.

**Market researchers** can collect repeatable snapshots of publicly visible Page activity.

**Data teams** can send normalized post rows to a warehouse instead of maintaining Facebook-specific browser automation.

**Developers and agents** can start runs through the Apify API or MCP and consume the default dataset as JSON, CSV, Excel, or RSS.

### What Facebook Page post data is extracted?

| Field | Meaning |
| --- | --- |
| `pageName`, `pageId` | Page username and numeric ID when exposed |
| `authorName`, `authorUrl` | Visible Page title and requested Page URL |
| `postId`, `postUrl` | Public post/media identifier and canonical URL |
| `text` | Visible post message or caption |
| `timestamp`, `timestampMs` | Publication time when Facebook exposes a machine-readable value |
| `likesCount` | Visible reaction count when available |
| `commentsCount`, `sharesCount` | Visible engagement totals; no comments are collected |
| `viewsCount` | Visible video or reel views when available |
| `images`, `videoUrl`, `videoThumbnailUrl` | Publicly exposed media links |
| `externalLinks` | Decoded outbound links visible in the post |
| `hashtags`, `mentions` | Values parsed from post text |
| `isVideo`, `isShared` | Post format indicators |
| `scrapedAt` | Extraction timestamp |

Facebook varies the fields shown to logged-out visitors. Fields that are not visible are returned as `null` or an empty array rather than guessed.

### How to scrape public Facebook Page posts

1. Open the Actor input page.
2. Add one or more public Page profile URLs, such as `https://www.facebook.com/NASA`.
3. Set **Maximum posts** for the whole run.
4. Optionally enter `fromDate` or `toDate` in `YYYY-MM-DD` format.
5. Click **Start**.
6. Open the default dataset and export the `overview` view or the full records.

Start with a small limit. Facebook may expose only a small recent subset to logged-out visitors, so requesting 100 posts does not guarantee that 100 are publicly available.

### Input parameters

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `startUrls` | array | required | Up to 50 public Facebook Page profile URLs |
| `maxItems` | integer | `20` | Maximum total post rows across all Pages, from 1 to 500 |
| `fromDate` | string | none | Earliest date, applied only when an exact source timestamp is exposed |
| `toDate` | string | none | Latest date, applied only when an exact source timestamp is exposed |

Groups, events, photos, reels, posts, and Facebook home-page URLs are rejected as start URLs. Enter the Page profile URL instead.

### Example input

```json
{
  "startUrls": [
    { "url": "https://www.facebook.com/CocaCola" },
    { "url": "https://www.facebook.com/PepsiUS" }
  ],
  "maxItems": 2
}
```

Use an Apify schedule to run the same input daily or weekly. Compare records by `postUrl` or `postId` to identify newly visible posts.

### Example output

This shortened row is based on a real local extraction from NASA's public Page:

```json
{
  "pageName": "NASA",
  "pageId": "100044561550831",
  "authorName": "NASA - National Aeronautics and Space Administration",
  "authorUrl": "https://www.facebook.com/NASA",
  "postId": "r1596135602179420",
  "postUrl": "https://www.facebook.com/reel/1596135602179420/",
  "text": "The sky is full of excitement this month!...",
  "timestamp": null,
  "likesCount": null,
  "commentsCount": null,
  "sharesCount": null,
  "isVideo": true,
  "images": ["https://scontent...fbcdn.net/...jpg"],
  "scrapedAt": "2026-08-02T02:08:04.038Z"
}
```

Media URLs may expire because Facebook signs CDN links. Download permitted media promptly if your workflow needs a durable copy.

### How much does it cost to scrape Facebook Page posts?

Pay-per-event pricing has a **$0.006 run start** and a per-post charge. The BRONZE per-post price is **$0.0032**; higher and lower platform tiers use the active tiered prices shown on the Actor page.

Approximate BRONZE examples:

| Useful output | Calculation | Price |
| ---: | --- | ---: |
| 1 post | $0.006 + 1 × $0.0032 | $0.0092 |
| 10 posts | $0.006 + 10 × $0.0032 | $0.038 |
| 25 posts | $0.006 + 25 × $0.0032 | $0.086 |
| 100 posts | $0.006 + 100 × $0.0032 | $0.326 |

You are charged for the run start and successfully accepted post records, not for nested comments or rejected records. Your Apify plan and current pricing tier determine the final amount.

### Schedule brand and competitor monitoring

Create an Apify schedule with a stable list of Page URLs. Store each run's dataset ID and compare the latest rows with the previous dataset using `postUrl` as the primary key.

A practical workflow is:

1. Run every morning with a bounded item limit.
2. Export the dataset to your warehouse.
3. Upsert by `postUrl`.
4. Alert only on URLs not present in the previous snapshot.
5. Keep `scrapedAt` to distinguish source publication time from collection time.

The Actor does not maintain cross-run state or send alerts itself. This keeps the output predictable and lets you choose your own storage and notification system.

### Export Facebook posts to spreadsheets and pipelines

The default dataset can be downloaded as JSON, CSV, Excel, XML, or RSS. You can also connect Apify integrations for Google Sheets, Make, Zapier, Slack, webhooks, or cloud storage.

For large recurring workflows, consume dataset items through the API and upsert them into a database. Treat nullable engagement fields as unavailable source values, not zero.

### Run with the Apify API using cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~facebook-pages-posts-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":[{"url":"https://www.facebook.com/NASA"}],"maxItems":5}'
```

To wait for completion and receive dataset items directly, call the synchronous dataset endpoint:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~facebook-pages-posts-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":[{"url":"https://www.facebook.com/NASA"}],"maxItems":5}'
```

### Run with JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/facebook-pages-posts-scraper').call({
  startUrls: [{ url: 'https://www.facebook.com/NASA' }],
  maxItems: 5,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Run with Python

```python
from apify_client import ApifyClient
import os

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/facebook-pages-posts-scraper').call(run_input={
    'startUrls': [{'url': 'https://www.facebook.com/NASA'}],
    'maxItems': 5,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### Use Facebook Page Posts Scraper with MCP

Add the Apify MCP server to Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/facebook-pages-posts-scraper"
```

#### Claude Desktop setup

Claude Desktop can use this MCP configuration:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/facebook-pages-posts-scraper"
    }
  }
}
```

#### Cursor setup

In Cursor, add the same JSON under **Settings → MCP** and enable the `apify` server.

#### VS Code setup

In VS Code, add the same server URL to your MCP configuration and start the server from the MCP tools panel.

Example prompts:

- “Run Facebook Page Posts Scraper for NASA and return five public post records.”
- “Collect public posts from these three brand Pages, then summarize their visible creative formats.”
- “Start the monitoring input and give me the dataset URL when it finishes.”

### Reliability and source limitations

Facebook changes its logged-out Page markup and can show different records by time, locale, session, or network. The Actor uses browser rendering, excludes nested comment articles, blocks unnecessary binary traffic, and stops when the public feed no longer grows.

Important limitations:

- Only anonymously visible public Page content is supported.
- Facebook may expose one or a few recent posts rather than complete history.
- Exact timestamps and engagement values can be hidden; nullable fields remain `null`.
- Date filters cannot be applied to a row whose source timestamp is hidden.
- Signed image and video URLs can expire.
- A Page that requires login, is private, is unavailable, or presents a challenge can fail.
- Comments are counted when visible but comment records are not extracted.

### Troubleshooting

**The run says no public posts were extracted.**

Open each start URL in a logged-out browser. Confirm it is a public Facebook Page profile URL, not a group, post, reel, event, or private profile. The Actor makes one bandwidth-bounded US residential document request when direct delivery is a login shell; retry later if Facebook also blocks that fallback.

**I requested 50 posts but received fewer.**

`maxItems` is a ceiling, not a promise. The logged-out feed may expose fewer records or stop loading additional stories.

**Some timestamps or counts are null.**

Facebook did not expose a trustworthy machine-readable value for that field. The Actor does not invent values from ambiguous text.

**A media URL stopped working.**

Facebook CDN links are commonly signed and temporary. Save permitted assets soon after extraction.

### Responsible use and legality

Scrape only public data you are authorized to collect and use. Follow Facebook's terms, applicable privacy and database laws, copyright rules, and your organization's retention policies. Do not use this Actor to collect sensitive personal data, bypass access controls, impersonate users, or target private individuals.

You are responsible for establishing a lawful purpose, minimizing collected data, handling deletion requests where applicable, and securing exported datasets. This documentation is not legal advice.

### Related Automation Lab Actors

- [Facebook Page Photos Scraper](https://apify.com/automation-lab/facebook-page-photos-scraper) for the public Photos facet.
- [Facebook Page Recommendations Scraper](https://apify.com/automation-lab/facebook-page-recommendations-scraper) for publicly visible recommendation records.
- [Facebook Events Scraper](https://apify.com/automation-lab/facebook-events-scraper) for public event listings rather than Page posts.

Choose this Actor when the primary record is a Page post. Use the related Actors when you need a different Page facet with its own output contract.

### FAQ

#### Does it require Facebook login cookies?

No. It uses the public logged-out Page surface and does not accept Facebook credentials.

#### Does it scrape Facebook groups or comments?

No. Groups, private Pages, and comment records are intentionally excluded. Visible aggregate comment counts may appear on post rows.

#### Can it monitor new posts automatically?

Use an Apify schedule and compare datasets by `postUrl` or `postId`. The Actor produces snapshots; alerting and cross-run deduplication belong in your downstream workflow.

#### Can I use a Page username instead of a URL?

Enter the complete HTTPS Page URL. Full URLs make validation explicit and prevent ambiguous usernames from being treated as another Facebook surface.

#### Are results guaranteed to include all historical posts?

No. Results reflect the posts Facebook makes visible to the logged-out session at run time. The Actor does not claim archive completeness.

# Actor input Schema

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

Public Facebook Page profile URLs, such as https://www.facebook.com/NASA. Add up to 50 Pages. Do not enter groups, events, posts, or private profiles.

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

Maximum total number of post records saved across all Pages. Facebook may expose fewer posts to logged-out visitors.

## `fromDate` (type: `string`):

Optional earliest publication date in YYYY-MM-DD format. Applied when Facebook exposes a machine-readable post timestamp.

## `toDate` (type: `string`):

Optional latest publication date in YYYY-MM-DD format. Applied when Facebook exposes a machine-readable post timestamp.

## Actor input object example

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

# Actor output Schema

## `overview` (type: `string`):

Open the default dataset overview containing one row per extracted public Facebook Page 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 = {
    "startUrls": [
        {
            "url": "https://www.facebook.com/NASA"
        }
    ],
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/facebook-pages-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 = {
    "startUrls": [{ "url": "https://www.facebook.com/NASA" }],
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/facebook-pages-posts-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 '{
  "startUrls": [
    {
      "url": "https://www.facebook.com/NASA"
    }
  ],
  "maxItems": 5
}' |
apify call automation-lab/facebook-pages-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/qP8aHaccNf2DoYc0j/builds/KgQC4AnkVL0OVAN92/openapi.json
