# Facebook Posts Scraper — Reactions, Comments & Video Views (`apimy/facebook-posts-scraper`) Actor

Scrape posts from any public Facebook Page or profile: text, date, all 7 reaction types, comments, shares, video plays and views, photos with alt text, HD video links, hashtags, engagement rate. Free date range and filters, comments add-on, transcripts. No login.

- **URL**: https://apify.com/apimy/facebook-posts-scraper.md
- **Developed by:** [Nikita Iakovlev](https://apify.com/apimy) (community)
- **Categories:** Social media, Marketing
- **Features:** Limited permissions
- **Stats:** 24 total users, 11 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.60 / 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.
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 Posts Scraper — Reactions, Comments & Video Views

**Facebook Posts Scraper** collects posts from any public Facebook Page or public profile and turns them into clean rows: text, publication time, **all 7 reaction types**, comments, shares, video plays and views, photos with their alt text, HD and SD video links, the shared link, hashtags, mentions, collaborators, the Page's followers and an **engagement rate** for every post. Add the **comments add-on** to get every comment as its own row, turn on **video transcripts** for free, filter by date, post type, reactions, views or keywords at no extra cost, and put it on a schedule to receive **only new posts**. No Facebook login, no cookies, no browser extension — your accounts are never at risk. Export to JSON, CSV, Excel, XML or HTML, or use it through the API, MCP, Make, n8n and Zapier.

![Facebook post scrapers tested side by side on the same Pages: this Actor returned the same posts with identical reaction, comment and share numbers twice as fast, 56 filled fields per post instead of 32, at $0.0030 → $0.0016 per post instead of $0.0050 → $0.0020, with a free date filter, comments, filters and monitoring](https://api.apify.com/v2/key-value-stores/uuURjC1E8NUkctTxV/records/fbposts-tested-2026-11-14.png?signature=10iS86NkXZzAxmxUHurSF)

### What you get

- 📝 **Posts from many Pages in one run** — Page links, `profile.php?id=` links, mobile links or just the Page name (`NASA`, `natgeo`).
- 👍 **Engagement, complete** — total reactions *and* every type separately (Like, Love, Care, Haha, Wow, Sad, Angry), comments, shares, plus `engagement` (reactions + comments + shares) and `engagementRate` against the Page's followers.
- 🎬 **Video and reel metrics** — plays, views, duration, HD and SD file links, thumbnail, reel / live flags.
- 🖼 **Media** — every photo of an album with width, height and Facebook's alt text ("May be an image of…"), every video with its links.
- 🔗 **Links and entities** — the shared external link with title and domain, links in the text, `#hashtags`, tagged Pages and people, the original post of a share, collaborators and the "Paid partnership" flag.
- 💬 **Comments add-on** — each comment as a separate row right after its post: text, time, author name and picture, reactions, replies, attached images. Most relevant, newest or all.
- 🗣 **Video transcripts** — the spoken text of videos and reels that have captions (including Facebook's auto-captions). Free.
- 👀 **Top comments preview** — the 1–2 comments Facebook ships with every post, free, without the add-on.
- 🏷 **Page details on every row** — Page ID, name, username, category, followers, verified badge, Meta Ad Library ID and picture.
- 📅 **Free date range** — "newer than", "older than" or both, as dates or as "7 days" / "3 months". Facebook filters on its side, so an old period is reached directly.
- 🎯 **Free filters** — post type, minimum reactions, comments, shares, video views, must-contain and must-not-contain words, paid partnerships only.
- 🔁 **Only new posts** — name a monitoring memory and every later run delivers (and charges) only posts and comments it has not delivered before, stopping at the first known post.
- 📊 **Sorting** — newest, oldest, most reactions, most comments, most shares, most views or highest engagement.

### Why this one

| | This Actor | Typical Facebook posts scraper |
| --- | --- | --- |
| Price per post (Free → Gold plan) | **$0.0030 → $0.0016** | $0.0050 → $0.0020 |
| Date range filter | **free** | often a paid add-on per post |
| Reactions by all 7 types | ✔ | ✔ |
| Comments as rows | ✔ add-on, $0.0006 → $0.0004 per comment | usually a separate Actor |
| Filters (type, reactions, comments, shares, views, keywords) | ✔ free | ✘ |
| Engagement rate, Page followers and category on each post | ✔ | ✘ |
| Hashtags, mentions, links in text | ✔ | partly |
| Only new posts since last run | ✔ | ✘ |
| Video transcripts | ✔ free | sometimes |
| Filled fields per post (NASA, 10 posts) | **56** | 32 |
| NASA, 10 newest posts — run time | **7 s** | 15 s |

Measured on 14 November 2026 with both Actors on the same Pages within the same minute; the reaction, comment and share numbers matched post for post.

### How it works (and why it needs no login)

Facebook shows public Pages to everyone, including visitors who are not logged in. The Actor opens a Page exactly like such a visitor does — through a residential internet address, because Facebook sends server addresses straight to the login page — and reads the same post feed the Page shows in a browser, three posts per request, newest first. Pinned posts are skipped so the order stays strictly by date.

- **Date range** is passed to Facebook itself, so asking for "December 2024" jumps straight there instead of paging through two years of newer posts.
- **Comments** are read from the same public comment list a visitor sees under a post, ten per request.
- **Transcripts** come from the caption file Facebook attaches to videos.
- **If an address gets blocked** the Actor moves to the next one automatically: a cheap residential pool first, then a second pool, then Apify residential, and as the very last resort an unblocking service. Your run keeps going and you are not charged for any of it — the cost per post is fixed.

Your own proxy URLs, if you give them, are used as they are and never replaced.

### Quick start

1. Open the Actor and paste one or more Page links into **Facebook Pages or profiles** (or type names into **…or Page names / IDs**).
2. Set **Max posts per Page** — for example 50.
3. Optionally set **Posts newer than** (`30 days`) and any filters.
4. Click **Start**. Rows appear in the **Output** tab as they are found; download them as JSON, CSV, Excel, XML or HTML.

Leave everything empty and click Start to see a 10-post demo from Humans of New York.

### Input example

```json
{
    "startUrls": [
        { "url": "https://www.facebook.com/NASA" },
        { "url": "https://www.facebook.com/natgeo" }
    ],
    "pageNames": ["humansofnewyork"],
    "maxPostsPerPage": 100,
    "onlyPostsNewerThan": "3 months",
    "postTypes": ["video", "reel"],
    "minVideoViews": 10000,
    "includeComments": true,
    "maxCommentsPerPost": 30,
    "commentsSort": "relevant",
    "includeVideoTranscript": true,
    "sortBy": "views",
    "onlyNewRowsStore": "competitor-videos"
}
```

### Output example

A post row (long values shortened):

```json
{
    "type": "post",
    "postId": "1678344756994227",
    "url": "https://www.facebook.com/reel/1056346190744779/",
    "time": "2026-11-05T22:04:27.000Z",
    "timestamp": 1793916267,
    "text": "NASA astronaut Anil Menon and CSA (Canadian Space Agency) astronaut Joshua Kutryk installed …",
    "textLength": 292,
    "postType": "reel",
    "authorName": "NASA - National Aeronautics and Space Administration",
    "authorId": "100044561550831",
    "likes": 19065,
    "comments": 715,
    "shares": 432,
    "reactions": { "Like": 17071, "Love": 1192, "Haha": 523, "Wow": 151, "Care": 117, "Angry": 8, "Sad": 3 },
    "reactionLikeCount": 17071,
    "reactionLoveCount": 1192,
    "reactionCareCount": 117,
    "reactionHahaCount": 523,
    "reactionWowCount": 151,
    "reactionSadCount": 3,
    "reactionAngryCount": 8,
    "engagement": 20212,
    "engagementRate": 0.0722,
    "isVideo": true,
    "isReel": true,
    "videoPlayCount": 1510380,
    "videoViewCount": 494319,
    "videoDurationSec": 23.1,
    "videoUrlHd": "https://video-ord5-2.xx.fbcdn.net/o1/v/t2/f2/m366/….mp4",
    "videoUrlSd": "https://video-ord5-1.xx.fbcdn.net/o1/v/t2/f2/m412/….mp4",
    "captionText": null,
    "thumbnail": "https://scontent-ord5-1.xx.fbcdn.net/v/t15.5256-10/….jpg",
    "mediaCount": 1,
    "media": [{ "type": "video", "id": "1056346190744779", "durationSec": 23.1, "width": 1080, "height": 1920, "isReel": true, "videoUrlHd": "https://…" }],
    "imageAltTexts": [],
    "link": null,
    "textLinks": [],
    "hashtags": [],
    "mentions": [],
    "sharedPost": null,
    "collaborators": [],
    "paidPartnership": false,
    "topComments": [],
    "pageId": "100044561550831",
    "pageName": "NASA - National Aeronautics and Space Administration",
    "pageUrl": "https://www.facebook.com/NASA",
    "pageUsername": "NASA",
    "pageCategory": "Government organization",
    "pageFollowers": 28000000,
    "pageFollowersText": "28M",
    "pageVerified": true,
    "pageAdLibraryId": "54971236771",
    "inputUrl": "https://www.facebook.com/NASA",
    "scrapedAt": "2026-11-14T05:35:35.072Z"
}
```

A comment row (with **Scrape comments** on):

```json
{
    "type": "comment",
    "commentId": "2332508050921595",
    "commentUrl": "https://www.facebook.com/NASA/posts/pfbid02wE2b…?comment_id=2332508050921595",
    "commentText": "293 moons is a wild number. Most of them must be small rocks nobody will ever name…",
    "commentTime": "2026-11-12T20:33:51.000Z",
    "commentAuthorName": "Moslim Oskanov",
    "commentAuthorUrl": "https://www.facebook.com/Bekov.Muslim",
    "commentAuthorPicture": "https://scontent-ord5-2.xx.fbcdn.net/…",
    "commentReactions": 0,
    "commentReplies": 0,
    "commentDepth": 0,
    "commentImages": [],
    "postId": "1685704526258250",
    "postUrl": "https://www.facebook.com/NASA/posts/pfbid02wE2b…",
    "pageName": "NASA - National Aeronautics and Space Administration"
}
```

The **Output** tab has ready-made views: **Posts**, **Reactions by type**, **Media and links**, **Comments** and **Errors and notices**. A Page that cannot be scraped gets one free row with `error` (a code) and `errorDescription` (in words), and the run still succeeds.

### Input fields

| Field | What it does |
| --- | --- |
| `startUrls` | Page and profile links: `https://www.facebook.com/NASA`, `https://m.facebook.com/natgeo`, `https://www.facebook.com/profile.php?id=…`. A text file of links can be uploaded too. |
| `pageNames` | Page usernames or numeric IDs without a link: `NASA`, `natgeo`, `100044561550831`. |
| `maxPostsPerPage` | Posts to deliver per Page after filters (default 50). |
| `onlyPostsNewerThan` | Date (`2025-03-12`), UTC time (`2025-09-23T10:02:01`) or period (`7 days`, `2 months`, `1 year`, `3 hours`). Free. |
| `onlyPostsOlderThan` | Same formats; combine both for a range. Free. |
| `postTypes` | photo, album, video, reel, link, text, share, other. Empty = all. "video" also keeps reels. |
| `minReactions` / `minComments` / `minShares` | Keep posts at or above these numbers. 0 = off. |
| `minVideoViews` | Keep videos and reels with at least this many views. 0 = off. |
| `includeKeywords` | Keep posts whose text, link title or hashtags contain any of these words. |
| `excludeKeywords` | Drop posts containing any of these words. |
| `onlyPaidPartnership` | Keep only "Paid partnership" (branded content) posts. |
| `includeComments` | Comments add-on: each comment as a row after its post (charged per comment). |
| `maxCommentsPerPost` | Up to this many comments per post (default 20). |
| `commentsSort` | `relevant` (Facebook default), `newest`, or `all` (including ones Facebook hides as low quality). |
| `includeVideoTranscript` | Spoken text of captioned videos in `captionText`. Free. |
| `includeTopComments` | Keep Facebook's 1–2 preview comments in `topComments`. Free, on by default. |
| `includeMediaDetails` | Full `media` objects; untick for a flat `mediaUrls` list (handy in CSV). |
| `includePageDetails` | Page username, category, followers, badge, Ad Library ID and picture on every row. |
| `sortBy` | newest (streams as found), oldest, reactions, comments, shares, views, engagement. |
| `includeRunSummary` | One free row at the end with what was delivered and charged. |
| `onlyNewRowsStore` | Monitoring memory name — later runs deliver only posts and comments not delivered before. |
| `maxConcurrency` | Pages read in parallel (default 3). |
| `proxyCountry` | Country of the residential addresses (default US). |
| `proxyConfiguration` | Leave as is, or give your own proxy URLs. |

### Pricing — pay per post

You pay only for what is delivered. Platform usage and residential proxies are included.

| Event | Free | Starter (Bronze) | Scale (Silver) | Business (Gold) and up |
| --- | --- | --- | --- | --- |
| Post | $0.0030 | $0.0028 | $0.0022 | $0.0016 |
| Comment (add-on) | $0.0006 | $0.0006 | $0.0005 | $0.0004 |
| Run start | $0.001 | $0.001 | $0.001 | $0.001 |

Free of charge: the date range, every filter, video transcripts, the top-comments preview, Page details, sorting, monitoring, posts removed by filters, posts already delivered in monitoring mode, and every error or notice row.

**Examples**

- 1,000 posts from 20 competitor Pages on the Free plan: 1,000 × $0.003 + $0.001 = **$3.00**.
- 500 posts with 20 comments each on the Scale plan: 500 × $0.0022 + 10,000 × $0.0005 + $0.001 = **$6.10**.
- A daily monitoring run over 10 Pages that finds 15 new posts on the Business plan: 15 × $0.0016 + $0.001 = **$0.025** a day.

The $5 monthly credit of the Apify Free plan covers about 1,600 posts. On the Free plan a run returns up to 100 rows (posts + comments) and 5 Pages; any paid plan removes the limit. Set **Max cost per run** in the run options and the Actor stops cleanly at that amount, with everything written paid for.

### Use cases

- **Competitor content research** — which formats and topics get the most reactions, comments and shares on your competitors' Pages; sort by engagement and filter by post type.
- **Social listening and brand monitoring** — schedule the Actor with a monitoring memory and receive only new posts (and new comments) every morning in Google Sheets, Slack or e-mail.
- **Influencer and sponsorship research** — paid partnership flag, collaborators and engagement rate per post.
- **Video performance** — plays, views, duration and transcripts of reels across Pages; `minVideoViews` keeps only the hits.
- **Comment and sentiment analysis** — export thousands of comments with time and reactions for NLP, LLM summaries or customer-feedback mining.
- **Archiving and reporting** — keep a dated copy of everything a Page published in a quarter, with media links and alt texts.
- **Ad research** — every row carries the Page's Meta Ad Library ID, ready for an ads lookup.
- **AI agents and RAG** — clean JSON with text, transcripts and comments, ready for ChatGPT, Claude or a vector database.

### Integrations and API

- **API** — start runs and download results with the [Apify API](https://docs.apify.com/api/v2). JavaScript: `npm install apify-client`; Python: `pip install apify-client`. The **API** tab has ready code for this Actor.
- **MCP** — let Claude, ChatGPT or your own agent run the scraper through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).
- **No-code** — Make, n8n, Zapier, Google Sheets, Slack, Airbyte, Keboola and [webhooks](https://docs.apify.com/platform/integrations/webhooks) when a run finishes.
- **Schedules** — run every hour, day or week from the **Schedules** section; combine with **Only new posts** for a clean feed.

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('apimy/facebook-posts-scraper').call({
    startUrls: [{ url: 'https://www.facebook.com/NASA' }],
    maxPostsPerPage: 50,
    onlyPostsNewerThan: '30 days',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter((r) => r.type === 'post').length, 'posts');
```

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("apimy/facebook-posts-scraper").call(run_input={
    "startUrls": [{"url": "https://www.facebook.com/natgeo"}],
    "maxPostsPerPage": 100,
    "includeComments": True,
    "maxCommentsPerPost": 20,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    if row["type"] == "post":
        print(row["time"], row["likes"], row["comments"], row["url"])
```

### FAQ

**Do I need a Facebook account or cookies?**
No. The Actor reads only what Facebook shows to visitors who are not logged in. Nothing is posted, liked or followed, and no account of yours is involved.

**Can I scrape personal profiles?**
Public profiles that Facebook shows to logged-out visitors (public figures, creators) work like Pages. Private personal profiles show no posts and return a free `NO_PUBLIC_POSTS` or `NOT_FOUND` row.

**Why does a Page return fewer posts than it has?**
Facebook shows logged-out visitors only public posts. Posts limited to a country or age group, and posts the Page hid, are not visible. Now and then Facebook also leaves an individual reel out of the public feed; it then does so for every logged-out visitor. Pinned posts are skipped on purpose to keep the date order.

**Why did a well-known brand fail with NOT_FOUND?**
Pages about alcohol, gambling and similar topics are often restricted by age or country by their owners. Facebook shows them only to logged-in adults and answers "this content isn't available" to everyone else — the Actor reports this right away, free, instead of retrying.

**How does the date filter work, and why is it free?**
The dates go to Facebook together with the feed request, so Facebook itself returns only posts from that window. It costs us nothing extra, so it costs you nothing extra. Dates without a time are read as midnight UTC.

**Why are some view counts empty?**
Facebook shows play and view counters only for videos and reels, and not for every video (for example, some videos shared from other Pages).

**Are follower counts exact?**
Facebook shows logged-out visitors a rounded counter ("28M followers"); `pageFollowers` is that counter as a number and `pageFollowersText` is the original text. Reactions, comments and shares on posts are exact numbers.

**How long do media links work?**
Photo and video links are signed by Facebook and expire after a few days. Download the files if you need to keep them.

**How does monitoring work?**
Type a memory name into **Only new posts**. The Actor stores the IDs of everything it delivered under that name in your Apify storage. On the next run it skips — and does not charge — known posts and comments, and stops reading a Page after three known posts in a row, because the feed is newest first. Use a different name for every watch list.

**Can I get replies to comments?**
Top-level comments are delivered; each carries `commentReplies` with the number of replies.

**Is it legal to scrape Facebook posts?**
The Actor collects only content that Pages publish publicly and never logs in. Results can still contain personal data (for example commenters' names), which laws such as the GDPR protect. Scrape personal data only with a legitimate reason, and ask a lawyer if unsure. Apify's blog has a guide on [whether web scraping is legal](https://blog.apify.com/is-web-scraping-legal/).

### Limits, honestly

- Only public content visible to logged-out visitors; no groups, no private profiles, no Stories.
- Facebook serves 3 posts and 10 comments per request, so very large exports take time: about 150 posts in 80–100 seconds per Page, with several Pages read in parallel.
- Replies to comments are counted, not delivered as rows.
- Page followers are Facebook's rounded counter.
- Age- or country-restricted Pages cannot be opened without a login.
- If Facebook changes its page format, a scrape can stop working until we update the Actor — failed runs reach us automatically. Report anything odd in the **Issues** tab with the run link.

### Changelog

- **0.1 (14 Nov 2026)** — first release: posts with 7 reaction types, video metrics, media, links and entities, Page details and engagement rate; comments add-on; free transcripts, date range, filters, sorting and only-new monitoring.

# Changelog

This Actor's version history is a separate document: https://apify.com/apimy/facebook-posts-scraper/changelog.md

# Actor input Schema

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

Links of public Facebook Pages and public profiles, one per line: https://www.facebook.com/NASA, https://m.facebook.com/natgeo or https://www.facebook.com/profile.php?id=100064860875397. You can also upload a text file of links. Group, event and single-post links are not Pages and come back as a free error row.

## `pageNames` (type: `array`):

No links at hand? Type Page usernames or numeric IDs, one per line: NASA, natgeo, 100044561550831. They are read exactly like links.

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

How many posts (after your filters) to deliver from each Page. Posts come newest first. Pinned posts are skipped so the order stays by date. You pay only for delivered posts.

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

Only posts published after this moment: a date (2025-03-12), a UTC time (2025-09-23T10:02:01) or a period back from now ("7 days", "2 months", "1 year", "3 hours"). Facebook filters on its side, so this costs nothing extra.

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

Only posts published before this moment, same formats. Combine with "Posts newer than" for an exact range — an old period (e.g. all of 2024) is reached directly, without paging through newer posts. Free.

## `postTypes` (type: `array`):

Keep only these kinds of posts. Empty = all kinds. "Video" also keeps reels.

## `minReactions` (type: `integer`):

Keep posts with at least this many reactions (all types together). Great for "top posts" research.

## `minComments` (type: `integer`):

Keep posts with at least this many comments.

## `minShares` (type: `integer`):

Keep posts shared at least this many times.

## `minVideoViews` (type: `integer`):

Keep videos and reels with at least this many views (plays when Facebook shows no view count). Removes non-video posts when set above 0.

## `includeKeywords` (type: `array`):

Keep posts whose text, link title or hashtags contain at least one of these words or phrases (case-insensitive), e.g. "giveaway", "launch", "#sale".

## `excludeKeywords` (type: `array`):

Drop posts whose text, link title or hashtags contain any of these words or phrases.

## `onlyPaidPartnership` (type: `boolean`):

Keep only branded content posts marked "Paid partnership" — influencer and sponsorship research.

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

Also write the comments of every delivered post as separate rows (type "comment") right after their post: text, time, author name and picture, reactions, reply count. Charged per comment row.

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

Upper limit of comment rows per post (Facebook serves 10 per call). Posts with fewer comments return what they have.

## `commentsSort` (type: `string`):

Which comments Facebook gives first. "All comments" also includes the ones Facebook hides as low quality.

## `includeVideoTranscript` (type: `boolean`):

For videos and reels with captions (including Facebook auto-captions), return the spoken text in "captionText". Free.

## `includeTopComments` (type: `boolean`):

Facebook ships 1–2 top comments with each post — keep them in "topComments" at no extra cost and without the comments add-on.

## `includeMediaDetails` (type: `boolean`):

Each photo and video as an object (link, size, alt text, HD/SD video, duration, thumbnail). Untick for a flat "mediaUrls" list — easier in CSV and Excel.

## `includePageDetails` (type: `boolean`):

Page username, category, followers, verified badge, Ad Library ID and picture on every post row (Page ID, name and link are always there).

## `sortBy` (type: `string`):

Any order other than "newest" writes all rows at the end of the run.

## `includeRunSummary` (type: `boolean`):

One free row at the end (type "notice") with what was delivered, filtered and charged. Untick to keep the dataset posts-only.

## `onlyNewRowsStore` (type: `string`):

Give the run a memory name, e.g. "competitor-pages". The Actor remembers every post and comment it delivered under that name; later runs deliver — and charge — only new ones, and stop reading a Page at the first already-known posts. Put the Actor on a schedule for a new-post feed.

## `maxConcurrency` (type: `integer`):

How many Pages are read at the same time. Posts within one Page are read in order.

## `proxyCountry` (type: `string`):

Two-letter country of the residential addresses (US by default). Some Pages show different posts by country.

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

Leave as is: the Actor rotates its own residential addresses for Facebook (Facebook sends server addresses to the login page) and falls back to an unblocker when needed. Your own proxy URLs, if given, are used as they are.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/humansofnewyork"
    },
    {
      "url": "https://www.facebook.com/NASA"
    }
  ],
  "pageNames": [],
  "maxPostsPerPage": 20,
  "onlyPostsNewerThan": "",
  "onlyPostsOlderThan": "",
  "postTypes": [],
  "minReactions": 0,
  "minComments": 0,
  "minShares": 0,
  "minVideoViews": 0,
  "includeKeywords": [],
  "excludeKeywords": [],
  "onlyPaidPartnership": false,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "commentsSort": "relevant",
  "includeVideoTranscript": false,
  "includeTopComments": true,
  "includeMediaDetails": true,
  "includePageDetails": true,
  "sortBy": "newest",
  "includeRunSummary": true,
  "onlyNewRowsStore": "",
  "maxConcurrency": 3,
  "proxyCountry": "US",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `engagement` (type: `string`):

No description

## `media` (type: `string`):

No description

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

No description

## `all` (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": [
        {
            "url": "https://www.facebook.com/humansofnewyork"
        },
        {
            "url": "https://www.facebook.com/NASA"
        }
    ],
    "pageNames": [],
    "maxPostsPerPage": 20,
    "onlyPostsNewerThan": "",
    "onlyPostsOlderThan": "",
    "minReactions": 0,
    "minComments": 0,
    "minShares": 0,
    "minVideoViews": 0,
    "includeKeywords": [],
    "excludeKeywords": [],
    "maxCommentsPerPost": 20,
    "onlyNewRowsStore": "",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("apimy/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": [
        { "url": "https://www.facebook.com/humansofnewyork" },
        { "url": "https://www.facebook.com/NASA" },
    ],
    "pageNames": [],
    "maxPostsPerPage": 20,
    "onlyPostsNewerThan": "",
    "onlyPostsOlderThan": "",
    "minReactions": 0,
    "minComments": 0,
    "minShares": 0,
    "minVideoViews": 0,
    "includeKeywords": [],
    "excludeKeywords": [],
    "maxCommentsPerPost": 20,
    "onlyNewRowsStore": "",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("apimy/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": [
    {
      "url": "https://www.facebook.com/humansofnewyork"
    },
    {
      "url": "https://www.facebook.com/NASA"
    }
  ],
  "pageNames": [],
  "maxPostsPerPage": 20,
  "onlyPostsNewerThan": "",
  "onlyPostsOlderThan": "",
  "minReactions": 0,
  "minComments": 0,
  "minShares": 0,
  "minVideoViews": 0,
  "includeKeywords": [],
  "excludeKeywords": [],
  "maxCommentsPerPost": 20,
  "onlyNewRowsStore": "",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call apimy/facebook-posts-scraper --silent --output-dataset

```

## MCP server setup

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