# Facebook Posts Scraper: Page Posts, Reactions & Engagement (`automatic/facebook-posts-scraper`) Actor

Scrape posts from any public Facebook Page: full text, dates, total and per-type reactions (like, love, haha, wow), comment and share counts, images, videos and shared links. Flat rows for CSV or Excel. Filter by date or by age, like "7 days", at no extra charge. Built for brand monitoring.

- **URL**: https://apify.com/automatic/facebook-posts-scraper.md
- **Developed by:** [Philip Kirkbride](https://apify.com/automatic) (community)
- **Categories:** Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 83.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.50 / 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.

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 Posts Scraper

Collect recent posts from public Facebook Pages: post text, publication dates, reaction totals and types, comment and share counts, images, video links and shared links when public. Each post becomes one clean row for export to CSV, Excel or JSON.

Built for brand monitoring, competitor content research and social reporting.

- **Engagement per post**: total reactions plus a like, love, care, haha, wow, sad and angry breakdown, with comment and share counts.
- **Media and links**: image and video links, plus the destination and title of shared links.
- **Many Pages in one run**: up to 100 Pages, with a per-Page window and a total cap so you control spend.
- **Ready for scheduled monitoring**: filter by a relative age such as `7 days`, or by a date range. Date filters cost nothing extra.

The prefilled input returns 10 recent NASA posts in about 15 seconds.

### Also available

The Facebook and Meta suite: pick the job.

| Actor | Use when |
|---|---|
| **Facebook Page Posts (this Actor)** | Recent posts and reactions from any Page |
| [Facebook Pages](https://apify.com/automatic/facebook-pages-scraper) | Page followers, contacts and latest post |
| [Facebook Ads Library](https://apify.com/automatic/facebook-ads-library-scraper) | Meta ads by keyword or advertiser |
| [Instagram Posts](https://apify.com/automatic/instagram-post-scraper) | Full post history with captions and engagement |
| [LinkedIn Company Posts](https://apify.com/automatic/linkedin-company-posts-scraper) | What every company posts, with engagement |
| [X (Twitter)](https://apify.com/automatic/x-twitter-scraper) | Profiles and latest posts with views |

### Quick start

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

Paste Page URLs, usernames or numeric Page IDs in `startUrls`.

### Input

| Field | Meaning |
| --- | --- |
| `startUrls` | Up to 100 Page URLs or usernames. Duplicate inputs are removed. An entry that is not a Page link or username is skipped (listed in `OUTPUT.skippedSearches`) and the other Pages still run. An empty input returns a one-post NASA sample. |
| `maxPostsPerPage` | Recent-post window per Page, from 1 to 200; default 20. |
| `maxItems` | Total posts delivered across all Pages, from 1 to 10,000; default 100. |
| `onlyPostsNewerThan` | Optional. A date such as `2026-11-01` (posts newer than midnight UTC on that date) or a relative age such as `7 days`, `2 weeks` or `3 months`. |
| `onlyPostsOlderThan` | Optional. A date such as `2026-11-01` (posts published before midnight UTC on that date) or a relative age such as `30 days`. Combine both for a date range. |

For five recent NASA posts:

```json
{"startUrls": ["NASA"], "maxPostsPerPage": 5, "maxItems": 5}
```

For a daily scheduled run that keeps only the last day's posts:

```json
{"startUrls": ["NASA", "bbcnews"], "maxPostsPerPage": 20, "onlyPostsNewerThan": "1 day"}
```

For a larger BBC News collection:

```json
{"startUrls": ["bbcnews"], "maxPostsPerPage": 50, "maxItems": 50}
```

### Output

| Fields | What you get |
| --- | --- |
| `postId`, `url` | Stable post ID and its Facebook link. |
| `pageId`, `pageProfileId`, `pageName`, `pageUrl` | Page identity and name. |
| `text`, `postedAt` | Public post text and ISO timestamp. |
| `reactionsTotal`, `reactionsLike`, `reactionsLove`, `reactionsCare`, `reactionsHaha`, `reactionsWow`, `reactionsSad`, `reactionsAngry` | Reaction totals and each publicly shown reaction type. |
| `commentsCount`, `sharesCount` | Public comment and share counts. |
| `mediaType`, `imageUrls`, `videoUrls` | Post media type and available direct media links. |
| `linkUrl`, `linkTitle` | Shared-link destination and title, when displayed. |
| `scrapedAt` | Collection time in ISO format. |

### Output example

Captured from the NASA sample on 2026-11-13:

```json
{
  "postId": "1685704526258250",
  "url": "https://www.facebook.com/NASA/posts/pfbid02wE2bnKacnW5rQtZJwEjZZyVqXxoZ5NWakfbiznAPBtYxHDrAT8D8uJzt1GB928onl",
  "pageId": "54971236771",
  "pageProfileId": "100044561550831",
  "pageName": "NASA - National Aeronautics and Space Administration",
  "pageUrl": "https://www.facebook.com/NASA",
  "text": "Tethys and Dione showed up for the group photo!\n \nIn addition to the two moons shown here, Saturn has a whole entourage of natural satellites—more than any other planet in our solar system. As of now, the ringed planet has 293 confirmed moons.",
  "postedAt": "2026-11-12T20:16:47+00:00",
  "reactionsTotal": 2661,
  "commentsCount": 97,
  "sharesCount": 255,
  "scrapedAt": "2026-11-13T18:49:42.765745+00:00",
  "reactionsLike": 1933,
  "reactionsLove": 632,
  "reactionsCare": 43,
  "reactionsHaha": 8,
  "reactionsWow": 42,
  "reactionsSad": 2,
  "reactionsAngry": 1,
  "mediaType": "photo",
  "imageUrls": [
    "https://scontent.flim2-2.fna.fbcdn.net/v/t39.99422-6/903234689_961209693445682_3475448322653156004_n.png?stp=dst-jpg_tt6&cstp=mx971x855&ctp=s971x855&_nc_cat=100&_nc_map=urlgen_bucketless&ccb=1-7&_nc_sid=127cfc&_nc_ohc=lrmpvtJSpCIQ7kNvwHnGLoi&_nc_oc=Adpwz86MumRXn7BFyUEKCkGarTj6VjKv-VPhi_VsaaCpHJTbj35nNgGpCxHH8irSKP0&_nc_zt=14&_nc_ht=scontent.flim2-2.fna&_nc_gid=Ol11IYjVwtcki6lAbr1JRg&_nc_ss=7b289&oh=00_AQQNy7C0DtHydtGgSDVHbTdCVetXpCVcTElmOyWDrlwK6A&oe=6AFD2601"
  ],
  "videoUrls": [],
  "linkUrl": null,
  "linkTitle": null
}
```

### Run summary

`OUTPUT` records delivered posts, date-filtered posts (with the exact `dateWindow` used), processed Pages, and `pageErrors`. It flags an empty-input sample with `usedExample: true`. If a Page becomes unavailable, collected posts remain available and the summary and run status message identify the partial result.

`OUTPUT.status` is `complete` when every requested Page was read, `partial` when some Pages delivered posts and others had an error or had to be skipped, and `no_results` when nothing was delivered because of your input or an empty feed (`noResultsReason` says which). A mistyped or removed Page, or a list with no usable Page in it, ends green with no rows instead of failing: only a source-side block with nothing read is a failed run. Entries that cannot be run are listed in `OUTPUT.skippedSearches` with their `input`, `stopReason` and `reason`, and are never charged.

### Pricing

**$0.0045 per delivered post ($4.50 per 1,000) plus $0.01 per run start.** The start fee is charged per GB of memory (minimum one); the default 512 MB run is one start event.

| Example at the default 512 MB memory | Posts | Cost |
| --- | ---: | ---: |
| Console prefill | 10 | $0.055 |
| 100 delivered posts | 100 | $0.46 |
| 1,000 delivered posts | 1,000 | $4.51 |
| No delivered posts | 0 | $0.01 |

### Good to know

- Public Pages only. Restricted, deleted or unavailable Pages are named in the run summary; full historical archives are not guaranteed.
- Public feed depth varies by Page: 50 BBC posts and over 100 Nike posts were observed. Each run reads up to 200 recent posts per Page.
- Date filters apply to that recent-post window, so they suit monitoring recent activity rather than full historical archives. Relative ages count back from the run start, and posts without a known date are left out when a date filter is set.
- Unavailable fields are null, absent media links are empty arrays, and missing reaction types are not treated as zero. Media links may expire.
- Counts are a snapshot at collection time.

# Actor input Schema

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

Page URLs, usernames or numeric Page IDs. Example: https://www.facebook.com/NASA. Duplicates are removed; empty input runs an announced one-post NASA sample. Public Pages only.

## `maxPostsPerPage` (type: `integer`):

Read up to this many recent posts per Page, from 1 to 200. Example: 50. Facebook may expose fewer posts; unavailable feeds are reported in OUTPUT.

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

Total result cap across all Pages. Example: 100. The run stops once this many posts have been delivered.

## `onlyPostsNewerThan` (type: `string`):

Optional. A UTC date such as 2026-11-01 (posts strictly newer than midnight on that date) or a relative age such as 7 days, 2 weeks or 3 months (counted back from the run start, handy for scheduled runs). Empty includes all dates in the requested recent-post window. Unknown dates are omitted when a date filter is set.

## `onlyPostsOlderThan` (type: `string`):

Optional. A UTC date such as 2026-11-01 (posts published before midnight on that date) or a relative age such as 30 days. Combine with Only posts newer than for a date range. Empty sets no upper limit. Applies within the requested recent-post window.

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

Optional Apify connection configuration. The default uses United States addresses. Example: {"useApifyProxy": true, "apifyProxyCountry": "US"}.

## `residentialFallback` (type: `boolean`):

Use the alternative connection route when the primary public feed is unavailable. Example: true. Explicit connection settings are respected.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.facebook.com/NASA"
  ],
  "maxPostsPerPage": 10,
  "maxItems": 10,
  "onlyPostsNewerThan": "",
  "onlyPostsOlderThan": "",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  },
  "residentialFallback": true
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "startUrls": [
        "https://www.facebook.com/NASA"
    ],
    "maxPostsPerPage": 10,
    "maxItems": 10,
    "onlyPostsNewerThan": "",
    "onlyPostsOlderThan": "",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyCountry": "US"
    },
    "residentialFallback": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatic/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 = {
    "startUrls": ["https://www.facebook.com/NASA"],
    "maxPostsPerPage": 10,
    "maxItems": 10,
    "onlyPostsNewerThan": "",
    "onlyPostsOlderThan": "",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyCountry": "US",
    },
    "residentialFallback": True,
}

# Run the Actor and wait for it to finish
run = client.actor("automatic/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 '{
  "startUrls": [
    "https://www.facebook.com/NASA"
  ],
  "maxPostsPerPage": 10,
  "maxItems": 10,
  "onlyPostsNewerThan": "",
  "onlyPostsOlderThan": "",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  },
  "residentialFallback": true
}' |
apify call automatic/facebook-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automatic/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/TZVZ0qfNPGrxgcOhM/builds/AjB2P41yX0zJ9Ladm/openapi.json
