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

Facebook scraper for public pages: paste page links and get every post with text, reactions by type, comments and shares counts, video views, photos and links, plus each post's comments and replies if you want them. Date filters. No login, no cookies.

- **URL**: https://apify.com/deepmine/facebook-scraper.md
- **Developed by:** [DeepMine](https://apify.com/deepmine) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 5 total users, 3 monthly users, 81.4% 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 Scraper

**Facebook Scraper** for public pages: paste page links and get every post with its text, reactions by type, comments and shares counts, video views, photos and links, plus each post's comments and replies if you want them. Date filters. Download CSV, Excel or JSON, or call it as an API. No login, no cookies.

| 🏷️ Page | 📝 Text | ❤️ Reactions | 💬 Comments | 🔁 Shares | 🎞️ Type | 📅 Posted |
|---|---|---|---|---|---|---|
| Humans of New York | I'm so grateful to Laura for sharing her marathon… | 11,007 | 155 | 168 | Video | 2026-11-01T23:35:06Z |
| Humans of New York | Many people don’t know that the New York City mara… | 6,408 | 90 | 175 | Video | 2026-11-01T19:58:17Z |
| Humans of New York | Last year I got an email that Little Humans was go… | 6,040 | 254 | 112 | Photo | 2026-10-13T15:34:09Z |

<sub>Collected 2026-11-17 by this Actor with the prefilled page, Humans of New York, at 10 posts, comments off. The first three rows are shown, text cut short. The run delivered 10 posts in 9.8 seconds from start to finish, 10 posts charged. 3 were videos, with a video link, length and view count; 6 carried a top-comment preview. One run, not a speed guarantee.</sub>

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

### 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 100 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-scraper`), the prefilled run:

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

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.
- **Search posts by keyword** (`searchQueries`): public posts that match a word or phrase, with the same fields plus
  `searchQuery`. Pick top or most recent results, and optionally a tagged location.
- **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).
- **Advanced**: **Rows shaped like apify/facebook-posts-scraper** (`apifyCompatible`), 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 (`topComments` and `collaborators`): turn on **Rows shaped like apify/facebook-posts-scraper** (`"apifyCompatible": true`) if your code reads them as objects. With the switch on, empty fields are left out and times end in `.000Z`, as theirs.

### Output

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

- **The post:** `url`, `postId`, `text`, `textSnippet`, `time`, `timestamp`, `postType`, `link`, `hashtags`,
  `mentions`, `textLinks`, `collaborators`, `paidPartnership`.
- **Engagement:** `likes` (all reactions), `comments`, `shares`, reactions by type (`reactionLikeCount`,
  `reactionLoveCount`, `reactionCareCount`, `reactionHahaCount`, `reactionWowCount`, `reactionSadCount`,
  `reactionAngryCount`), `topReactionsCount`, and a top-comment preview in `topComments`, `topCommentsAuthors` and
  `topCommentsDetails`.
- **Media:** `thumbnailUrl`, `imageUrls`, `mediaUrls`, `mediaIds`, `imageCaptions`, `mediaCount`, and for videos
  `isVideo`, `videoUrl`, `videoDurationSeconds`, `viewsCount`, `videoPostViewCount`, `playCount`, `captionsUrl`,
  `captionsLocale`, `transcriptText`.
- **Link previews and buttons:** `previewTitle`, `previewDescription`, `previewSource`, `previewImageUrl`,
  `previewTargetUrl`, `actionLinkTitle`, `actionLinkUrl`.
- **Shares:** `sharedPostId`, `sharedPostUrl`, `sharedPostText`, `sharedPostAuthor`, `sharedPostAuthorId`,
  `sharedPostAuthorUrl`, `sharedPostTime`, and the whole original in `sharedPost`.
- **The page:** `pageName`, `userName`, `userId`, `userProfileUrl`, `userProfilePic`, `facebookId`,
  `pageAdLibraryId`, `isBusinessPageActive`, and the apify-style objects `user`, `pageAdLibrary`, `textReferences`,
  `media`, `actionLink` and `previewTarget`.
- **Run fields:** `inputUrl`, `facebookUrl`, `topLevelUrl`, `scrapedAt`.

Comment rows (when comments are on) have the commenter's name, profile link and picture, the text, date, likes,
replies count, reactions by type, the reply thread (`threadingDepth`, `replyToCommentId`, `replyToName`), and the
post they belong to.

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.

### 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.

### Related Actors

- [Facebook Groups Scraper](https://apify.com/deepmine/facebook-groups-scraper): the posts of public groups.
- [Facebook Pages Scraper](https://apify.com/deepmine/facebook-pages-scraper): the business behind a page: emails, phone numbers, websites and addresses.
- [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 Comments Scraper](https://apify.com/deepmine/facebook-comments-scraper): every comment and reply under a post, reel or video you found here.

### 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.

## `searchQueries` (type: `array`):

Words to search Facebook posts for, e.g. <code>black friday</code>. Each keyword returns public posts that match it, with the same fields as page posts plus <code>searchQuery</code>. 'Max posts' applies per keyword.

## `searchSortBy` (type: `string`):

Top results (Facebook's own order) or most recent first.

## `searchLocation` (type: `string`):

Only posts tagged at this place: a Facebook location ID like <code>106078429431815</code> (London), or the place's Facebook link, which ends in that ID. With a location, results come newest first (Facebook applies the filter to the recent order only). Every search row carries <code>taggedLocationId</code>, <code>taggedLocationName</code> and <code>taggedLocationUrl</code> when the post is tagged at a place.

## `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"
    }
  ],
  "searchSortBy": "top",
  "resultsLimit": 100,
  "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": 100
};

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

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

```

## MCP server setup

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