# Facebook Page Posts (`xtracto/facebook-page-posts`) Actor

Scrape recent public posts from a Facebook page: text, timestamp, reaction count, comment count, and share count.

- **URL**: https://apify.com/xtracto/facebook-page-posts.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

Fetch recent public posts from any Facebook page in bulk — post text, attachments, reaction count, comment count, share count, permalink, and timestamp — as a clean structured JSON feed.

### Why use this actor

- **No account / no login required** — just give it a Facebook page handle (`nasa`) or full URL.
- **No API key needed** — Facebook's public Pages API has been deprecated for years; this actor returns the same data the public web app shows.
- **Full post payload** — text body, attached media (images and videos with width/height), permalink, owner name, owner profile picture, and a UTC `createdAt` timestamp.
- **Engagement counters** — `reactionCount`, `commentCount`, and `shareCount` per post.
- **Paginated feed** — set `maxPosts` and the actor walks the feed cursor automatically until the limit is hit or the page runs out of posts.
- **Stable JSON output** suitable for pipelines, spreadsheets, and databases — every row carries `_input`, `_source`, `_scrapedAt` envelope fields so you can join results back to your input list.

### How it works

1. You provide a list of Facebook page handles (e.g. `nasa`, `meta`) or full page URLs.
2. The actor opens each page the same way a logged-out browser would, resolves the page's numeric ID, then walks the posts feed page by page.
3. Each post is flattened into one dataset row with text, media, counters, and timestamp.
4. Results stream into your dataset, ready to download as JSON, CSV, or Excel.

You do not need to manage scrapers, browsers, or rotating IPs — all handled internally.

### Input

```json
{
  "pages": [
    "nasa",
    "https://www.facebook.com/meta"
  ],
  "maxPosts": 25,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["DATACENTER"]
  }
}
````

| Field | Type | Description |
|---|---|---|
| `pages` | array | List of Facebook page handles (`nasa`) or full page URLs (`https://www.facebook.com/meta`). Numeric page IDs are also accepted. |
| `maxPosts` | integer | Max posts returned per input page. Default `25`, range `1`–`200`. Pagination is handled automatically. |
| `proxyConfiguration` | object | Apify Proxy settings. Datacenter proxy works for most pages; switch to Residential if a page rate-limits aggressively. |

### Output

Input: `nasa`, `maxPosts: 3`

```json
{
  "_input": "nasa",
  "_pageId": "100044561550831",
  "_source": "S1-primary",
  "_scrapedAt": "2026-05-18T11:42:08.187026+00:00",
  "postId": "1524998752328829",
  "ownerId": "100044561550831",
  "ownerName": "NASA",
  "ownerProfileUrl": "https://www.facebook.com/NASA/",
  "ownerImageUrl": "https://scontent.fyyz1-1.fna.fbcdn.net/v/t39.30808-1/...",
  "createdAt": "2026-05-13T15:30:00+00:00",
  "createdAtEpoch": 1778506200,
  "text": "Planning is underway for Artemis III, our next mission to land humans on the Moon...",
  "permalink": "https://www.facebook.com/NASA/posts/1524998752328829",
  "reactionCount": 12400,
  "commentCount": 291,
  "shareCount": 409,
  "attachments": [
    {
      "type": "Photo",
      "url": "https://www.facebook.com/NASA/photos/1524998752328829",
      "id": "1524998745662163",
      "imageUrl": "https://scontent.fyyz1-1.fna.fbcdn.net/v/t39.30808-6/...",
      "width": 2048,
      "height": 1365
    }
  ]
}
```

| Field | Type | Description |
|---|---|---|
| `_input` | string | The handle or URL exactly as you supplied it. Use this to join results back to your input list. |
| `_pageId` | string | Facebook's numeric page ID (stable across handle changes). |
| `_source` | string | Internal tag for the path used to fetch the record. `S1-primary` means the fastest, richest path; values starting with `S2-fallback` indicate a fallback was used. |
| `_scrapedAt` | string | ISO-8601 UTC timestamp when the record was scraped. |
| `postId` | string | Facebook's numeric post ID. |
| `ownerId` | string | Numeric ID of the page that authored the post. |
| `ownerName` | string | Display name of the page (e.g. `NASA`). |
| `ownerProfileUrl` | string | Canonical URL of the page. |
| `ownerImageUrl` | string | URL of the page's profile picture. |
| `createdAt` | string | ISO-8601 UTC publication time. |
| `createdAtEpoch` | integer | Same value as `createdAt` expressed as Unix epoch seconds. |
| `text` | string | Full post body text. `null` for media-only posts. |
| `permalink` | string | Public URL of this specific post. |
| `reactionCount` | integer | Total reactions (Like, Love, Care, Haha, Wow, Sad, Angry combined). Facebook rounds this for high-volume posts. |
| `commentCount` | integer | Total comments on the post. |
| `shareCount` | integer | Total shares of the post. |
| `attachments` | array | Attached media. Each entry has `type` (`Photo`, `Video`, etc.), `url` (permalink to the media), `id`, `imageUrl` (CDN URL of the image or video thumbnail), and `width`/`height`. Empty array for text-only posts. |

