# Facebook Posts Scarper (`neuro-scraper/facebook-posts-scarper`) Actor

Unlock hidden Facebook data instantly! Our lightning-fast scraper bypasses logins, extracting unlimited posts, comments, media, & deep analytics on autopilot. Outperform competitors with real-time insights, zero blocks, and massive parallel speed. Stop guessing—start dominating Facebook today!

- **URL**: https://apify.com/neuro-scraper/facebook-posts-scarper.md
- **Developed by:** [Neuro Scraper](https://apify.com/neuro-scraper) (community)
- **Categories:** Automation, Videos, Social media
- **Stats:** 4 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$7.50/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#rental-actors

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Facebook Posts Scraper & Data Extractor - No Login Required

**Extract posts, photos, videos, comments, and engagement statistics from any public Facebook page without login.** This powerful tool gathers deep insights including exact reaction counts (Likes, Loves, Cares, etc.), video view counts, top comments, and media URLs, delivering structured data perfect for analysis, archiving, or monitoring. Export your scraped data seamlessly to **JSON, CSV, Excel, XML, or HTML**.

***

### 🚀 Why Use Facebook Posts Scraper?

Facebook Posts Scraper is a robust data extraction tool designed for marketers, researchers, and developers who need detailed information from public Facebook pages. Unlike standard scrapers or the official Graph API, it operates **without requiring a Facebook account login, API keys, or App approvals**, ensuring higher reliability and completely bypassing API restrictions and account ban risks.

The scraper intelligently utilizes Facebook's internal REST/GraphQL API to paginate through a page's feed efficiently. It automatically handles different media types (photos, videos, Reels, and multi-image posts), extracting all relevant metadata, captions, and deep engagement statistics. It runs seamlessly on the Apify platform using residential proxies to maintain uninterrupted access.

### ✨ Key Features

- **No Login Required:** Scrape completely anonymously. Never risk your personal Facebook account.
- **Bypass API Limitations:** Extract data that the official Graph API restricts or hides, such as exact reaction breakdowns (Love, Haha, Angry, etc.) and hidden Reel view counts.
- **Deep Media Extraction:** Automatically detects Image and Video posts, extracting HD thumbnails, direct media URLs, and video playback statistics (duration, play count, views).
- **Export Anywhere:** Download your structured data directly into **JSON, CSV, Excel**, or integrate it into your own database via API.
- **Cloud-Ready:** Built to run on Apify with automatic residential proxy integration to prevent IP blocks.

### 🎯 Top Use Cases

- **📊 Competitor Analysis:** Monitor competitor Facebook pages to analyze their posting frequency, most engaging content, and audience reactions.
- **🗣️ Social Media Listening & Sentiment Analysis:** Extract top comments and detailed reaction breakdowns to gauge public sentiment on products, brands, or viral news.
- **📈 Content Strategy Optimization:** Discover what types of media (Videos vs Photos) generate the most views, shares, and comments in your niche.
- **🗄️ Archiving & Data Backup:** Export historical posts and media from your own pages for backup or compliance purposes.

### 🔍 What Facebook data is publicly available to scrape?

| Data Category | Publicly Available |
| --- | --- |
| Page Posts (Text, Date, ID) | Yes |
| Media (Images, Videos, Reels) | Yes |
| Reaction Counts (Like, Love, Haha, etc.) | Yes |
| Share & Comment Counts | Yes |
| Top Comments (Author, Text, Likes) | Yes |
| Video Views, Play Counts & Duration | Yes |
| Paid Partnership Tags | Yes |
| Private / Friends-Only Posts | No |
| Full Follower/Friend Lists | No |
| User Contact Information | No |

### What data can I extract with Facebook Posts Scraper?

#### Identity & Ownership Fields

| Field Name | Description |
| --- | --- |
| `facebookUrl` | The URL of the scraped Facebook page. |
| `pageName` | The real display name of the page. |
| `facebookId` | The unique numeric ID of the Facebook page owner. |
| `postId` | The unique identifier for the post. |
| `url` | The direct permalink URL to the specific post. |
| `user` | Object containing `id`, `name`, `profileUrl`, and `profilePic` of the post author. |
| `collaborators` | A list of collaborator names if the post is a joint post. |

#### Engagement & Media Metric Fields

| Field Name | Description |
| --- | --- |
| `likes` | Total number of generic likes on the post. |
| `comments` | Total number of comments on the post. |
| `shares` | Total number of shares. |
| `reactionLikeCount` | Specific count of 'Like' reactions. |
| `reactionLoveCount` | Specific count of 'Love' reactions. |
| `reactionCareCount` | Specific count of 'Care' reactions. |
| `reactionHahaCount` | Specific count of 'Haha' reactions. |
| `reactionWowCount` | Specific count of 'Wow' reactions. |
| `reactionSadCount` | Specific count of 'Sad' reactions. |
| `reactionAngryCount` | Specific count of 'Angry' reactions. |
| `topReactionsCount` | Number of different reaction types present on the post. |
| `viewsCount` | Video view count (applicable only to video posts). |
| `videoPostViewCount` | Post view count for video items. |
| `liveViewerCount` | Current live viewer count for live videos. |

#### Content, Media & Comments Fields

| Field Name | Description |
| --- | --- |
| `time` | ISO 8601 formatted string of the post creation time. |
| `timestamp` | Unix timestamp of the post creation. |
| `text` | The full text content/caption of the post. |
| `paidPartnership` | Boolean indicating if the post is marked as a paid partnership. |
| `pageAdLibrary` | Ad library information if available. |
| `topComments` | Array of top comments containing `author`, `text`, `likesCount`, `date`, etc. |
| `media` | Array containing media objects (photos or videos) attached to the post. |
| `feedbackId` | Internal Facebook feedback node ID used for tracking. |

#### Media-Type Specific Behavior

The scraper handles different media types dynamically:

- **Image Posts:** Returns an array in the `media` field where the first item is a `mediaset_header` (grouping information) and subsequent items are `Photo` objects containing the image `url`, `thumbnail`, and `ocrText` (if available). The `isVideo` field will be omitted.
- **Video Posts:** Returns a single `Video` object inside the `media` field containing the raw video metadata, `thumbnail`, and optionally a `transcript`. The `isVideo` field will be set to `true`, and fields like `viewsCount` and `playCount` will be populated.
- **Text-Only Posts:** The `media` array will be empty, and no video-specific fields will be present.

### How to configure Facebook Posts Scraper

#### Configuration Options

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `pages` | Array | `["Cristiano"]` | List of public Facebook Page usernames or URLs you wish to scrape. |
| `maxItems` | Integer | `20` | Maximum number of posts to collect per page. |
| `includeTranscript` | Boolean | `false` | If true, fetches video captions when available. |

#### Example Configuration

```json
{
  "pages": [
    "Cristiano"
  ],
  "maxItems": 50,
  "includeTranscript": false
}
```

### How to use Facebook Posts Scraper

1. **Sign up/Log in** to your Apify account.
2. **Navigate** to this actor's page on the Apify Store and click "Try for free".
3. **Set the Target:** In the Input configuration, enter the URL of the Facebook page you want to scrape in the `startUrls` field (e.g., `https://www.facebook.com/zuck`).
4. **Set Limits:** Specify the `maxItems` to dictate how many posts you want to extract.
5. **Run:** Click the "Start" button. The actor will launch, utilizing residential proxies to securely fetch the data.
6. **Download:** Once the run completes, navigate to the "Storage" tab. Your data is available in the default dataset (and an additional `RESULT` dataset) in formats like JSON, CSV, or Excel.

### Output Format

The actor outputs data in JSON format, creating one object per scraped post.

#### Example Output — Image Post

```json
{
  "facebookUrl": "https://www.facebook.com/virat.kohli/",
  "postId": "123456789012345",
  "pageName": "Virat Kohli",
  "url": "https://www.facebook.com/virat.kohli/posts/123456789012345",
  "time": "2023-10-15T10:00:00.000Z",
  "timestamp": 1697364000,
  "user": {
    "id": "987654321",
    "name": "Virat Kohli",
    "profileUrl": "https://www.facebook.com/987654321",
    "profilePic": "https://scontent.xx.fbcdn.net/v/..."
  },
  "collaborators": [],
  "text": "Great victory today! Thanks for the support.",
  "likes": 500000,
  "comments": 15000,
  "shares": 5000,
  "topReactionsCount": 6,
  "reactionLikeCount": 400000,
  "reactionLoveCount": 95000,
  "reactionCareCount": 4000,
  "reactionHahaCount": 500,
  "reactionWowCount": 300,
  "reactionSadCount": 100,
  "reactionAngryCount": 100,
  "paidPartnership": false,
  "media": [
    {
      "mediaset_token": "pcb.123456789012345",
      "url": "https://www.facebook.com/virat.kohli/posts/123456789012345",
      "comet_product_tag_feed_overlay_renderer": null
    },
    {
      "thumbnail": "https://scontent.xx.fbcdn.net/v/...jpg",
      "__typename": "Photo",
      "is_playable": false,
      "image": {
        "uri": "https://scontent.xx.fbcdn.net/v/...jpg"
      },
      "id": "112233445566",
      "__isMedia": "Photo",
      "ocrText": "Virat Kohli holding a bat"
    }
  ],
  "topComments": [
    {
      "commentUrl": "https://www.facebook.com/virat.kohli/posts/123456789012345?comment_id=55667788",
      "commentId": "55667788",
      "date": "2023-10-15T10:05:00.000Z",
      "text": "Legend!",
      "author": {
        "id": "223344",
        "name": "Fan Account",
        "url": "https://www.facebook.com/223344"
      },
      "likesCount": "1.5K"
    }
  ]
}
```

#### Example Output — Video Post

```json
{
  "facebookUrl": "https://www.facebook.com/virat.kohli/",
  "postId": "987654321098765",
  "pageName": "Virat Kohli",
  "url": "https://www.facebook.com/virat.kohli/posts/987654321098765",
  "time": "2023-10-14T08:00:00.000Z",
  "timestamp": 1697270400,
  "user": {
    "id": "987654321",
    "name": "Virat Kohli",
    "profileUrl": "https://www.facebook.com/987654321"
  },
  "text": "Training session highlights.",
  "likes": 200000,
  "comments": 5000,
  "shares": 2000,
  "isVideo": true,
  "viewsCount": 1500000,
  "viewsCountReduced": "1.5M",
  "playCount": 1500000,
  "playCountReduced": "1.5M",
  "durationInMinutes": "02:30",
  "liveViewerCount": 0,
  "media": [
    {
      "__typename": "Video",
      "id": "5544332211",
      "thumbnail": "https://scontent.xx.fbcdn.net/v/...jpg",
      "captions_url": null,
      "transcript": null
    }
  ],
  "topComments": []
}
```

#### Field Reference (Complete)

| Field Name | Type | Applies To | Description |
| --- | --- | --- | --- |
| `facebookUrl` | String | All | The source URL provided in the input. |
| `postId` | String | All | The unique ID of the post. |
| `pageName` | String | All | Real display name of the page. |
| `url` | String | All | Direct permalink to the post. |
| `time` | String | All | ISO 8601 creation time. |
| `timestamp` | Integer | All | Unix creation time. |
| `user` | Object | All | Details of the post author (id, name, pic). |
| `collaborators` | Array | All | Names of any collaborating pages. |
| `text` | String | All | Post caption or body text. |
| `likes` | Integer | All | Total like count. |
| `comments` | Integer | All | Total comment count. |
| `shares` | Integer | All | Total share count. |
| `topReactionsCount`| Integer | All | Number of unique reaction types on the post. |
| `media` | Array | All | Media attachments (Photos or Videos). |
| `feedbackId` | String | All | Internal Facebook feedback ID. |
| `reactionLikeCount`| Integer | All | Count of 'Like' reactions. |
| `reactionLoveCount`| Integer | All | Count of 'Love' reactions. |
| `reactionCareCount`| Integer | All | Count of 'Care' reactions. |
| `reactionHahaCount`| Integer | All | Count of 'Haha' reactions. |
| `reactionWowCount` | Integer | All | Count of 'Wow' reactions. |
| `reactionSadCount` | Integer | All | Count of 'Sad' reactions. |
| `reactionAngryCount`| Integer | All| Count of 'Angry' reactions. |
| `paidPartnership` | Boolean | All | Whether the post is sponsored/paid partnership. |
| `topComments` | Array | All | The top comments visible on the post. |
| `topLevelUrl` | String | All | Base URL constructed from owner ID and post ID. |
| `facebookId` | String | All | The numeric ID of the page owner. |
| `inputUrl` | String | All | Alias for the input URL. |
| `isVideo` | Boolean | Video Posts| True if the post contains a video. |
| `viewsCount` | Integer | Video Posts| Total video views (raw number). |
| `viewsCountReduced` | String | Video Posts| Formatted video views (e.g., '1.5M'). |
| `playCount` | Integer | Video Posts| Total video play count (raw number). |
| `playCountReduced` | String | Video Posts| Formatted play count (e.g., '1.5M'). |
| `durationInMinutes` | String | Video Posts| The duration of the video formatted as MM:SS. |
| `liveViewerCount`| Integer | Video Posts| Active live viewers (if currently live). |
| `pageAdLibrary` | Object | Ads | Ad library communication data (if applicable). |

### How does it work?

- **Painless Initialization:** The scraper starts by safely fetching the page's HTML to automatically detect necessary identifiers like the page ID and authentication tokens, without requiring cookies from a logged-in user.
- **REST/GraphQL API:** It targets Facebook's internal, publicly exposed GraphQL endpoints to fetch timeline feed units incrementally.
- **Efficient Pagination:** It extracts pages of posts consistently. For every page iteration, it pulls all available posts on that page before seamlessly continuing to the next.
- **Smart Data Structuring:** It deeply traverses Facebook's complex JSON payload to unify disparate fields (like finding reaction counts inside deep `comet_sections`) into a flat, predictable JSON output.

### How does Facebook Posts Scraper differ from the official Graph API?

| Feature | Official Graph API | Facebook Posts Scraper |
| --- | --- | --- |
| **Access Scope** | Heavily restricted, requires approvals. | Accesses any public page data directly. |
| **Account Requirement** | Requires a Developer account & API keys. | None. Runs entirely anonymously. |
| **Setup Time** | Days/Weeks (App approval process). | Instant. |
| **Media Type Support** | Limited by permissions. | Full support for Videos, Photos, Captions. |
| **Fields Returned** | Often omits exact reaction breakdown. | Comprehensive breakdown of all reactions. |

### Rate Limits & Error Handling

To ensure longevity and reliability, this actor is designed to use **Apify Residential Proxies**.

- The script automatically continues paginating until it hits the `maxItems` limit or runs out of posts.
- If it encounters missing parameters or network blocks, it will safely skip to the next URL in your list or exit gracefully, ensuring whatever data was already collected is saved to your dataset.

### Legal Considerations

This scraper extracts exclusively publicly available data accessible to any unauthenticated user navigating the web. It does not bypass logins, CAPTCHAs, or scrape private user data. It is your responsibility to ensure that your use of the extracted data complies with all applicable local laws, regulations, and terms of service. This is not legal advice.

### Frequently Asked Questions

**Does it require a Facebook account?**
No, it runs entirely anonymously without needing any login cookies.

**How many posts can I scrape?**
You can set `maxItems` to any number. It will scrape until it reaches that limit or until the page has no more public posts available.

**Does it handle video posts?**
Yes. It specifically detects video posts and extracts video-specific statistics like `viewsCount` and `playCount`.

**Can I scrape private pages or groups?**
No. This tool only accesses data from public Facebook Pages that are visible without a login.

**What Python version is required?**
The actor runs on Python 3.11 within the Apify Docker container.

**What happens when Facebook changes its API?**
This scraper relies on internal GraphQL structures. If Facebook makes significant changes, the scraper may require updates. Apify actors are easy to update once patched.

**Can I scrape multiple pages at once?**
Yes! Just add multiple URLs to the `startUrls` array in the input configuration.

**How are the results saved?**
Results are saved to the default dataset and a named dataset called `RESULT`. They can be downloaded in JSON, CSV, Excel, XML, or HTML formats.

### Troubleshooting

- **Empty results or "Failed to initialize":** Ensure the URL is a public Facebook Page (not a personal profile locked to public viewing). Double-check that your proxy settings are configured to use Residential proxies.
- **Missing Posts:** Facebook sometimes restricts chronological pagination for unauthenticated users after a certain depth. Using high-quality residential proxies mitigates this.
- **429 rate limiting:** If you scrape too aggressively, Facebook may temporarily block the IP. Ensure you are utilizing a pool of Residential proxies.

### Changelog / Version History

- **v1.0.0:** Initial release. Added async support, comprehensive proxy integration, and dynamic GraphQL pagination.

# Actor input Schema

## `pages` (type: `array`):

List of Facebook Page usernames (e.g., 'virat.kohli') or full URLs.

## `maxItems` (type: `integer`):

Maximum number of posts to collect per page.

## `includeTranscript` (type: `boolean`):

If true, fetches video captions when available.

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

Select proxies to be used by your scraper.

## Actor input object example

```json
{
  "pages": [
    "virat.kohli"
  ],
  "maxItems": 20,
  "includeTranscript": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/facebook-posts-scarper").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 = {}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,neuro-scraper/facebook-posts-scarper"
        }
    }
}
```

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/EqknNav3bZL4bEJSG/builds/VDwD2FqH1D4KybGhy/openapi.json
