# Facebook Page Posts Scraper (`powerai/facebook-page-posts-scraper`) Actor

Extract posts from any public Facebook page using its page ID, with optional date filtering and automatic pagination up to your specified maxResults.

- **URL**: https://apify.com/powerai/facebook-page-posts-scraper.md
- **Developed by:** [PowerAI](https://apify.com/powerai) (community)
- **Categories:** Social media
- **Stats:** 567 total users, 32 monthly users, 93.5% runs succeeded, 8 bookmarks
- **User rating**: 4.00 out of 5 stars

## Pricing

from $4.99 / 1,000 results

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/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 posts from any public Facebook page using its page ID. This actor leverages the latest Facebook page posts API and supports automatic pagination to collect up to your specified `maxResults`.

### Features

- Scrape posts from any public Facebook page using its page ID.
- Optional date range filtering with start\_date and end\_date.
- Automatic pagination to fetch large result sets.
- Returns structured post data including content, reactions, comments, and media.

### Input

| Field      | Type    | Required | Description                                      |
|------------|---------|----------|--------------------------------------------------|
| page\_id    | string  | Yes      | The Facebook page ID to scrape posts from.       |
| start\_date | string  | No       | Optional start date (yyyy-mm-dd) to filter posts.|
| end\_date   | string  | No       | Optional end date (yyyy-mm-dd) to filter posts.  |
| maxResults | integer | No       | Maximum number of posts to fetch  |

### Output

Each output item is a Facebook post object:

```json
[
	{
		"post_id": "1296377462490362",
		"type": "post",
		"url": "https://www.facebook.com/LombardOlkusz/posts/pfbid0xHDQtfzbGjH3dMqUZHkNr6VTGgsuUYSz6Joq6kyAwVaVVpWBM2P7VsUWkUHHwhvZl",
		"message": "Pamiętaj tylko u nas najlepsze ceny skupu złota 🙂🙂przyjdź sprawdź...zapraszamy od godziny 8 do godziny 19🙂kontakt telefoniczny 512 777 884 🙂",
		"timestamp": 1747506554,
		"comments_count": 0,
		"reactions_count": 0,
		"reshare_count": 5,
		"reactions": {
			"angry": 0,
			"care": 0,
			"haha": 0,
			"like": 0,
			"love": 0,
			"sad": 0,
			"wow": 0
		},
		"author": {
			"id": "100063543614476",
			"name": "Komis Skup sprzedaż Złota",
			"url": "https://www.facebook.com/LombardOlkusz",
			"profile_picture_url": "https://scontent.fjoi2-1.fna.fbcdn.net/v/t39.30808-1/407757874_870519151742864_2776592356750657064_n.jpg?stp=c5.0.296.296a_cp0_dst-jpg_s40x40_tt6&_nc_cat=100&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=s9jkZhdtE8UQ7kNvwEd3zfi&_nc_oc=AdlWbNIsuhWxitgvbCaoYFcFm1t-tYv8XvDB2xqg3KB9JAFF3pYgdPOgW9n867wIbHE&_nc_zt=24&_nc_ht=scontent.fjoi2-1.fna&_nc_gid=WulJOcwYpO0fAOZLcpiL5A&oh=00_AfInXs15Z7HBNtnrBTGZZNADP4a-92sEcf9p2Tv7X_eXng&oe=683DD47F"
		},
		"image": {
			"uri": "https://scontent.fjoi2-1.fna.fbcdn.net/v/t39.30808-6/497953614_1296377415823700_2526818784636674285_n.jpg?_nc_cat=111&ccb=1-7&_nc_sid=833d8c&_nc_ohc=LuYd41ewU-YQ7kNvwG6ewx8&_nc_oc=Adk-2n8IoI88YeY3H4HzF7-10Fl4DV6fS8KRHST0eH6Toru7J-1XzVqPOR_sMzm_aCg&_nc_zt=23&_nc_ht=scontent.fjoi2-1.fna&_nc_gid=WulJOcwYpO0fAOZLcpiL5A&oh=00_AfIMc9cL70rneQBXZYS12qsX9GBJ8wS2WsM2bA-kpPGnyg&oe=683DD55C",
			"height": 296,
			"width": 307
		},
		"video": null,
		"album_preview": null,
		"video_files": null,
		"video_thumbnail": null,
		"external_url": null,
		"attached_event": null,
		"attached_post": null,
		"attached_post_url": null,
		"scrapedAt": "2025-05-29T08:18:48.641Z"
	},
	...
]
```

### Example Usage

```json
{
  "page_id": "100063543614476",
  "maxResults": 3
}
```

### Notes

- The actor will automatically paginate through results until `maxResults` is reached or no more data is available.
- Make sure the page ID is correct and the page is public.
- Posts are returned in chronological order.
- Date filtering is optional but recommended for better performance.

# Actor input Schema

## `page_id` (type: `string`):

The Facebook page ID to scrape posts from.

## `start_date` (type: `string`):

Optional start date (yyyy-mm-dd) to filter posts.

## `end_date` (type: `string`):

Optional end date (yyyy-mm-dd) to filter posts.

## `maxResults` (type: `integer`):

Maximum number of posts to fetch (auto pagination).

## Actor input object example

```json
{
  "page_id": "100063543614476",
  "maxResults": 3
}
```

# 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("powerai/facebook-page-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 = {}

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

```

## MCP server setup

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

```

## OpenAPI specification

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