# Facebook Posts Scraper (`calm_builder/facebook-posts-scraper`) Actor

Scrape public Facebook posts from pages, profiles and groups, or single post, reel and video links: text, date, reactions by type, comments, shares, views, photos and videos - plus comments and replies if you want them. Date filters. No login needed.

- **URL**: https://apify.com/calm_builder/facebook-posts-scraper.md
- **Developed by:** [Coder](https://apify.com/calm_builder) (community)
- **Categories:** Social media, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 99 total users, 9 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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

Collect public Facebook posts, with no login and no cookies, from:

- **Pages** such as `https://www.facebook.com/nasa`
- **Profiles** such as `https://www.facebook.com/zuck` or `https://www.facebook.com/profile.php?id=…`
- **Public groups** such as `https://www.facebook.com/groups/dogspotting`
- **Single posts, reels and videos** (share links and `pfbid` links work too)

For every post you get the text, date, post type, reactions in total and by type, comment and share counts, video views and plays, photos in full size with alt text, video download links, hashtags, mentions, link previews and shared posts.

You can also collect each post's **comments and replies** in the same run. Posts and comments each go into their own table.

### How to use it

1. Paste one or more links. You can mix pages, profiles, groups and single posts in one list.
2. Set how many posts to collect per page or group, and optionally a date range.
3. Optionally turn on **Also collect comments**.
4. Click **Start**. Results appear in the **Posts** and **Comments** tabs as they are found, and can be exported to JSON, CSV or Excel.

### Output

#### Posts

| Field | Example |
|---|---|
| postUrl, postId | https://www.facebook.com/NASA/posts/pfbid02xZm…, 1639924700836233 |
| postType | photo, video, reel, link, event, shared, text, mixed |
| authorName, authorProfileUrl | NASA - National Aeronautics and Space Administration, https://www.facebook.com/NASA |
| groupName, groupId | Dogspotting, 10487409466 (group posts) |
| text, hashtags, mentions | "Spotted two very similar black doggos…", \[nasa, artemis], \[{name, url}] |
| publishedAt | 2026-09-28T16:02:11Z |
| reactions, reactionsLike … reactionsAngry | 74, 60 … 0 |
| commentCount, shares | 104, 180 |
| views, plays, videoDurationSec | 765, 2134, 38.7 (videos and reels) |
| media | \[{kind: photo, url, width, height, altText}, {kind: video, hdUrl, sdUrl, thumbnailUrl}] |
| linkPreview, sharedPost, event | the link card, the post that was shared, the event card |

#### Comments

| Field | Example |
|---|---|
| postUrl, postAuthorName | the post the comment belongs to |
| commentUrl, commentId | https://www.facebook.com/…?comment_id=…, 1204587… |
| text, createdAt | "Incredible shot!", 2026-09-28T17:40:02Z |
| authorName, authorUrl | Jane Doe, https://www.facebook.com/jane.doe |
| reactions, reactionsLike … | 12, 10 … |
| replyCount, depth, parentCommentId | 3, 0 (comment) / 1 (reply) / 2 (reply to a reply), parent's id |

### Options

| Option | What it does |
|---|---|
| Posts per page or group | How many posts to collect from each page, profile or group |
| Only posts newer / older than | A date (`2026-09-01`) or a period (`7 days`, `2 weeks`) |
| Group post order | New posts, top posts or recent activity |
| Collect every photo of multi-photo posts | Facebook lists the first 5 photos of an album post; this collects all of them |
| Comments per post, Comment order | Most relevant, newest first, or all |
| Include replies, Reply depth | Replies, or replies and replies to replies |

**Scheduled runs:** to collect only fresh posts on a daily schedule, set *Only posts newer than* to `1 day`.

If you are coming from another Facebook scraper, the common input names (`startUrls`, `resultsLimit`, `onlyPostsNewerThan`, `onlyPostsOlderThan`, `includeNestedComments`) work here too.

### Good to know

- Only public content is supported. Private groups are named in the run log as private; removed posts and pages visible only when logged in are listed as not found. Neither is charged.
- **Reel comments:** Facebook's website hides reel comments from logged-out visitors; this Actor collects them anyway.
- **Replies:** for long reply threads, Facebook itself shows only some of the replies it counts - the same happens in a browser, even when logged in. The Actor collects every reply Facebook makes available.
- Pinned posts are skipped on pages, so the list starts with the newest post.
- **Every photo** works for page, profile and group posts, in the post's own order.

### Pricing

You pay per result: one charge per post, per comment or reply, and per extra gallery photo when that option is on. The free plan lets you try every option on up to 3 links, 10 posts per link and 10 comments per post.

# Actor input Schema

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

Public pages (https://www.facebook.com/nike), profiles, groups (https://www.facebook.com/groups/dogspotting), or single post, reel and video links. You can also upload a file of links.

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

Maximum number of posts collected from each page, profile or group. A single post link always gives one post.

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

Pick a date, or a period back from now (for example 7 days). Leave empty for no limit.

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

Pick a date, or a period back from now. Combine with 'newer than' for a date range. Leave empty for no limit.

## `groupSortBy` (type: `string`):

Which group posts come first. 'New posts' works best with the date filters.

## `scrapeAllPhotos` (type: `boolean`):

Facebook lists the first 5 photos of an album post. Turn this on to collect all of them (charged per extra photo).

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

Each comment is one row in the Comments table, linked to its post.

## `commentsPerPost` (type: `integer`):

Maximum number of comments (replies included) collected from each post.

## `commentsSortBy` (type: `string`):

Which comments come first.

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

Also collect replies to comments. Facebook shows only some replies of long threads, even to logged-in users.

## `replyDepth` (type: `string`):

Replies only, or replies and the replies to those replies.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/nasa"
    },
    {
      "url": "https://www.facebook.com/groups/dogspotting"
    }
  ],
  "maxPosts": 10,
  "groupSortBy": "new",
  "scrapeAllPhotos": false,
  "includeComments": false,
  "commentsPerPost": 10,
  "commentsSortBy": "relevant",
  "includeReplies": false,
  "replyDepth": "1"
}
```

# Actor output Schema

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

No description

## `comments` (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/nasa"
        },
        {
            "url": "https://www.facebook.com/groups/dogspotting"
        }
    ]
};

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

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

```

## MCP server setup

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