# Facebook Post Scraper (no login) (`maged120/facebook-post-scraper`) Actor

Scrape public Facebook posts — content, author, timestamp, reactions, shares, and media. No login required.

- **URL**: https://apify.com/maged120/facebook-post-scraper.md
- **Developed by:** [Maged](https://apify.com/maged120) (community)
- **Categories:** Automation
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

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

**Extract structured data from public [Facebook](https://www.facebook.com) posts** — content, author, timestamp, reactions, shares, media, and comments — with no login required.

> **This is a post data scraper.** It captures the key metrics and content of a post quickly and reliably. It is not a dedicated comment scraper and does not paginate through all comments on a post.

### What does Facebook Post Scraper do?

Facebook Post Scraper takes a list of public Facebook post URLs and returns structured JSON for each — including the full post text, author details, reaction and share counts, publish timestamp, attached media, and top comments.

Built on Apify, you get automatic scheduling, API access, proxy rotation, dataset export (JSON, CSV, Excel), and monitoring out of the box.

### Why use Facebook Post Scraper?

- **Content monitoring** — track public posts about your brand, product, or campaign
- **Research & analysis** — collect engagement data for academic or market research
- **Competitive intelligence** — monitor competitor page posts at scale
- **Media tracking** — log reactions and shares on public news or media posts
- **Archival** — save structured snapshots of posts before they change or disappear

### How to use Facebook Post Scraper

1. Open the **Input** tab in Apify Console
2. Paste one or more Facebook post URLs into the `queries` array
3. Adjust optional settings (comments, full content, video views)
4. Click **Start** — results appear in the **Output** tab in real-time
5. Download as JSON, CSV, or Excel when the run completes

### Input

Pass a JSON object via the Input tab or the Apify API:

```json
{
    "queries": [
        {
            "url": "https://www.facebook.com/NASA/posts/pfbid0F2Hd...",
            "label": "nasa-post"
        },
        "https://www.facebook.com/somepage/posts/123456789"
    ],
    "includeComments": true,
    "scrapeFullContent": true,
    "includeVideoViews": true,
    "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
````

#### Input fields

| Field | Type | Default | Description |
|---|---|---|---|
| `queries` | array | — | **Required.** List of post URLs. Each item is either a URL string or `{ "url": "...", "label": "..." }` |
| `includeComments` | boolean | `true` | Include top comments from the post. Does **not** paginate through all comments — see note below |
| `scrapeFullContent` | boolean | `true` | Extract full untruncated post text instead of the short description |
| `includeAuthorPictures` | boolean | `false` | Add comment author profile picture URLs to comment objects |
| `includeVideoViews` | boolean | `true` | Include video/reel play count in output |
| `proxyConfiguration` | object | residential | Proxy settings (residential recommended for large-scale runs) |

#### Supported URL formats

- `https://www.facebook.com/username/posts/123456789`
- `https://www.facebook.com/permalink/post?id=123456789`
- `https://www.facebook.com/photo?fbid=123456789`
- `https://www.facebook.com/watch?v=123456789`
- `https://www.facebook.com/reel/123456789`
- `https://www.facebook.com/groups/groupname/posts/123456789`

### Output

Each post produces one item in the dataset. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```json
{
    "postUrl": "https://www.facebook.com/NASA/posts/pfbid0F2Hd...",
    "postId": "1496561611839210",
    "postType": "photo",
    "authorName": "NASA - National Aeronautics and Space Administration",
    "author": {
        "name": "NASA - National Aeronautics and Space Administration",
        "profileUrl": "https://www.facebook.com/NASA",
        "id": "NASA"
    },
    "content": "A stunning new image from the James Webb Space Telescope reveals...",
    "timestamp": "2024-03-15T18:00:00+00:00",
    "timestampRaw": "March 15 at 6:00 PM",
    "reactions": { "total": 651865 },
    "reactionsTotal": 651865,
    "sharesCount": 42310,
    "commentsCount": 15763,
    "isSharedPost": false,
    "media": [
        { "type": "photo", "url": "https://scontent.fbcdn.net/v/...", "alt": "Webb telescope image" }
    ],
    "comments": [
        {
            "commentId": "987654321",
            "author": { "name": "Jane Smith", "profileUrl": "https://www.facebook.com/janesmith", "id": "janesmith" },
            "content": "Absolutely breathtaking!",
            "timestamp": "2024-03-15T18:30:00+00:00",
            "reactions": { "total": 120 }
        }
    ],
    "queryLabel": "nasa-post",
    "scrapedAt": "2024-03-16T09:00:00+00:00",
    "error": null
}
```

> **Note on comments:** The `comments` array contains the top comments returned for the post. The `commentsCount` field reflects the **total** comment count (e.g. 15,763). If you need full comment extraction at scale, consider a dedicated comment scraper.

### Data table

| Field | Format | Description |
|---|---|---|
| `postUrl` | link | Canonical post URL |
| `postId` | text | Numeric post/content ID |
| `postType` | text | `post`, `photo`, `video`, `reel` |
| `authorName` | text | Author display name |
| `author` | object | `name`, `profileUrl`, `id` |
| `content` | text | Full post text |
| `timestamp` | date | ISO-8601 publish time (UTC) |
| `timestampRaw` | text | Raw timestamp as shown on page |
| `reactions.total` | number | Total reaction count |
| `sharesCount` | number | Share count |
| `commentsCount` | number | Total comment count on the post |
| `videoViewCount` | number | View/play count (video/reel posts only) |
| `media` | array | Attached images/videos with URLs and alt text |
| `comments` | array | Top comments from the post |
| `isSharedPost` | boolean | Whether the post is a reshare |
| `sharedFrom` | link | Original post URL if shared |
| `queryLabel` | text | Label passed in the input query |
| `error` | text | Error message if scraping failed, otherwise null |

#### Comment object fields

| Field | Description |
|---|---|
| `commentId` | Numeric comment ID |
| `author` | `name`, `profileUrl`, `id` |
| `content` | Comment text |
| `timestamp` | ISO-8601 (UTC) |
| `reactions.total` | Reaction count |
| `pictureUrl` | Author profile picture (only when `includeAuthorPictures` is enabled) |

### Pricing / Cost estimation

A typical run of 100 posts completes in seconds and uses a fraction of a cent in compute. The Apify free plan ($5/month credit) covers thousands of posts per month.

For large-scale batch runs, residential proxies improve reliability — available on paid Apify plans.

### Tips and advanced options

- **Proxies**: residential proxies significantly improve reliability and speed for large batches
- **Labels**: tag each query with a `label` field to filter output records by campaign, page, or date
- **Timestamps**: very recent posts sometimes show relative times ("2 hours ago") — `timestampRaw` preserves the original; `timestamp` is ISO when parseable
- **Private posts**: posts requiring login return an error record with `error` explaining why — no crashes, just a graceful skip

### FAQ, disclaimers, and support

**Is scraping Facebook posts legal?**
This actor accesses only publicly visible data — posts available to any anonymous visitor. Always verify compliance with Facebook's Terms of Service and applicable local laws before use. Do not use this tool to collect private data or violate user privacy.

**Why aren't all comments returned?**
This is a post data scraper, not a comment scraper. It returns the top comments available for the post. The `commentsCount` field shows the full total. For complete comment extraction, a dedicated comment scraper is the right tool.

**Why might a post fail?**
Posts behind a login wall (private profiles, friends-only posts, age-gated content) return an error record rather than data. The `error` field explains why.

**Known limitations**

- Private or login-required posts are inaccessible — by design, no credentials are used
- Reaction breakdowns by type (Like / Love / Haha / etc.) are not available via the public interface
- Story content is not supported

**Need help or found a bug?**
Open an issue on the Issues tab. Custom solutions for higher-volume or specialized use cases are available on request.

# Actor input Schema

## `queries` (type: `array`):

List of Facebook post URLs to scrape. Each item can be a plain URL string or an object with a `url` and optional `label` for tagging the output.

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

Include top comments from the post in the output. This actor is a post data scraper and does not paginate through all comments.

## `scrapeFullContent` (type: `boolean`):

Extract the full, untruncated post text. When disabled, falls back to a short description (~250 characters).

## `includeAuthorPictures` (type: `boolean`):

Add each comment author's profile picture URL to the comment output (pictureUrl field).

## `includeVideoViews` (type: `boolean`):

Include the video view/play count in the output for video and reel posts (videoViewCount field).

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

Proxy settings. Residential proxies are recommended for large-scale runs.

## Actor input object example

```json
{
  "queries": [
    {
      "url": "https://www.facebook.com/NASA/posts/pfbid0F2Hd2hkfGjkY1TtFmgzK12fxuaZ4fCbTgcPRyiLAf2RPyTi7TXSamkKvVJspMTJCl",
      "label": "nasa-post"
    }
  ],
  "includeComments": true,
  "scrapeFullContent": true,
  "includeAuthorPictures": false,
  "includeVideoViews": true,
  "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 = {
    "queries": [
        {
            "url": "https://www.facebook.com/NASA/posts/pfbid0F2Hd2hkfGjkY1TtFmgzK12fxuaZ4fCbTgcPRyiLAf2RPyTi7TXSamkKvVJspMTJCl",
            "label": "nasa-post"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("maged120/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 = { "queries": [{
            "url": "https://www.facebook.com/NASA/posts/pfbid0F2Hd2hkfGjkY1TtFmgzK12fxuaZ4fCbTgcPRyiLAf2RPyTi7TXSamkKvVJspMTJCl",
            "label": "nasa-post",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("maged120/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 '{
  "queries": [
    {
      "url": "https://www.facebook.com/NASA/posts/pfbid0F2Hd2hkfGjkY1TtFmgzK12fxuaZ4fCbTgcPRyiLAf2RPyTi7TXSamkKvVJspMTJCl",
      "label": "nasa-post"
    }
  ]
}' |
apify call maged120/facebook-post-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=maged120/facebook-post-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Facebook Post Scraper (no login)",
        "description": "Scrape public Facebook posts — content, author, timestamp, reactions, shares, and media. No login required.",
        "version": "1.0",
        "x-build-id": "8eGfjW16lKGQOh9M2"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maged120~facebook-post-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maged120-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/maged120~facebook-post-scraper/runs": {
            "post": {
                "operationId": "runs-sync-maged120-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/maged120~facebook-post-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-maged120-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": [
                    "queries"
                ],
                "properties": {
                    "queries": {
                        "title": "Post URLs",
                        "type": "array",
                        "description": "List of Facebook post URLs to scrape. Each item can be a plain URL string or an object with a `url` and optional `label` for tagging the output.",
                        "default": [
                            {
                                "url": "https://www.facebook.com/NASA/posts/pfbid0F2Hd2hkfGjkY1TtFmgzK12fxuaZ4fCbTgcPRyiLAf2RPyTi7TXSamkKvVJspMTJCl",
                                "label": "nasa-post"
                            }
                        ]
                    },
                    "includeComments": {
                        "title": "Include Comments",
                        "type": "boolean",
                        "description": "Include top comments from the post in the output. This actor is a post data scraper and does not paginate through all comments.",
                        "default": true
                    },
                    "scrapeFullContent": {
                        "title": "Scrape Full Post Content",
                        "type": "boolean",
                        "description": "Extract the full, untruncated post text. When disabled, falls back to a short description (~250 characters).",
                        "default": true
                    },
                    "includeAuthorPictures": {
                        "title": "Include Comment Author Pictures",
                        "type": "boolean",
                        "description": "Add each comment author's profile picture URL to the comment output (pictureUrl field).",
                        "default": false
                    },
                    "includeVideoViews": {
                        "title": "Include Video View Count",
                        "type": "boolean",
                        "description": "Include the video view/play count in the output for video and reel posts (videoViewCount field).",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings. Residential proxies are recommended for large-scale runs.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
