# Facebook Post Scraper (`scrapyspider/facebook-post-scraper`) Actor

Scrape public Facebook post data without login. Extracts post text, engagement metrics (likes, comments, shares), publish date, media URLs, and page name. Supports posts, reels, photos, and permalink URLs. Fast and lightweight with residential proxy support.

- **URL**: https://apify.com/scrapyspider/facebook-post-scraper.md
- **Developed by:** [ScrapySpider](https://apify.com/scrapyspider) (community)
- **Categories:** Social media, Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 372 total users, 35 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Post Data Scraper

Extract detailed data from any public Facebook post — including text, engagement metrics, images, videos, and comments — without needing a Facebook account or cookies.

### Key Highlights

- **No login required** — scrapes public Facebook posts without cookies, tokens, or a Facebook account
- **Full engagement metrics** — captures likes, comments, shares, and reactions in a single run
- **Media extraction** — retrieves image and video URLs attached to each post
- **Comment text support** — optionally extracts the text content of post comments
- **Flexible export** — download results as JSON, CSV, or Excel with one click
- **Built on Puppeteer** — reliable headless browser scraping that handles dynamic Facebook content
- **Free to use** — no Actor rental fee; you only pay for Apify platform usage

### What Data You Get

Each scraped post returns the following fields:

- **Post identifiers**: `postId`, `url`, `permalink`
- **Page info**: `pageName`
- **Content**: `text`, `image` (URL), `video` (URL)
- **Timestamps**: `date` (ISO 8601), `timestamp` (Unix epoch)
- **Engagement**: `likes`, `comments`, `shares`
- **Comments** *(optional)*: `commentsText` (array of comment strings)

Export your results in JSON, CSV, or Excel directly from the Apify Console.

### Use Cases

- **Social media monitoring** — track engagement metrics on specific Facebook posts over time to measure content performance
- **Competitive analysis** — collect post data from competitor pages to benchmark engagement and content strategy
- **Market research** — gather public sentiment and comment text from posts related to your brand or industry
- **Content archiving** — save post text, media, and metadata for compliance, reporting, or historical records
- **Academic research** — compile structured datasets of public Facebook posts for social science or media studies

### How to Use

1. Open the **Facebook Post Data Scraper** Actor page on Apify and click **Start**.
2. In the **Input** tab, paste one or more direct Facebook post URLs into the **Facebook Post URLs** field.
3. *(Optional)* Check the **Include comment text** box to also extract comment content.
4. Review the **Proxy configuration** — Apify Proxy is enabled by default and recommended.
5. Click **Start** and wait for the run to finish (typically under 1 minute per post).
6. Open the **Output** tab to preview, filter, and download your data in JSON, CSV, or Excel.

### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `urls` | array of strings | Yes | Direct Facebook post URLs to scrape. Example: `https://www.facebook.com/NASA/posts/1036318498542498` |
| `includeCommentText` | boolean | No | Set to `true` to include comment text in the output (default: `false`) |
| `proxy` | object | No | Proxy configuration; defaults to Apify Proxy (`{ "useApifyProxy": true }`) |

### Output Sample

```json
{
  "postId": "891234567890123",
  "url": "https://www.facebook.com/NatGeo/posts/891234567890123",
  "pageName": "National Geographic",
  "text": "A breathtaking view of the Northern Lights captured over Iceland last night. 🌌 Have you ever witnessed this natural wonder?",
  "date": "2025-01-15T18:30:00.000Z",
  "timestamp": 1736964600,
  "likes": 24500,
  "comments": 1830,
  "shares": 4120,
  "image": "https://scontent.fxx1-1.fna.fbcdn.net/v/t39.30808-6/sample-image.jpg",
  "video": "",
  "permalink": "https://www.facebook.com/NatGeo/posts/891234567890123",
  "commentsText": [
    "Absolutely stunning! I saw the aurora in Norway last year.",
    "Nature at its finest 🙌",
    "Adding Iceland to my bucket list right now!"
  ]
}
```

### Pricing

This Actor is **free to use**. You only pay for the Apify platform compute and proxy resources consumed during each run.

**Estimated costs (Apify platform credits):**

- \~10 posts → less than $0.01
- \~100 posts → approximately $0.05–$0.10
- \~1,000 posts → approximately $0.50–$1.00

Actual costs depend on the number of posts, whether comment text extraction is enabled, and proxy usage.

### Technical Notes

- **No account or cookies needed** — the scraper works with publicly accessible Facebook posts only. Private or restricted posts cannot be scraped.
- **Proxy recommended** — Apify Proxy is enabled by default. Using residential proxies may improve reliability for large batches.
- **Rate limits** — Facebook may throttle requests during very large runs. If you experience issues, reduce the batch size or add delays between runs.
- **Dynamic content** — the scraper uses Puppeteer to render JavaScript-heavy Facebook pages, so results reflect fully loaded post content.
- **Data accuracy** — engagement counts (likes, comments, shares) represent the values at the time of scraping and may change as users interact with the post.

### Integrations

Connect this Actor to your workflow using Apify's built-in integrations:

- **Apify API** — trigger runs and retrieve results programmatically via the REST API
- **Apify Scheduler** — set up recurring scraping runs on a daily, weekly, or custom schedule
- **Apify Datasets** — store and manage output data across multiple runs

### Support

Having trouble or need help? Reach out through any of the following channels:

- **Email**: ScrapySpider@protonmail.com
- **Website**: [ScrapySpider.com](https://ScrapySpider.com)
- **Apify**: Open a support issue directly on this Actor's page

Response time: Within 24–48 hours on weekdays.

# Actor input Schema

## `urls` (type: `array`):

List of direct Facebook post URLs to scrape. Example: https://www.facebook.com/NASA/posts/1234567890

## `includeCommentText` (type: `boolean`):

Enable this to extract the text content of comments on each post. This may increase scraping time.

## `proxy` (type: `object`):

Select proxies to be used by the scraper. Residential proxies are recommended for best results.

## Actor input object example

```json
{
  "urls": [
    "https://www.facebook.com/reel/2144422086394464/"
  ],
  "includeCommentText": false,
  "proxy": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items containing the scraped Facebook post data (text, likes, comments, shares, images, videos, etc.).

# 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 = {
    "urls": [
        "https://www.facebook.com/reel/2144422086394464/"
    ],
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapyspider/facebook-post-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 = {
    "urls": ["https://www.facebook.com/reel/2144422086394464/"],
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapyspider/facebook-post-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 '{
  "urls": [
    "https://www.facebook.com/reel/2144422086394464/"
  ],
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call scrapyspider/facebook-post-scraper --silent --output-dataset

```

## MCP server setup

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