# Facebook Page Posts Scraper — Comments, Reactions, No Login (`valev-lab/facebook-page-posts-scraper`) Actor

Scrape public Facebook Page and profile posts without login: text, date, reactions by type, comments, shares, video views, photos, reels, links, followers and Page contacts. Monitor new posts; export CSV, Excel or JSON. $2/1K posts on Free, $1.40/1K on Gold+.

- **URL**: https://apify.com/valev-lab/facebook-page-posts-scraper.md
- **Developed by:** [Daniel Valev](https://apify.com/valev-lab) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 6 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 post scrapeds

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 Posts Scraper — Comments, Reactions & Page Contacts, No Login

Scrape posts from **public Facebook Pages** and public profiles without a Facebook account. Get the **post text**, **date**, **reactions by type**, **comments**, **shares**, **video and reel views**, **photos, videos and links**, plus **Page details** such as category, followers, verified badge, website, and the email or phone the Page shows publicly. **No login, no cookies, no browser, no Meta developer app.** Export to **CSV, Excel, or JSON** or read the results through the API.

**Price:** $2 per 1,000 posts on the Apify Free plan, $1.40 on Gold and higher, plus $0.004 per Page checked. Errors, summaries, duplicates, and posts you already have are free.

An empty run is a small sample: **5 posts** and the Page details of `https://www.facebook.com/nike`. In our private cloud test it finished in 12 seconds.

### What does Facebook Page Posts Scraper do?

This Actor reads the public timeline of each Page you give it and returns **one row per post**, with optional rows for **comments**, **Page details**, and a **per-Page summary**. Use it as a **Facebook Pages API alternative** when you do not have a Meta developer app or Page access tokens.

Paste Page links, vanity names such as `nike`, or numeric Page ids. Mix as many Pages as you like; the same Page is read once even under two different links. Set a date range, turn on comments, or keep only posts that are new since your last run.

### What can you use Facebook Page data for?

| Use case | How |
| --- | --- |
| **Brand monitoring** | Schedule your own Page and read reactions, comments, and shares on every new post |
| **Competitor monitoring** | Track what competitors publish, how often, and in which format (reels, photos, links) |
| **Social listening** | Collect public comments under brand posts to see what customers ask and complain about |
| **Content benchmarking** | Compare Pages with the summary row: posts per week, average reactions, comments, shares, views, and the best post |
| **Ad and campaign research** | Pair a Page's posts with its ads from our [Facebook Ads Library Scraper](https://apify.com/valev-lab/facebook-ads-library); `pageId` is the same id the Ads Library uses |

For public **groups**, use our [Facebook Group Posts Scraper](https://apify.com/valev-lab/facebook-groups-scraper). Group links entered here are skipped with a note.

### Why use this Facebook Page scraper?

- **No Facebook account** — Nothing to log into, no cookies, no tokens.
- **Reaction breakdown** — Like, love, care, haha, wow, sad, and angry counts on every post, at no extra cost.
- **Reels and videos** — Video URL, thumbnail, and play count.
- **Comments and replies** — Optional, as separate rows with author, time, reactions, and parent comment.
- **Page details** — Category, followers, verified badge, intro text, website, and public email and phone. On a direct connection also the creation date, ads status, and the company responsible for the Page.
- **Only new posts** — Monitor Pages on a schedule and pay only for posts you have not received before.
- **Errors are free** — A missing, private, or login-only Page returns an error row and is not charged.
- **Apify platform** — Schedules, API, webhooks, and integrations with Make, Zapier, n8n, Google Sheets, and more.

### What data can you extract?

Every row has a `type`: `post`, `comment`, `page`, `summary`, or `error`.

| Post field | Description |
| --- | --- |
| `postId` / `url` | Post id and permalink (a `/reel/` link for reels) |
| `pageId` / `pageName` / `pageUrl` | The Page that published it. `pageId` is the classic Page id, the same one the Ads Library uses |
| `text` / `createdAt` | Caption and ISO time |
| `postType` | `status`, `photo`, `video`, `reel`, `link`, or `shared` |
| `media` | Photos and videos: `type`, `url`, `thumbnail` |
| `link` | Shared link: `url`, `title`, `description`, `domain` |
| `reactionsCount` / `reactionBreakdown` | Total reactions and the count per reaction |
| `commentsCount` / `sharesCount` / `viewsCount` | Engagement; views for videos and reels |
| `hashtags` / `mentions` | Hashtags in the caption and tagged Pages or people |
| `sharedPost` | For shares: the original post's id, link, text, author, and time |
| `isPinned` / `isSponsored` / `isNew` | Pinned to the top, marked sponsored, not delivered before |

| Comment field | Description |
| --- | --- |
| `commentId` / `postId` / `url` | Comment id, the post it belongs to, and a direct link |
| `text` / `authorName` / `authorUrl` / `createdAt` | What was written, by whom, and when |
| `reactionsCount` / `repliesCount` | Reactions and replies on the comment |
| `parentId` / `depth` | The parent comment of a reply; `depth` 0 for comments, 1–2 for replies |

| Page field | Description |
| --- | --- |
| `name` / `category` / `about` / `verified` | Name, category, intro text, verified badge |
| `followers` / `following` | Follower count (Facebook rounds large numbers, e.g. 39M); `followersText` keeps the original |
| `website` / `websites` / `email` / `phone` / `address` | Contact details only when the Page shows them publicly |
| `createdAt` / `isRunningAds` / `responsibleEntity` | From Page transparency: creation date, whether the Page runs ads now, and the confirmed owner. Read only over a direct connection; on Apify cloud these were empty in every test run (see Limitations) |

The **summary** row per Page gives `postsPerWeek`, `avgReactions`, `avgComments`, `avgShares`, `avgViews`, post-type counts, and the `bestPost` by reactions + comments + shares.

The Output tab has four views: **Posts**, **Pages**, **Comments**, and **Page summary**. Views pick columns from one dataset; use the `type` field to filter rows in your export or API call.

### How to scrape Facebook Page posts

1. Open **Facebook Page Posts Scraper** and click **Try for free**.
2. Paste Page links, vanity names, or Page ids, for example `https://www.facebook.com/nike` or `lidlbulgaria`.
3. Set **Max posts per Page** (default 50; 0 reads as far back as Facebook allows).
4. Optionally set **Posts from** / **Posts until**, turn on **Include comments**, or **Only new posts**.
5. Click **Start**. Download **JSON, CSV, Excel, or HTML**, or connect an integration.

#### Input example

```json
{
  "pages": ["https://www.facebook.com/nike", "lidlbulgaria", "https://www.facebook.com/natgeo"],
  "maxPostsPerPage": 50,
  "dateFrom": "30 days",
  "includeComments": true,
  "maxCommentsPerPost": 20,
  "includeReplies": false,
  "includeReactionBreakdown": true,
  "includePageInfo": true,
  "monitorMode": false,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

### How much does it cost to scrape Facebook Pages?

Pricing is [pay-per-event](https://docs.apify.com/platform/actors/running/pay-per-event): you pay for the rows you receive, not for run time or proxy traffic. "Free" means the Apify Free plan.

| Event | Free | Bronze | Silver | Gold and higher | When |
| --- | ---: | ---: | ---: | ---: | --- |
| `post-scraped` | **$0.002** | $0.0018 | $0.0016 | **$0.0014** | A post was saved |
| `comment-scraped` | $0.0008 | $0.0007 | $0.0006 | $0.0005 | A comment or reply was saved |
| `page-scanned` | $0.004 | $0.004 | $0.004 | $0.004 | Once per Page per run, when Facebook returned its timeline (also when nothing is new) |
| `page-info` | $0.002 | $0.0018 | $0.0016 | $0.0015 | Page details were saved (optional, once per Page per run) |
| `apify-actor-start` | $0.0005 | $0.0005 | $0.0005 | $0.0005 | Once per run |
| **1,000 posts** | **$2.00** | $1.80 | $1.60 | **$1.40** | |

**Examples (Free plan):**

- The 5-post sample with Page details: `$0.0005 + $0.004 + $0.002 + 5 × $0.002 = $0.0165`.
- 3 Pages × 50 posts with Page details: `$0.0005 + 3 × ($0.004 + $0.002) + 150 × $0.002 = $0.3185`. Add 20 comments per post: `+ 3,000 × $0.0008 = $2.40`.
- A weekly report on 10 competitor Pages, about 7 posts each, Page details off: `$0.0005 + 10 × $0.004 + 70 × $0.002 = $0.1805` per run.
- Monitoring 5 Pages with **Only new posts** when nothing is new: `$0.0005 + 5 × $0.004 = $0.0205` per run; each new post adds $0.002.

**Why a per-Page fee?** Every Page check opens the Page and its first timeline page, which often needs a residential proxy. That costs the same whether there are 0 or 50 new posts, so it is charged per Page checked rather than hidden in the post price.

**Never charged:** missing, private, and duplicate Pages, error rows, summary rows, duplicate posts, already-seen posts in monitoring mode, and posts outside your date range. Set a **maximum total charge** on the run: the Actor stops cleanly when it is reached.

#### Price comparison

Prices from each Actor's public Apify API metadata on 2026-11-14, per 1,000 posts. Check each Store page for current prices; scope and data differ.

| Actor | Free | Gold | Comments / 1,000 | Fixed fees |
| --- | ---: | ---: | ---: | ---: |
| **This Actor** | **$2.00** | **$1.40** | **$0.80 → $0.50** | $0.0005 per run + $0.004 per Page |
| [Apify Facebook Posts Scraper](https://apify.com/apify/facebook-posts-scraper) | $5.00 | $2.00 | separate Actor, $2.50 → $1.40 | $0.001 per run |
| [thedoor Facebook Page & Profile Posts](https://apify.com/thedoor/facebook-page-scraper) | $2.50 | $1.50 | — | $0.01 per run |
| [danek Facebook Pages Posts PPR](https://apify.com/danek/facebook-pages-posts-ppr) | $2.99 | $0.99 | — | — |
| [alfalfa Facebook Posts Scraper](https://apify.com/alfalfa/facebook-posts-scraper) | $2.00 | $1.40 | — | — |
| [curious_coder Facebook posts scraper](https://apify.com/curious_coder/facebook-post-scraper) | $1.50 | $1.00 | — | $0.005 per run on Free |
| [memo23 Facebook Page Posts Scraper](https://apify.com/memo23/facebook-page-posts-scraper) | $0.99 | $0.99 | $1.00 | $0.005 per run |

This Actor is **60% cheaper than Apify's own Facebook Posts Scraper on Free** and 30% cheaper on Gold. It is not the cheapest per post: memo23 and curious_coder charge less, and danek charges less on Gold. What you get here for the price: reaction breakdown on every post, Page contacts, a free per-Page summary, free monitoring of already-seen posts, and free error rows. When a run checks many Pages but finds few posts, the $0.004 per-Page fee can make it cost more than Actors with only a per-run fee.

### Use the Facebook Page posts API

Run `valev-lab/facebook-page-posts-scraper` through the [Apify API](https://docs.apify.com/api/v2). You need an Apify token; you do not need a Facebook account, a Meta app, or Page tokens.

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('valev-lab/facebook-page-posts-scraper').call({
    pages: ['https://www.facebook.com/nike', 'lidlbulgaria'],
    maxPostsPerPage: 20,
    dateFrom: '30 days',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const item of items) {
    if (item.type === 'post') console.log(item.pageName, item.createdAt, item.reactionsCount, item.url);
}
// listItems returns one page; paginate larger exports.
```

Python, with the [official Apify client](https://docs.apify.com/api/client/python) 3.x:

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("valev-lab/facebook-page-posts-scraper").call(run_input={
    "pages": ["https://www.facebook.com/nike", "lidlbulgaria"],
    "maxPostsPerPage": 20,
    "dateFrom": "30 days",
})
for item in client.dataset(run.default_dataset_id).iterate_items():
    if item["type"] == "post":
        print(item["pageName"], item["createdAt"], item["reactionsCount"], item["url"])
```

Make, Zapier, n8n, Google Sheets, and Apify schedules and webhooks run the same input.

#### Use with AI agents and MCP

Connect your MCP client to the [Apify MCP server](https://docs.apify.com/mcp) and select this Actor with `https://mcp.apify.com?tools=valev-lab/facebook-page-posts-scraper`. Example request: "Get the last 30 days of posts from these three competitor Facebook Pages, then compare posting frequency, formats, and average reactions." The Actor returns the data; your agent does the analysis. Use the `summary` rows for quick per-Page benchmarks.

### Output examples

A post:

```json
{
  "type": "post",
  "postId": "1093362432158465",
  "url": "https://www.facebook.com/nike/posts/pfbid0gwtYswxtEHHbiqWvHX5EHEi1A8Mmac4fT7tpcq3FTxFrQ7CGDmhfujGfV6gUbdBDl",
  "pageId": "15087023444",
  "pageName": "Nike",
  "text": "Add another win to her story. 📖 …",
  "createdAt": "2024-09-04T16:13:34.000Z",
  "postType": "photo",
  "media": [{ "type": "photo", "url": "https://scontent.xx.fbcdn.net/…", "thumbnail": "https://scontent.xx.fbcdn.net/…" }],
  "link": null,
  "reactionsCount": 3914,
  "reactionBreakdown": { "like": 3204, "love": 587, "care": 83, "wow": 19, "angry": 15, "sad": 4, "haha": 2 },
  "commentsCount": 358,
  "sharesCount": 241,
  "viewsCount": null,
  "isPinned": false,
  "isSponsored": false,
  "hashtags": ["WinningIsntForEveryone", "Paris2024"],
  "mentions": [],
  "sharedPost": null,
  "isNew": true,
  "scrapedAt": "2026-11-14T10:23:33.211Z"
}
```

A Page:

```json
{
  "type": "page",
  "pageId": "15087023444",
  "name": "Nike",
  "url": "https://www.facebook.com/nike",
  "category": "Sportswear Store",
  "followers": 39000000,
  "followersText": "39M followers",
  "verified": true,
  "website": "http://nike.com/",
  "createdAt": "2008-05-21",
  "isRunningAds": true,
  "responsibleEntity": "NIKE, Inc."
}
```

A comment (names in this example are invented):

```json
{
  "type": "comment",
  "commentId": "2169028420667220",
  "postId": "1093582262136482",
  "text": "Great shot!",
  "authorName": "Alex Rivera",
  "createdAt": "2026-11-13T05:55:57.000Z",
  "reactionsCount": 0,
  "repliesCount": 0,
  "parentId": null,
  "depth": 0
}
```

An error row (free):

```json
{
  "type": "error",
  "inputUrl": "https://www.facebook.com/this-page-does-not-exist-8812731",
  "errorCode": "private-or-missing",
  "message": "Facebook says this Page or profile is not available. It may be deleted, private, age- or country-restricted, or misspelled."
}
```

The `SUMMARY` record in the run's key-value store lists every Page with its stop reason, the number of posts and comments, and the requests and bytes per proxy route.

### Tips for better runs

- **Start small.** Try 10–20 posts per Page while you check the fields, then raise the limit.
- **Weekly reports:** set **Posts from** to `7 days`. Older posts are not charged.
- **Monitoring:** turn on **Only new posts** and schedule the Actor. Use a fixed **State key** per schedule. Turn off **Include Page details** if you do not need a fresh Page snapshot on every run.
- **Comments cost more than posts in bulk.** Keep **Max comments per post** at what you need.
- **Leave the proxy on.** Requests go out directly first; the proxy is used only after Facebook blocks or rate-limits a request.

### Limitations

- **Public content only.** A Page that needs a login, an age or country gate, or a profile whose posts are visible only to friends returns an error row (`private-or-missing` or `timeline-not-public`) and is not charged.
- **Comments are what Facebook shows logged out.** That is often a subset: on older posts we measured about a third of the reported `commentsCount` (which also counts replies), and many replies are hidden.
- **Likes:** the new Facebook Page layout shows followers, not likes, to logged-out visitors, so `likes` is usually null. Follower counts are rounded by Facebook.
- **Pinned posts** are detected by position (a first post older than the next one); Facebook does not mark them for logged-out visitors.
- **About-tab fields** (`createdAt`, `isRunningAds`, `responsibleEntity`, and contacts listed only on the About tab) are read only over a direct connection, because each About tab is 1–3 MB. From Apify cloud, Facebook answered direct requests with a login wall or rate limit in every test run, so these fields were empty there. Contacts shown on the Page itself (website, often phone or email) are still filled.
- **Media URLs expire.** Facebook signs photo and video links; download the files soon after the run.
- Pages are read one after another. Very old posts on some Pages load slowly; the run continues where Facebook leaves off.

### FAQ

#### Is this a Facebook Graph API alternative?

Yes for public data. You get structured Page posts through Apify (Console, API, or integrations) without a Meta developer app, app review, or Page tokens. It is not Meta's official API, and it reads only what a logged-out visitor can see.

#### How much does it cost to scrape 1,000 Facebook posts?

$2.00 on the Apify Free plan, $1.80 on Bronze, $1.60 on Silver, and $1.40 on Gold and higher. Each Page checked in a run adds $0.004, and each run $0.0005. Comments ($0.80 → $0.50 per 1,000) and Page details ($0.002 → $0.0015 per Page) are optional and charged only when you turn them on.

#### How do I export Facebook posts to CSV or Excel?

Run the Actor, open the **Output** tab, choose the **Posts** view, and click **Export**. CSV, Excel, JSON, XML, and HTML are available. Use the **Comments** or **Pages** view to export those rows.

#### Do I need a Facebook account or cookies?

No. The Actor never logs in and never asks for cookies.

#### Can I scrape Facebook profiles too?

Public profiles work when their posts are visible logged out (for example public figures). Otherwise you get a free `timeline-not-public` error row.

#### How do I get only new posts?

Turn on **Only new posts**. The Actor remembers delivered post ids under the **State key** and skips them for free. Every post also has `isNew`.

#### How far back can it go?

Set **Max posts per Page** to 0 and, optionally, **Posts from**. The Actor follows the public timeline until Facebook stops, your date is reached, the run times out, or your maximum charge is hit.

#### Why did a Page return an error?

Open the Page in a private browser window. If Facebook asks you to log in, says the content is not available, or shows no posts, the Page is not public. Error rows are never charged.

#### Can I scrape Facebook groups or ads?

Use [Facebook Group Posts Scraper](https://apify.com/valev-lab/facebook-groups-scraper) for public groups and [Facebook Ads Library Scraper](https://apify.com/valev-lab/facebook-ads-library) for ads.

### Legal and ethics

> This Actor collects only content visible on public Facebook Pages without logging in. Post and comment rows can contain names and text that people published publicly. Personal data is protected by the GDPR in the European Union and by other laws worldwide. Do not scrape personal data unless you have a legitimate reason. If you are unsure, consult your lawyers. Respect Facebook's terms.

### Support

- Use the **Issues** tab for bugs and feature requests.
- Use the **API** tab for programmatic runs, webhooks, and dataset access.

# Actor input Schema

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

Page URLs (https://www.facebook.com/nike), vanity names (nike), or numeric Page or profile ids. profile.php?id=, /pages/<name>/<id>, m. and web. links work too. The same Page entered twice is read once. Group links are skipped; use Facebook Group Posts Scraper for groups. Leave empty to read 5 posts from a demo Page.

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

Posts saved per Page. 0 reads as far back as Facebook serves the public timeline, within the run timeout and your spending limit.

## `dateFrom` (type: `string`):

Keep posts on or after this time: YYYY-MM-DD, an ISO timestamp, or a phrase such as 7 days, 2 weeks, 3 months. Reading stops after 3 older posts in a row, so a pinned old post does not end it. Older posts are not charged.

## `dateTo` (type: `string`):

Keep posts before this time. A plain date (YYYY-MM-DD) includes that whole day (UTC). Newer posts are skipped for free while the run pages back.

## `includeComments` (type: `boolean`):

Save the comments Facebook shows logged out, as separate rows (type = comment). Billed per comment.

## `maxCommentsPerPost` (type: `integer`):

Comments saved per post, replies included. 0 saves every comment Facebook serves logged out.

## `includeReplies` (type: `boolean`):

Also save replies to comments. Facebook hides many replies from logged-out visitors, especially on older posts.

## `includeReactionBreakdown` (type: `boolean`):

Add reactionBreakdown (like, love, care, haha, wow, sad, angry) to each post. No extra request and no extra charge.

## `includePageInfo` (type: `boolean`):

Save one row per Page (type = page): category, followers, verified badge, website, public email and phone, creation date, and whether it runs ads. Billed once per Page as page-info.

## `monitorMode` (type: `boolean`):

Save only posts not delivered before under this state key. Already-seen posts are skipped for free, and a Page stops after 3 seen posts in a row. Every run remembers delivered posts, so isNew is set even when this is off.

## `stateKey` (type: `string`):

Name of the memory for Only new posts, up to 80 characters. Leave empty to derive it from the Page list. Use different keys for independent schedules.

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

Requests go out directly first. After a login wall or rate limit, your proxy URLs are used when present; otherwise Apify Residential. Turn Apify Proxy off to stay direct.

## Actor input object example

```json
{
  "pages": [
    "https://www.facebook.com/nike"
  ],
  "maxPostsPerPage": 50,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "includeReplies": false,
  "includeReactionBreakdown": true,
  "includePageInfo": true,
  "monitorMode": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `posts` (type: `string`):

Post columns. Filter type = post for a posts-only table.

## `pages` (type: `string`):

Page details and error rows.

## `comments` (type: `string`):

Comment columns.

## `summary` (type: `string`):

Posts per week, averages, and the best post per Page.

## `dataset` (type: `string`):

Every row with all fields.

## `runSummary` (type: `string`):

Stop reason per Page, success rate, proxy requests and bytes. Not an invoice.

# 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": [
        "https://www.facebook.com/nike"
    ],
    "maxPostsPerPage": 50,
    "includeComments": false,
    "maxCommentsPerPost": 20,
    "includeReplies": false,
    "includeReactionBreakdown": true,
    "includePageInfo": true,
    "monitorMode": false,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("valev-lab/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 = {
    "pages": ["https://www.facebook.com/nike"],
    "maxPostsPerPage": 50,
    "includeComments": False,
    "maxCommentsPerPost": 20,
    "includeReplies": False,
    "includeReactionBreakdown": True,
    "includePageInfo": True,
    "monitorMode": False,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("valev-lab/facebook-page-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 '{
  "pages": [
    "https://www.facebook.com/nike"
  ],
  "maxPostsPerPage": 50,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "includeReplies": false,
  "includeReactionBreakdown": true,
  "includePageInfo": true,
  "monitorMode": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call valev-lab/facebook-page-posts-scraper --silent --output-dataset

```

## MCP server setup

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