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

Facebook Posts Scraper: a Facebook post extractor for public pages, with text, reactions by type, comments and shares counts, video views, photos and links per post, plus each post's comments and replies. Date filters, API access, no login.

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

## Pricing

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

**Facebook Posts Scraper** turns public Facebook page and post links into an exportable engagement report: one row per post with its text, reactions by type, comments and shares counts, video views, photos and links. Filter by date, add each post's comments and replies if you want them, and download CSV, Excel or JSON or call it as a **Facebook posts API**. No login, no cookies, no browser.

| 🏷️ Page | 📝 Text | ❤️ Reactions | 💬 Comments | 🔁 Shares | 🎞️ Type | 📅 Posted |
|---|---|---|---|---|---|---|
| Humans of New York | Last year I got an email that Little Humans was go… | 5,963 | 223 | 110 | Photo | 2026-10-13T15:34:09Z |
| Humans of New York | Henry might be the nicest shopkeeper in NYC. You c… | 19,830 | 852 | 699 | Video | 2026-09-19T20:18:58Z |
| Humans of New York | “My first end-of-life patient was a 97-year-old ma… | 154,154 | 3,389 | 3,666 | Photo | 2026-09-18T14:24:05Z |

<sub>Collected 2026-10-25 (run Lcg2opBrSMGlqVpwN, build 0.1.17) with the prefilled input: Humans of New York, 50 posts, comments off. The first three rows are shown, text cut short. The run delivered 50 posts in 24.2 seconds from start to finish, 50 posts charged. One run, not a speed guarantee.</sub>

**$1.49 per 1,000 posts on the Starter plan** ($1.79 Free, $1.19 Scale, $0.79 Business). The prefilled 50 posts cost $0.0745 on Starter. Date filters are free, there is no start fee, and comments are an optional add-on at $0.24 per 1,000 comments.

**What that run delivered:** all 50 posts had the page, text, link, date, reactions, comments and shares. The 9 video posts each had a video link, duration and view count. 34 of 50 carried a top-comment preview, even with full comments off. 8 had an external link. Fields a post doesn't have come back empty (`null`).

**Next steps with the links in your rows:**

