# Facebook Posts Scraper: Pages, Comments & Contacts (`stratumics/facebook-posts-scraper`) Actor

Get posts from public Facebook pages: text, reactions by type, comments, shares, views and media, plus page details with followers, contacts, rating and creation date. Monitor new posts.

- **URL**: https://apify.com/stratumics/facebook-posts-scraper.md
- **Developed by:** [Stratum ICS](https://apify.com/stratumics) (community)
- **Categories:** Social media, Lead generation, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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.
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** gets the posts of public **Facebook pages**: text, publish time, total reactions and **reactions by type**, comment, share, view and play counts, images with their descriptions, videos with download links, link previews and the original of shared posts. It also saves one row of **page details** per page (followers, category, intro, the email, phone, website and address the page shows, rating, **creation date** and whether the page runs ads) and, when you ask, the **comments** shown under each post.

Use it to track brands, competitors and news pages, measure engagement, collect leads from page contact details, or feed posts to an analytics or AI tool. No Facebook account, cookies or API token are needed, and a monitoring mode saves only the posts that are new since your last run.

### Why use this Facebook Posts Scraper?

- **Pages and posts in one run.** Give page links or usernames and get each page's details plus its newest posts, or give post links to read single posts, photos, videos and reels.
- **Newest first, as far back as you want.** Posts come in the page's own order, newest first, through the page's timeline: set a maximum per page or a date (only posts after 2026-10-01, or from the last 7 days).
- **Engagement you can sort on.** Reactions total and by type (like, love, haha, wow, sad, angry, care), comments, shares, video views and plays, as exact numbers rather than "1.2K".
- **Media.** Image links with width, height and Facebook's description of each image; video page link, HD and SD video files, thumbnail and duration; link previews with title, domain and image.
- **Page details buyers ask for.** Followers, following, talking about, check-ins, category, intro, public email, phone, websites and address, opening hours, rating, other accounts (Instagram, TikTok), the confirmed owner, creation date, ad status and verified badge.
- **Comments on request.** The most relevant comments Facebook shows under each post, with author, time, reactions and reply count.
- **Monitoring.** Turn on "Only new posts" and schedule the run: it stops reading each page at the first post an earlier run saved. Each page it reads costs a $0.001 page check, and only new posts cost the post price.
- **Fair price.** Pay per row saved, from $1.50 per 1,000 posts. Pages Facebook does not show (missing, removed or age restricted) come back as free rows with a status, so you see what happened to every link.

### What data do you get?

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

| Post field                            | Example                | Notes                                                                 |
| ------------------------------------- | ---------------------- | --------------------------------------------------------------------- |
| `postId`, `url`                       | 1628615059302480       | The post and its link                                                 |
| `text`, `time`                        | In 2025, 247 pupils... | Post text and publish time (ISO, UTC)                                 |
| `reactionsCount`, `reactionsByType`   | 189, like 102, wow 49  | Totals as exact numbers                                               |
| `commentsCount`, `sharesCount`        | 12, 7                  |                                                                       |
| `viewsCount`, `playsCount`            | 89255, 156905          | Videos and reels; plays are what video pages show as views            |
| `images`, `videos`                    |                        | Media links, image sizes and descriptions, video files and thumbnails |
| `link`                                | bbc.in                 | Link preview: url, title, domain, image                               |
| `isShared`, `sharedPost`              | true, NASA Artemis     | The original of a shared post                                         |
| `authorName`, `authorId`, `authorUrl` | BBC News               | The page that posted                                                  |

| Page field                                                              | Example                    | Notes                                       |
| ----------------------------------------------------------------------- | -------------------------- | ------------------------------------------- |
| `name`, `username`, `url`, `pageId`, `profileId`                        | BBC News, bbcnews          | `pageId` is the id the Meta Ad Library uses |
| `category`, `intro`                                                     | Media/news company         |                                             |
| `followers`, `following`, `talkingAbout`, `checkins`, `likes`           | 62050649                   | Exact follower counts                       |
| `email`, `phone`, `website`, `websites`, `address`                      | yourvoice@bbc.co.uk        | Only what the page shows publicly           |
| `businessHours`, `priceRange`, `rating`, `ratingPercent`, `ratingCount` | 96% recommend (22 reviews) | Local businesses                            |
| `otherAccounts`, `responsibleParty`                                     | tiktok.com/@itsdoughguy    | Linked accounts, confirmed owner            |
| `creationDate`, `runningAds`, `verified`                                | 2009-12-24, true, true     | From the page's transparency box            |
| `profilePicture`, `coverPhoto`                                          |                            | Image links                                 |

| Comment field                               | Example                    | Notes                                                           |
| ------------------------------------------- | -------------------------- | --------------------------------------------------------------- |
| `commentId`, `postId`, `postUrl`            |                            | The comment and its post                                        |
| `text`, `time`                              | Wonder who manufactured... |                                                                 |
| `authorName`, `authorUrl`                   |                            | `authorUrl` only where Facebook shows it to logged-out visitors |
| `reactionsCount`, `repliesCount`, `isReply` | 1, 0, false                |                                                                 |

Page and post rows also carry `status` (`ok`, `unavailable` or `failed`) and `statusMessage`; every row carries the `input` it came from and `scrapedAt`.

### How to scrape Facebook posts

1. Add **Facebook pages**: links like facebook.com/nasa or facebook.com/profile.php?id=..., or usernames such as nasa. Add **Post links** for single posts.
2. Set **Maximum posts per page** (20 by default) and, if you like, **Only posts newer than** a date or a period such as 7 days.
3. Turn on **Include comments** if you need them. Page details are on by default.
4. Press **Start**. A page with 20 posts takes about 20 seconds, and 300 posts from five pages about a minute and a half.
5. Download the results as JSON, CSV or Excel, or read them through the API. The Output tab has Posts, Pages and Comments views with the columns of each kind of row; filter on `type` to keep one kind.

### How much does it cost?

You pay per row saved, and Apify bills it with your usage:

| Apify plan | Per 1,000 posts | Per 1,000 pages | Per 1,000 comments |
| ---------- | --------------- | --------------- | ------------------ |
| Free       | $2.50           | $4.00           | $1.00              |
| Starter    | $2.00           | $4.00           | $1.00              |
| Scale      | $1.75           | $4.00           | $1.00              |
| Business   | $1.50           | $4.00           | $1.00              |

So **1,000 posts cost $2.50** on the Free plan and $1.50 on Business. Each run also has a start fee of $0.002. One page with its details and 20 posts costs 1 × $0.004 + 20 × $0.0025 + $0.002 = $0.056 on Free; adding the comments of those 20 posts (about 10 each) adds about $0.20. Free rows for pages and posts Facebook does not show cost nothing. You can set a maximum cost per run in the run options: the scraper stops at that amount and never charges past it.

With **Only new posts** on, each page a run reads costs a page check of $0.001 on every plan, whether or not it has new posts, and its new posts cost the post price. In our test, a monitor of BBC News and ESPN saved their 20 newest posts on its first run for 2 × $0.001 + 20 × $0.0025 + $0.002 = $0.054; the second run, a few minutes later, found nothing new and cost 2 × $0.001 + $0.002 = $0.004. Run daily on 10 pages that post 5 times a day, a monitor costs 10 × $0.001 + 50 × $0.0025 + $0.002 = $0.137 a day on Free, about $4.10 a month. With page details off, later runs read each page's timeline directly instead of loading the page: the second test run took 1.8 seconds.

### Input

A page's details and its 20 newest posts:

```json
{
    "pageUrls": ["https://www.facebook.com/nasa"],
    "maxPostsPerPage": 20
}
```

Posts of the last 7 days from several pages, with comments, and no page rows:

```json
{
    "pageUrls": ["bbcnews", "https://www.facebook.com/nytimes"],
    "maxPostsPerPage": 200,
    "newerThan": "7 days",
    "includeComments": true,
    "includePageDetails": false
}
```

A daily monitor (schedule it; read at least as many posts as the pages publish between runs):

```json
{
    "pageUrls": ["https://www.facebook.com/espn", "https://www.facebook.com/natgeo"],
    "maxPostsPerPage": 50,
    "onlyNewPosts": true,
    "includePageDetails": false,
    "monitorName": "sports-and-nature-daily"
}
```

Page details only, for a lead list:

```json
{
    "pageUrls": ["https://www.facebook.com/Smithsonian", "https://www.facebook.com/profile.php?id=61576187677552"],
    "maxPostsPerPage": 0
}
```

Single posts and reels, with their comments:

```json
{
    "postUrls": [
        "https://www.facebook.com/bbcnews/posts/pfbid02fTGccnAvDdYCydKGLjrmHkX4FjB9DwTJxWbzrMNQ4UZb7wqye7eEanBLL7roqmJyl",
        "https://www.facebook.com/reel/1557618349384047/"
    ],
    "includeComments": true
}
```

### Output

Real rows, trimmed: media links are shortened and the commenter's name is left out here.

```json
[
    {
        "type": "page",
        "status": "ok",
        "statusMessage": null,
        "pageId": "228735667216",
        "profileId": "100064620046507",
        "name": "BBC News",
        "username": "bbcnews",
        "url": "https://www.facebook.com/bbcnews",
        "category": "Media/news company",
        "followers": 62050649,
        "following": 49,
        "talkingAbout": 1033833,
        "checkins": 9294,
        "likes": null,
        "intro": "BBC News is recognised by audiences around the world as a provider of news that you can trust.",
        "email": "yourvoice@bbc.co.uk",
        "phone": null,
        "website": "https://www.bbc.co.uk/news",
        "websites": ["https://www.bbc.co.uk/news"],
        "address": "BBC Broadcasting House, London, United Kingdom",
        "businessHours": "Always open",
        "priceRange": null,
        "rating": null,
        "ratingPercent": null,
        "ratingCount": null,
        "otherAccounts": [],
        "responsibleParty": "British Broadcasting Corporation",
        "creationDate": "2009-12-24",
        "runningAds": true,
        "verified": true,
        "profilePicture": "https://scontent-ord5-2.xx.fbcdn.net/.../278817116_365983165565682_365395538073123556_n.jpg",
        "coverPhoto": "https://scontent-ord5-2.xx.fbcdn.net/.../307744525_483795437117787_2281003730682989977_n.png",
        "input": "https://www.facebook.com/bbcnews",
        "scrapedAt": "2026-10-18T07:39:51.923Z"
    },
    {
        "type": "post",
        "status": "ok",
        "statusMessage": null,
        "postId": "1628615059302480",
        "url": "https://www.facebook.com/bbcnews/posts/pfbid02zL6ooHkTHG43p5F8kM4soRTeJLUDyLUX1CkagVYvWz45LMQTv19aFDcoR9GL7JKzl",
        "text": "In 2025, 247 pupils and staff at the nursery were found to have abnormally high blood lead levels after children began falling ill.",
        "time": "2026-10-18T06:00:06.000Z",
        "reactionsCount": 189,
        "reactionsByType": { "like": 102, "wow": 49, "sad": 27, "angry": 8, "care": 2, "haha": 1 },
        "commentsCount": 12,
        "sharesCount": 7,
        "viewsCount": null,
        "playsCount": null,
        "images": [],
        "videos": [],
        "link": {
            "url": "https://bbc.in/4yUvX0S",
            "title": "Nursery owner in China jailed for life after hundreds of children poisoned",
            "domain": "bbc.in",
            "imageUrl": "https://external-ord5-2.xx.fbcdn.net/.../129512743667171995"
        },
        "isShared": false,
        "sharedPost": null,
        "authorName": "BBC News",
        "authorId": "100064620046507",
        "authorUrl": "https://www.facebook.com/bbcnews",
        "input": "https://www.facebook.com/bbcnews",
        "scrapedAt": "2026-10-18T07:39:52.222Z"
    },
    {
        "type": "post",
        "postId": "1518998673415924",
        "url": "https://www.facebook.com/reel/1453450343598426/",
        "text": "Toru Utsumi works as a management consultant in Japan, but on his days off, he has become a global internet star...",
        "time": "2026-10-18T02:41:49.000Z",
        "reactionsCount": 2465,
        "reactionsByType": { "like": 1877, "love": 531, "care": 20, "haha": 20, "wow": 17 },
        "commentsCount": 58,
        "sharesCount": 197,
        "viewsCount": 89255,
        "playsCount": 156905,
        "videos": [
            {
                "id": "1453450343598426",
                "url": "https://www.facebook.com/reel/1453450343598426/",
                "thumbnailUrl": "https://scontent-lga3-1.xx.fbcdn.net/.../852160952_1449608823815647_7528145808844329940_n.jpg",
                "durationSeconds": 78.9
            }
        ],
        "authorName": "The New York Times",
        "input": "https://www.facebook.com/nytimes"
    },
    {
        "type": "comment",
        "commentId": "1855583208952951",
        "postId": "1628615059302480",
        "postUrl": "https://www.facebook.com/bbcnews/posts/pfbid02zL6ooHkTHG43p5F8kM4soRTeJLUDyLUX1CkagVYvWz45LMQTv19aFDcoR9GL7JKzl",
        "text": "Wonder who manufactured and sold the paint.",
        "time": "2026-10-18T07:05:23.000Z",
        "reactionsCount": 1,
        "repliesCount": 0,
        "isReply": false,
        "input": "https://www.facebook.com/bbcnews",
        "scrapedAt": "2026-10-18T07:39:54.723Z"
    }
]
```

A `SUMMARY` record in the run's key-value store lists each input with its status, the posts and comments saved and any error.

### Tips

- Posts arrive newest first. With **Only posts newer than**, reading a page stops at its first older posts, which keeps long-history pages cheap.
- For a monitor, set **Maximum posts per page** above the number of posts a page publishes between two runs; a run stops at the first post saved before.
- Facebook shows logged-out visitors the most relevant comments of a post, usually about 10, and about 2 on video and reel pages. Comment rows hold those; ask for fewer with **Maximum comments per post**.
- Video and image links are signed by Facebook and stop working after some days: download the files you need soon after the run.
- `followers` is exact for pages; Facebook's own page header rounds it (62M).
- Usernames work as input: nasa is the same as https://www.facebook.com/nasa.

### Integrations

- **API**: start runs and read results over the [Apify API](https://docs.apify.com/api/v2); the API tab shows ready code.
- **Python**: `pip install apify-client`, then
  ```python
  from apify_client import ApifyClient
  client = ApifyClient("<YOUR_API_TOKEN>")
  run = client.actor("stratumics/facebook-posts-scraper").call(run_input={"pageUrls": ["https://www.facebook.com/nasa"], "maxPostsPerPage": 50})
  for item in client.dataset(run["defaultDatasetId"]).iterate_items():
      if item["type"] == "post":
          print(item["time"], item["reactionsCount"], item["text"])
  ```
- **JavaScript**: `npm install apify-client`, then
  ```javascript
  import { ApifyClient } from 'apify-client';
  const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
  const run = await client
      .actor('stratumics/facebook-posts-scraper')
      .call({ pageUrls: ['bbcnews'], newerThan: '3 days', maxPostsPerPage: 500 });
  const { items } = await client.dataset(run.defaultDatasetId).listItems();
  ```
- **Zapier, Make, n8n**: use the Apify app or node to send new posts to Slack, Google Sheets, Airtable or your CRM.
- **AI agents**: connect your agent to this scraper through the Apify MCP server (mcp.apify.com), so it can read any public page's latest posts on demand.
- **Webhooks and schedules**: run it hourly or daily with "Only new posts" on and get a webhook when new posts appear.

### FAQ

#### Is it legal to scrape Facebook posts?

Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

#### Which personal data can the results hold?

Comment rows hold commenters' names and, where Facebook shows them to logged-out visitors, links to their profiles. Comments are off by default; turn them on only when you need them. Page rows hold the contact details a page publishes on its own page, such as a business email or phone.

#### Do I need a Facebook account?

No. The scraper reads Facebook as a logged-out visitor, like anyone opening a public page in a private browser window. It never logs in.

#### Can it scrape Facebook groups or private profiles?

No. Facebook asks logged-out visitors to log in before showing groups, and private profiles are not public. Group links are listed as skipped in the log.

#### Why is a page row "unavailable"?

Facebook shows logged-out visitors no page at that link: it does not exist, was removed, or is limited to some ages or countries (alcohol brands, for example). Such rows are free. A `failed` row means Facebook kept refusing the link; run it again later.

#### Why do some posts have no views or shares?

Views and plays exist only for video posts. Video and reel pages do not show share counts to logged-out visitors, so a reel read from a post link can lack `sharesCount`; reels read from a page's timeline have it.

#### Why did a page stop before the maximum?

The page has no more posts, they are older than your date limit, or Facebook stopped answering its timeline at some point. In the last case the page keeps the posts read so far, the run goes on with the next page, and the SUMMARY record says where it stopped.

#### How fresh are the counts?

They are read at run time. In our checks against the live site a few minutes later, counts matched or had grown by a few percent on new posts.

#### Do I need a proxy?

No setup needed. Facebook refuses its timeline from datacenter addresses, so the scraper loads pages over Apify datacenter proxy (and residential proxy when Facebook shows the login page) and the timeline over Apify residential proxy. Both are included in the price. If you pick your own proxy instead and it has only datacenter addresses, expect just each page's newest post.

#### Where can I report a problem?

Open an issue on the Issues tab with your run link and we will look at it.

### Other tools from Stratum ICS

- [Airbnb Scraper](https://apify.com/stratumics/airbnb-scraper): Get every Airbnb listing in a city or from listing links: price per night, rating, reviews, guests, bedrooms, host and Superhost status.
- [App Store Reviews Scraper](https://apify.com/stratumics/app-store-reviews-scraper): Get Apple App Store reviews with star ratings, titles, text, app versions, helpful votes and developer replies, well past Apple's 500-review limit, for any country, plus app ratings.
- [Bilibili Scraper](https://apify.com/stratumics/bilibili-scraper): Scrape Bilibili videos by search, link or uploader without logging in: views, likes, coins, tags, uploader profiles, comments with replies and danmaku, in clean rows.
- [Facebook Ads Library Scraper](https://apify.com/stratumics/facebook-ads-library-scraper): Get ads from the Meta (Facebook) Ad Library by keyword, advertiser page or library link: texts, images, videos, dates, platforms and versions, plus spend for political ads.
- [Google Ads Transparency Scraper](https://apify.com/stratumics/google-ads-transparency-scraper): Get the ads any advertiser runs on Google Search, YouTube, Shopping, Maps and Play, from the Ads Transparency Center: images, formats, dates, regions and EU reach.
- [Google Maps Reviews Scraper](https://apify.com/stratumics/google-maps-reviews-scraper): Get the Google Maps reviews of any place: rating, full text, exact date, photos, owner reply, reviewer details and food or service scores.
- [Google Maps Scraper](https://apify.com/stratumics/google-maps-scraper): Get the businesses on Google Maps for any search and area: name, address, phone, website, rating, review count, opening hours, plus emails and social profiles.
- [Google News Scraper](https://apify.com/stratumics/google-news-scraper): Get Google News articles with real publisher URLs (not Google redirects), source, date, image, author and optional full text.
- [Google Play Reviews Scraper](https://apify.com/stratumics/google-play-reviews-scraper): Get Google Play reviews with star ratings, text, app versions, thumbs-up counts, developer replies and feature ratings in any language, plus app details with installs and star histogram.
- [Google Trends Scraper](https://apify.com/stratumics/google-trends-scraper): Get Google Trends data as JSON, CSV or Excel: interest over time, interest by region and city, related queries, and trending searches by country.
- [Instagram Scraper](https://apify.com/stratumics/instagram-scraper): Scrape public Instagram profiles, posts, reels and comments without logging in: followers, bio, posts count, captions, likes, video views, media links, tags and music.
- [LinkedIn Jobs Scraper](https://apify.com/stratumics/linkedin-jobs-scraper): Scrape LinkedIn jobs with full descriptions, salary ranges, seniority, job type and applicant counts.
- [Reddit Scraper](https://apify.com/stratumics/reddit-scraper): Get Reddit posts and full comment threads from subreddits, searches, user profiles and post links: titles, text, scores, flair, media and replies.
- [Telegram Channel Scraper](https://apify.com/stratumics/telegram-channel-scraper): Get messages from public Telegram channels with views, dates, media, reactions, polls and forwards, plus channel info with exact subscriber counts.
- [Threads Scraper](https://apify.com/stratumics/threads-scraper): Scrape Threads profiles, posts, replies and keyword search: followers, bio, post text, likes, replies, reposts, quotes, media and links.
- [TikTok Comments Scraper](https://apify.com/stratumics/tiktok-comments-scraper): Export TikTok comments and replies from any video or photo post: text, date, likes, reply count, commenter, pinned and creator-liked flags, plus video stats.
- [TikTok Scraper](https://apify.com/stratumics/tiktok-scraper): Scrape TikTok profiles and videos: followers, likes, bio, the latest 10 to 12 videos of each profile, and full stats for any video link.
- [Website Contact Scraper](https://apify.com/stratumics/website-contact-scraper): Turn a list of websites into one row per company with verified emails, formatted phone numbers, social profiles (LinkedIn, Facebook, Instagram, X), address and contact page.
- [YouTube Scraper](https://apify.com/stratumics/youtube-scraper): Get YouTube videos from searches, channels, playlists and links with exact views, likes, comment counts, dates and tags, plus channel profiles and comments.
- [YouTube Transcript Scraper](https://apify.com/stratumics/youtube-transcript-scraper): Get YouTube transcripts and captions as plain text, timed segments, SRT or WebVTT, from video links, whole channels or playlists, in any language YouTube offers.

# Actor input Schema

## `pageUrls` (type: `array`):

Public pages to read, one per line: links (facebook.com/nasa, facebook.com/profile.php?id=...) or usernames (nasa). Each page gives one page row with its details and its newest posts.

## `postUrls` (type: `array`):

Single public posts to read, one per line: links to posts, photos, videos or reels. Each gives one post row (and its comments when Include comments is on).

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

How many of each page's newest posts to save. Set 0 to save page details only.

## `newerThan` (type: `string`):

Save only posts published on or after this date (UTC), or within a period back from now such as "7 days", "2 weeks" or "12 hours". Reading a page stops at its first older posts, so a short period also keeps the run cheap.

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

Also save the comments Facebook shows logged-out visitors under each post: the most relevant ones, usually about 10 a post. Takes one more page load per post with comments.

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

How many of a post's shown comments to save. Facebook shows logged-out visitors about 10 per post, so higher numbers rarely add more.

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

Save one row per page with its name, category, followers, likes, intro, contact details shown on the page (email, phone, website, address), rating, creation date, ad status and photos. Turn off to save posts only.

## `onlyNewPosts` (type: `boolean`):

For scheduled runs: save only posts that earlier runs with the same pages have not saved. Reading each page stops at the first post saved before, and each page read costs a page check ($0.001) whether or not it has new posts; new posts cost the post price. With page details off, later runs read each page's timeline directly, without loading the page. Applies to pages; post links are always read. The Actor remembers post ids and pages in the key-value store facebook-posts-monitor.

## `monitorName` (type: `string`):

Optional. A name for the remembered list, so different schedules keep separate histories even with the same pages. Leave empty to derive it from the inputs.

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

How many pages and post links are read at the same time. Each page's posts are read one batch after another.

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

Leave Apify Proxy on: the Actor then loads pages over Apify datacenter proxy (residential when Facebook shows its login page) and the timeline after each page's newest post over Apify residential proxy, which Facebook requires; both are included in the price. Your own proxy groups or URLs carry every request instead; with datacenter addresses only, expect just each page's newest post.

## Actor input object example

```json
{
  "pageUrls": [
    "https://www.facebook.com/nasa"
  ],
  "postUrls": [],
  "maxPostsPerPage": 10,
  "includeComments": false,
  "maxCommentsPerPost": 10,
  "includePageDetails": true,
  "onlyNewPosts": false,
  "monitorName": "",
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

No description

## `comments` (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 = {
    "pageUrls": [
        "https://www.facebook.com/nasa"
    ],
    "maxPostsPerPage": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("stratumics/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 = {
    "pageUrls": ["https://www.facebook.com/nasa"],
    "maxPostsPerPage": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("stratumics/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 '{
  "pageUrls": [
    "https://www.facebook.com/nasa"
  ],
  "maxPostsPerPage": 10
}' |
apify call stratumics/facebook-posts-scraper --silent --output-dataset

```

## MCP server setup

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