# Facebook Page 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, Automation
- **Features:** Limited permissions
- **Stats:** 11 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 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/actors/running/actors-in-store.md#pay-per-event

## 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 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 is saved to the key-value store under `STATS`. It includes requested and processed Pages, readable Pages, returned posts, date-filtered Pages and posts, partial Pages, and whether the post budget was exhausted. `pages_blocked` counts Pages with no readable posts after retries; these can also be empty or unavailable.

### Retries and run status

- Posts already found are retained and merged across retries, without writing the same post twice for an input Page. Identical input URLs are processed once.
- If a later attempt fails, posts from earlier attempts are still returned. `pages_partial` counts readable Pages whose final attempt encountered an error.
- If every processed Page yields no readable posts after retries, the run ends succeeded with a status message that starts with `No posts:`, a saved `STATS` summary and no charge. A genuinely empty Page cannot always be distinguished from a blocked one.
- A readable Page with all posts excluded by the date filter is a valid empty result. It is counted in `pages_filtered`, not `pages_blocked`.
- Runs with some readable Pages keep their results; check `STATS` for the remaining Pages. Reaching the configured post budget is not a scraping failure.

### 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/gYxIZLQD9zGUTEpf9/openapi.json