- **Comments:** paste a post's `url` into [Facebook Comments Scraper](https://apify.com/deepmine/facebook-comments-scraper) for every comment and reply. On 2026-10-27 this Actor returned `https://www.facebook.com/humansofnewyork/posts/pfbid0w1ngofsomY6MqbaEUVPsuqEUBtqcw74Qo8hnoeCGDmXhW49fwe4ifQ5tdysrSWJKl`, and the Comments Scraper read 100 comments and replies from it ($0.024 on Starter).
- **Videos:** paste a video post's `url` (`https://www.facebook.com/reel/2141054613462232/` in that run) into [Facebook Video Downloader](https://apify.com/deepmine/facebook-video-downloader) for MP4 links in HD and SD and the audio track.
- **Advertisers:** an ad row from [Meta Ad Library](https://apify.com/deepmine/meta-ad-library), [Facebook Video Ads](https://apify.com/deepmine/facebook-video-ads) or [Facebook Ads Monitor](https://apify.com/deepmine/facebook-ads-monitor) has the brand's `pageUrl`: paste it here to see its organic posts.

### Start in three steps

1. **Paste page links** (`https://www.facebook.com/humansofnewyork`, or just `humansofnewyork`), or single post links. The form comes with one page and 50 posts to try.
2. **Choose how many posts** per page (the newest first), a date window if you want one, and whether to collect each post's comments.
3. **Run, then export.** Open the dataset's Overview view and download CSV, Excel or JSON, or schedule the run to watch a page daily.

Copy/paste input for the API (Actor id `deepmine/facebook-posts-scraper`), the prefilled run:

```json
{
  "startUrls": [{"url": "https://www.facebook.com/humansofnewyork"}],
  "resultsLimit": 50
}
```

To get only recent posts add `"onlyPostsNewerThan": "30 days"` (free). It also takes `2026-01-31` or an ISO time.

### Input

- **Facebook page or post links** (`startUrls`): pages like `https://www.facebook.com/humansofnewyork` (or just
  `humansofnewyork`), or single post links.
- **Posts per page** (`resultsLimit`): the newest N posts of each page; empty = every post the page shows.
- **Video transcripts** (`captionText`): each video's captions as plain text in `transcriptText`, where the video
  has captions. Free: no add-on charge.
- **Posts newer than / older than** (`onlyPostsNewerThan`, `onlyPostsOlderThan`): `2026-01-31`, an ISO time, or
  `7 days`, `3 months`. Free: no add-on charge.
- **Comments** (optional section, off by default: `includeComments`, `maxCommentsPerPost`, `viewOption`,
  `includeNestedComments`, `onlyCommentsNewerThan`): comments go to a separate Comments dataset, at $0.24 per 1,000
  comments. Its link is in the run summary (`OUTPUT` record, `commentsDataset`: id, API items URL and Console URL);
  the comment fields are listed in `.actor/dataset_comments_schema.json`.
- **Advanced**: **Rows shaped like apify/facebook-posts-scraper** (`apifyCompatible`, see below), the proxy, and
  whether a refused call is retried on a residential IP.

### Coming from apify/facebook-posts-scraper?

The main input keys are the same (`startUrls`, `resultsLimit`, `onlyPostsNewerThan`, `onlyPostsOlderThan`, `captionText`; `maxPosts` and `commentsSortOrder` work as aliases), so most inputs run as they are.

All 38 column names in apify's dataset exist here under the same name, including the objects `user`, `media`, `textReferences`, `pageAdLibrary`, `actionLink`, `previewTarget` and `sharedPost`. Two of their columns hold objects where ours hold texts by default, so turn on **Rows shaped like apify/facebook-posts-scraper** (`"apifyCompatible": true`) if your code reads them as objects:

| Field | Default rows | With `apifyCompatible` |
|---|---|---|
| `topComments` | the comments' texts (strings); the objects are in `topCommentsDetails` | the comment objects (`commentId`, `commentUrl`, `id`, `feedbackId`, `text`, `date`, `likesCount` as a string, `profileName`, `profileId`, `profileUrl`, `profilePicture`, `threadingDepth`, `author`), as theirs |
| `collaborators` | names; the objects (`id`, `name`, `profileUrl`) are in `collaboratorsDetails` | the objects, and `[]` on a post without collaborators, as theirs |
| Empty fields | `null`, every row has every key | left out, as theirs (so `row.get("sharedPost", {})` works) |
| Times | `2026-10-13T15:34:09Z` | `2026-10-13T15:34:09.000Z`, as theirs |

Everything else is the same in both: the flat columns stay, so nothing that reads them changes. With the switch on, code that reads the fields we test against apify's own rows runs unchanged: `topComments[0].text` and `.author.name`, `actionLink.url` and `.link_display`, `previewTarget.external_url`, `sharedPost.text`, `.url` and `.user.name`, `collaborators[].name`, `media[0].photo_image.width`, `user`, `pageAdLibrary` and `textReferences`. Where the values differ:

- `pageName` is the page's display name ("BBC News"); apify's is often the page's username ("bbcnews"). `user.name` is the display name in both.
- A video's `media` object has its size, length and publish time but not Facebook's player and delivery fields: the video file is `videoUrl`.
- `collaborators` objects come from Facebook as `{id, name}` (plus `profileUrl` here). None of the apify rows we compared had collaborators, so we couldn't check theirs key by key.

### Output

One row per post, the same keys in every row (null when Facebook doesn't show a value):

`thumbnailUrl`, `pageName`, `text`, `textSnippet`, `url`, `likes` (all reactions), `comments`, `shares`,
`viewsCount`, `videoPostViewCount`, `playCount`, `time`, `postType`, `isVideo`, `videoDurationSeconds`, `videoUrl`,
`captionsUrl`, `captionsLocale`, `transcriptText`, `reactionLikeCount`, `reactionLoveCount`, `reactionCareCount`, `reactionHahaCount`, `reactionWowCount`,
`reactionSadCount`, `reactionAngryCount`, `topReactionsCount`, `liveViewerCount`, `imageUrls`, `mediaUrls`,
`mediaIds`, `imageCaptions`, `mediaCount`, `link`, `previewTitle`, `previewDescription`, `previewSource`,
`previewImageUrl`, `previewTargetUrl`, `actionLinkTitle`, `actionLinkUrl`, `hashtags`, `mentions`, `textLinks`,
`collaborators`, `collaboratorsDetails`, `paidPartnership`, `sharedPostId`, `sharedPostUrl`, `sharedPostText`,
`sharedPostAuthor`, `sharedPostAuthorId`, `sharedPostAuthorUrl`, `sharedPostTime`, `topComments`, `topCommentsAuthors`, `topCommentsDetails`, `userName`, `userId`,
`userProfileUrl`, `userProfilePic`, `pageAdLibraryId`, `isBusinessPageActive`, `postId`, `feedbackId`,
`topLevelUrl`, `timestamp`, `timeCreated`, `timestampCreated`, `facebookUrl`, the apify-style objects below,
`inputUrl`, `scrapedAt`.

**apify-style objects.** Every row also has `facebookId` (the page's id) and the objects `user` (`id`, `name`, `profileUrl`,
`profilePic`), `pageAdLibrary` (`id`, `is_business_page_active`), `textReferences` (the text's hashtags, mentions and
links as Facebook names them), `media` (`__typename`, `id`, `thumbnail`, `url`, `ocrText` of each photo, video or link
preview, then Facebook's own details: a photo's `photo_image` with its `width` and `height`, `accent_color`,
`photo_product_tags`, `feedback`; a video's `width`, `height`, `playable_duration_in_ms`, `publish_time`),
`actionLink` (the post's button, like "Shop now": `title`, `link_display`, `url`, `link_type`), `previewTarget` (what
a link preview opens, e.g. `{__typename: "ExternalUrl", external_url, id}`) and `sharedPost` (a share's original:
`postId`, `url`, `time`, `timestamp`, `user`, `pageName`, `text`, `textReferences`, `link`, `isVideo`, `media`,
`paidPartnership`). `topCommentsDetails` objects also carry `id`, `feedbackId` and the commenter's `author` object.

Comments rows: `profilePicture`, `profileName`, `text`, `textSnippet`, `commentUrl`, `likesCount`, `commentsCount`,
`date`, `threadingDepth`, `replyToCommentId`, `replyToName`, reactions by type, `attachmentImageUrls`,
`attachmentType`, `mentions`, `isAuthorVerified`, `profileUrl`, `profileId`, `postTitle`, `postDescription`,
`postUrl`, `postId`, `pageName`, `facebookId`, `commentId`, `id`, `feedbackId`, `timestamp`, `facebookUrl`,
`inputUrl`, `scrapedAt`.

Picture and video links are Facebook's signed CDN links: they expire after a few days, so download what you keep.
Logged out, Facebook shows many commenters with an anonymous id and no profile link.

Video posts carry `viewsCount` (plays, as Facebook counts them), `videoPostViewCount` (views of the video in
this post) and `playCount`. A post that shares someone else's video has no counters of its own. A video with
captions names its captions file (`captionsUrl`, an .srt) and its language (`captionsLocale`); with **Video
transcripts** on, `transcriptText` holds the captions as plain text (up to 50,000 characters).

A post that shares another post keeps its own words in `text` (empty when it adds none, `postType` "Share") and the
original's id, text, link, author (name, id, link) and time in `sharedPostId`, `sharedPostText`, `sharedPostUrl`,
`sharedPostAuthor`, `sharedPostAuthorId`, `sharedPostAuthorUrl` and `sharedPostTime`, and the whole original in
`sharedPost`.

### Pricing

Pay per post, and per comment when you ask for comments. No start fee, no charge for date filters. A run never
charges past your spending limit.

| Apify plan | Per 1,000 posts | Per 1,000 comments |
|---|---:|---:|
| Free | $1.79 | $0.24 |
| Starter | $1.49 | $0.24 |
| Scale | $1.19 | $0.24 |
| Business | $0.79 | $0.24 |

Each post is charged once per run, however many of your links list it.

### More Facebook and Meta Actors

- [Facebook Pages Scraper](https://apify.com/deepmine/facebook-pages-scraper): paste the same page links for the business behind them: emails, phone numbers, websites and addresses.
- [Facebook Comments Scraper](https://apify.com/deepmine/facebook-comments-scraper): every comment and reply under a post, reel or video you found here.
- [Facebook Groups Scraper](https://apify.com/deepmine/facebook-groups-scraper): the posts of public groups.
- [Facebook Marketplace Scraper](https://apify.com/deepmine/facebook-marketplace-scraper): Marketplace listings and their sellers.
- [Facebook Reels Scraper](https://apify.com/deepmine/facebook-reels-scraper): a page's reels with views and audio.
- [Facebook Video Downloader](https://apify.com/deepmine/facebook-video-downloader): MP4 and audio links for the video posts you found here.
- [Meta Ad Library](https://apify.com/deepmine/meta-ad-library): the ads the same page runs. Paste its page link as an advertiser and compare its organic posts with its paid ones.
- [TikTok Search API](https://apify.com/deepmine/tiktok-search-api) and [Instagram Reels Search](https://apify.com/deepmine/instagram-reels-search): the same brand or topic on TikTok and Instagram.

### Did it help?

If the data was useful, a short review on this page helps other people find the Actor. Missing a field, or a page that doesn't come back the way you expect? Open an issue on the **Issues** tab and we'll look into it.

# Actor input Schema

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

Public Facebook pages, e.g. <code>https://www.facebook.com/humansofnewyork</code> (a page name like <code>nasa</code> works too), or links to single posts.

## `resultsLimit` (type: `integer`):

The newest posts to get from each page (empty: every post the page shows, like apify/facebook-posts-scraper). Facebook gives pages' posts newest first, years deep.

## `captionText` (type: `boolean`):

Also get each video's captions as plain text (<code>transcriptText</code>), where the video has captions. Free: no extra charge. The captions file's link (<code>captionsUrl</code>) is in every video row either way.

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

Only posts published after this date: <code>2026-01-31</code>, an ISO time, or relative like <code>7 days</code>, <code>3 months</code>. The run stops reading a page once its posts are older.

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

Only posts published before this date (same formats).

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

Also get each post's comments, into a separate Comments dataset (the run's Output tab shows both). Each comment is charged as a 'comment' event, $0.24 per 1,000 comments, on top of the post. Off: no comments are read and none is charged.

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

Up to this many comments of each post (with 'Get each post's comments' on).

## `viewOption` (type: `string`):

Facebook's own comment orders.

## `includeNestedComments` (type: `boolean`):

Replies to comments (up to 3 levels), each as its own row with the comment it answers.

## `onlyCommentsNewerThan` (type: `string`):

Only comments written after this date (comments are then read newest first).

## `apifyCompatible` (type: `boolean`):

For code written against apify/facebook-posts-scraper's rows: <code>topComments</code> and <code>collaborators</code> hold objects (as <code>topCommentsDetails</code> and <code>collaboratorsDetails</code>), <code>collaborators</code> is <code>\[]</code> on a post without any, and a field the post has no value for is left out instead of <code>null</code>. Every other key stays as it is. Off: the rows as described on the Output tab.

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

Apify Proxy datacenter IPs by default.

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

When Facebook refuses a datacenter IP, ask again on a residential one.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/humansofnewyork"
    }
  ],
  "resultsLimit": 50,
  "captionText": false,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "viewOption": "RANKED_UNFILTERED",
  "includeNestedComments": false,
  "apifyCompatible": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "residentialFallback": true
}
```

# Actor output Schema

## `posts` (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"
        }
    ],
    "resultsLimit": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("deepmine/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" }],
    "resultsLimit": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("deepmine/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"
    }
  ],
  "resultsLimit": 50
}' |
apify call deepmine/facebook-posts-scraper --silent --output-dataset

```

## MCP server setup

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