# 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
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, NaN 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/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 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
  }
}
```

# 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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapyspider/facebook-post-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Post Scraper",
        "description": "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.",
        "version": "1.0",
        "x-build-id": "zbHkPXM5J1zJcUuHg"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapyspider~facebook-post-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapyspider-facebook-post-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrapyspider~facebook-post-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapyspider-facebook-post-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrapyspider~facebook-post-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapyspider-facebook-post-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "Facebook Post URLs",
                        "type": "array",
                        "description": "List of direct Facebook post URLs to scrape. Example: https://www.facebook.com/NASA/posts/1234567890",
                        "items": {
                            "type": "string"
                        }
                    },
                    "includeCommentText": {
                        "title": "Include comment text",
                        "type": "boolean",
                        "description": "Enable this to extract the text content of comments on each post. This may increase scraping time.",
                        "default": false
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to be used by the scraper. Residential proxies are recommended for best results.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