#### Error envelope

Pages that can't be resolved or fetched return a structured error instead of crashing the run:

```json
{
  "_input": "this-page-does-not-exist-xyz",
  "_error": "page_id_resolve_failed",
  "_errorDetail": "Could not extract numeric page ID from warm HTML",
  "_scrapedAt": "2026-05-18T11:42:09.012345+00:00"
}
```

Common `_error` values: `warm_failed` (couldn't load the page), `page_id_resolve_failed` (page does not exist or is fully gated), `fetch_failed` (transient network or server-side error), `no_posts` (page resolved but has no public posts).

Filter on `_error` to triage failed rows.

### Pricing

This actor is billed per result: **$6.00 per 1,000 posts** (Tier 4). Each post row = 1 result. Error rows are not billed.

### Other Sosmed Actors

| Platform | Actor | Best for |
|---|---|---|
| Facebook | [Facebook Page Scraper](https://apify.com/xtracto/facebook-page) | Page metadata: name, category, like and follower counts |
| Facebook | [Facebook Post Detail Scraper](https://apify.com/xtracto/facebook-post-detail) | Single-post deep dive with comments preview |
| Instagram | [Instagram Account Posts Scraper](https://apify.com/xtracto/instagram-account-posts-scraper) | Recent posts from any public IG account |
| X / Twitter | [X Account Tweets Scraper](https://apify.com/xtracto/x-account-tweets-scraper) | Recent tweets for any handle |
| Threads | [Threads Account Threads Scraper](https://apify.com/xtracto/threads-account-threads-scraper) | Recent threads for any Threads handle |
| Bluesky | [Bluesky Account Posts Scraper](https://apify.com/xtracto/bluesky-account-posts-scraper) | Recent posts for any atproto handle |

Browse the full catalog at [apify.com/xtracto](https://apify.com/xtracto).

### Notes

- Facebook currently returns **one post per request** on the anonymous public feed, so the actor paginates internally via cursor to satisfy your `maxPosts` value. Large jobs (e.g. `maxPosts: 200`) therefore take noticeably longer than a single page's worth of API calls would suggest — budget accordingly.
- Pagination is fully automatic; you do not need to pass or persist a cursor.
- `reactionCount` is **rounded** by Facebook for high-volume posts (e.g. `12K`, `1.2M` — the actor returns the rounded integer as Facebook publishes it).
- Counters are eventually-consistent and may lag the live page by a few minutes.
- The actor only returns **public** posts — content gated behind a login wall or audience restriction is skipped.
- For best reliability on large jobs, leave Apify Proxy enabled. Datacenter proxy is the default and works for most pages; switch to Residential if a specific page returns frequent `fetch_failed` errors.

# Actor input Schema

## `pages` (type: `array`):

List of Facebook page handles (e.g. `nasa`) or full page URLs (e.g. `https://www.facebook.com/meta`). Numeric page IDs are also accepted.

## `maxPosts` (type: `integer`):

Maximum number of posts to return per input page. The scraper paginates automatically until this limit is reached or the feed ends.

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

Apify Proxy settings. Datacenter proxy works for most pages; switch to Residential if a page rate-limits aggressively.

## Actor input object example

```json
{
  "pages": [
    "MetaAI",
    "zuck"
  ],
  "maxPosts": 25,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "pages": [
        "MetaAI",
        "zuck"
    ],
    "maxPosts": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/facebook-page-posts").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 = {
    "pages": [
        "MetaAI",
        "zuck",
    ],
    "maxPosts": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("xtracto/facebook-page-posts").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 '{
  "pages": [
    "MetaAI",
    "zuck"
  ],
  "maxPosts": 25
}' |
apify call xtracto/facebook-page-posts --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Page Posts",
        "description": "Scrape recent public posts from a Facebook page: text, timestamp, reaction count, comment count, and share count.",
        "version": "0.1",
        "x-build-id": "PzjXpSGbZX25Vfzkt"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/xtracto~facebook-page-posts/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-xtracto-facebook-page-posts",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/xtracto~facebook-page-posts/runs": {
            "post": {
                "operationId": "runs-sync-xtracto-facebook-page-posts",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/xtracto~facebook-page-posts/run-sync": {
            "post": {
                "operationId": "run-sync-xtracto-facebook-page-posts",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "pages"
                ],
                "properties": {
                    "pages": {
                        "title": "Facebook page usernames or URLs",
                        "type": "array",
                        "description": "List of Facebook page handles (e.g. `nasa`) or full page URLs (e.g. `https://www.facebook.com/meta`). Numeric page IDs are also accepted.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPosts": {
                        "title": "Max posts per page",
                        "minimum": 1,
                        "maximum": 200,
                        "type": "integer",
                        "description": "Maximum number of posts to return per input page. The scraper paginates automatically until this limit is reached or the feed ends.",
                        "default": 25
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy settings. Datacenter proxy works for most pages; switch to Residential if a page rate-limits aggressively.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
