# Facebook Posts Scraper - Public Pages, No Login (`leadproof/facebook-posts`) Actor

Scrape the latest posts from any public Facebook Page with no login and no cookies. One row per post: text, date, reactions, comments, shares, views, permalink, thumbnail. Pay per post.

- **URL**: https://apify.com/leadproof/facebook-posts.md
- **Developed by:** [Lead Proof](https://apify.com/leadproof) (community)
- **Categories:** Social media, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 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.

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

## 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 - Public Pages, No Login

Get the latest posts from any public Facebook Page as clean, structured data. No Facebook account, no session cookies, nothing to paste. Give it Page URLs, get one row per post with text, date, reactions, comments, shares, views, permalink and thumbnail.

Works with vanity URLs (`facebook.com/nasa`) and numeric Pages (`facebook.com/profile.php?id=...`). You pay per post returned.

### Why this scraper

- **No login, no cookies.** The actor reads the feed the way Facebook's own web app does, from the public Page, so there is no account to get banned and nothing sensitive to hand over.
- **Real numbers.** Reaction, comment and share counts come from Facebook's data feed, including the comment counts the logged-out page itself hides.
- **Numeric Pages work.** `profile.php?id=` links are handled the same as vanity URLs.
- **Date filter.** Set a floor date and only newer posts are returned and charged.
- **Cost control.** The actor loads only the page document and reads the feed from it directly, so the run spends its proxy traffic on data, not on scripts and pictures. Your spending limit is respected: the actor never writes more posts than it is allowed to charge.

### How to use

1. Paste one or more public Facebook Page URLs into **Facebook Page URLs**.
2. Set **Max posts per Page** (newest first).
3. Optionally set **Only posts newer than** to a `YYYY-MM-DD` date.
4. Run. Results land in the default dataset, ready to export as JSON, CSV or Excel, or to feed into another actor.

Everything under **Advanced** can stay at its default.

### Input example

```json
{
  "startUrls": [
    { "url": "https://www.facebook.com/nasa" },
    { "url": "https://www.facebook.com/humansofnewyork" }
  ],
  "resultsLimit": 25,
  "onlyPostsNewerThan": "2026-01-01"
}
```

### Output

One dataset item per post:

| Field | Meaning |
|---|---|
| `page_name` | Display name of the Page |
| `page_url` | The input URL |
| `post_id` | Facebook's numeric post ID |
| `post_url` | Permalink to the post |
| `publish_date` | Publish time, UTC ISO 8601 |
| `post_text` | Full post text |
| `likes` | Reaction count |
| `comments` | Comment count |
| `shares` | Share count |
| `views` | View count (videos only) |
| `is_video` | `yes` / `no` |
| `media_thumbnail` | URL of the post's first image or video thumbnail |
| `scraped_date` | When the row was collected |

A run summary (`pages`, `posts`, `pages_blocked`, `dropped_old`) is saved to the key-value store under `STATS`.

### Pricing

Pay per event: a small fee when the run starts, a small fee for each Page that returns posts, and a fixed price per post. Posts dropped by the date filter are not charged. Set a maximum total charge on the run and the actor will stop before exceeding it.

### Good to know

- **Public Pages only.** Groups, private profiles and posts behind a login are out of scope. Comment text is not collected, only counts.
- **Newest first.** Posts come in feed order, so `resultsLimit` gives you the most recent ones.
- **Repeated pulls of the same Page.** Facebook rate-limits its feed per network session. Pulling one Page many times within an hour can leave that Page returning fewer posts for a while. The actor retries with a fresh proxy session automatically; for large monitoring jobs, spread runs out over the day.
- **Geo-restricted Pages.** If a Page is only visible in some countries, set **Proxy country** to match.
- **Fair use.** Only collect data you are allowed to use under the laws that apply to you. The actor accesses public content only.

***

*Need verified business emails to go with your research? Try [Bulk Email Verifier](https://apify.com/leadproof/bulk-email-verifier) or [Google Maps Leads with Verified Emails](https://apify.com/leadproof/google-maps-verified-leads).*

*Built by [LeadProof](https://leadproof.co) - verified local-business lead lists, built to order.*

# Actor input Schema

## `startUrls` (type: `array`):

Public Facebook Page URLs to scrape. Vanity URLs and profile.php?id=... links both work. One Page per line.

## `resultsLimit` (type: `integer`):

How many of the newest posts to collect from each Page. You are charged per post returned.

## `onlyPostsNewerThan` (type: `string`):

Optional date in YYYY-MM-DD. Older posts are dropped and not charged.

## `countryCode` (type: `string`):

Two-letter country code for the residential proxy exit. Pages restricted to a region need a matching country.

## `proxy` (type: `string`):

RESIDENTIAL is the reliable choice for Facebook. DATACENTER is cheaper but usually blocked. NONE runs without a proxy.

## `blockAssets` (type: `boolean`):

Keeps proxy traffic and cost low. Post data is unaffected because it comes from Facebook's data feed, not from rendered media. Turn off only if a Page returns nothing.

## `blockScripts` (type: `boolean`):

Loads only the page document on the first attempt and reads the feed from it directly, which keeps proxy traffic minimal. A Page that comes back with too few posts is automatically retried with a full load.

## `scrolls` (type: `integer`):

Only used when the direct feed query is unavailable for a Page. How many times to scroll and re-read the page.

## `delayMs` (type: `integer`):

Politeness delay between consecutive Page loads.

## `navTimeoutMs` (type: `integer`):

How long a single Page load may take before it is retried.

## `headless` (type: `boolean`):

Run Chromium headless. Turning this off is heavier and rarely needed.

## `keepDebugHtml` (type: `boolean`):

Stores the first Page's rendered HTML and raw feed responses for troubleshooting.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/nasa"
    },
    {
      "url": "https://www.facebook.com/humansofnewyork"
    }
  ],
  "resultsLimit": 25,
  "countryCode": "US",
  "proxy": "RESIDENTIAL",
  "blockAssets": true,
  "blockScripts": true,
  "scrolls": 6,
  "delayMs": 3000,
  "navTimeoutMs": 45000,
  "headless": true,
  "keepDebugHtml": false
}
```

# Actor output Schema

## `posts` (type: `string`):

One item per post: page\_name, page\_url, post\_id, post\_url, publish\_date, post\_text, likes, comments, shares, views, is\_video, media\_thumbnail, scraped\_date.

## `stats` (type: `string`):

Counts of pages processed, pages charged, pages blocked, posts written and posts dropped by the date filter.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://www.facebook.com/nasa"
        },
        {
            "url": "https://www.facebook.com/humansofnewyork"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("leadproof/facebook-posts").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "startUrls": [
        { "url": "https://www.facebook.com/nasa" },
        { "url": "https://www.facebook.com/humansofnewyork" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("leadproof/facebook-posts").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.facebook.com/nasa"
    },
    {
      "url": "https://www.facebook.com/humansofnewyork"
    }
  ]
}' |
apify call leadproof/facebook-posts --silent --output-dataset

```

## MCP server setup

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

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/dgNyK4MlhhKIf1Tjc/builds/SlnqHuYwHgi6uEiyH/openapi.json
