# Facebook Posts Scraper (`alpha-scraper/facebook-posts-scraper`) Actor

\[ 1k/1.49$ ] Facebook Posts Scraper collects public posts from Facebook Pages and profiles, newest first: text, time, post type, reaction, comment, share and view counts, attachments (photos, albums, videos, reels, links), shared links, hashtags, mentions and author. No login.

- **URL**: https://apify.com/alpha-scraper/facebook-posts-scraper.md
- **Developed by:** [Alpha Scraper](https://apify.com/alpha-scraper) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

**Facebook Posts Scraper** collects public posts from Facebook Pages and public Facebook profiles and returns them as clean, structured data. Give Facebook Posts Scraper a Facebook Page username or a Facebook URL, and it returns the newest posts first, with text, publish time, post type, reactions, comments, shares, views, attachments, shared links, hashtags, mentions and author details.

Facebook Posts Scraper works with publicly visible Facebook content only. You do not need a Facebook account, a login or an API key, so you can go from a Facebook Page name to a ready dataset in a few minutes.

> **📌 At a glance**
>
> - **Input:** Facebook Page usernames, vanity names, numeric ids or Facebook profile URLs
> - **Output:** one dataset record per post, newest first
> - **Filters:** a date window with *Posts newer than* and *Posts older than*
> - **Control:** a per-source limit, so Facebook Posts Scraper never collects more than you ask for

Teams use Facebook Posts Scraper for Facebook monitoring, competitor analysis, content research, brand tracking and engagement reporting. Because every Facebook post comes back in the same JSON structure, the data is easy to export, join with other sources or feed into a dashboard.

### 🔹 Facebook Posts Scraper – Key Features

Facebook Posts Scraper focuses on the details that matter when you analyse a Page feed.

- **Newest first:** Facebook Posts Scraper returns posts in feed order, so the latest activity is always at the top.
- **Page and profile support:** use Facebook Page names, vanity URLs, numeric ids or public Facebook profile links.
- **Multiple sources in one run:** combine *Usernames* and *Start URLs*, and each entry gets its own limit.
- **Date filters:** keep only Facebook posts published inside a window you define.
- **Engagement metrics:** reaction totals, a top-reaction breakdown, comment count, share count and video views.
- **Rich attachments:** photos, albums, videos, reels and shared links are listed for each post.
- **Text signals:** hashtags, mentions and links found in the Facebook post text are extracted for you.
- **Post flags:** sponsored Facebook posts, shared posts and posts with comments turned off are marked.
- **Stable ids:** every record carries the Facebook post id, a permalink and the source you searched with.

> **✅ Why use this Actor**
>
> Facebook Posts Scraper replaces manual copy-and-paste. Facebook Posts Scraper pages through the Facebook feed for you, stops at your limit and delivers consistent fields that you can export as JSON, CSV or Excel.

### 🔍 What Data Does Facebook Posts Scraper Extract?

Each dataset item describes one Facebook post. The table groups the fields by purpose.

| Group | Fields | What you get |
|---|---|---|
| Identity | `postId`, `storyId`, `url`, `topLevelUrl` | Unique ids and links to the Facebook post |
| Timing | `time`, `timestamp` | Publish time as an ISO string and as a Unix timestamp |
| Content | `type`, `text`, `hashtags`, `mentions`, `links` | Post type, caption text and extracted text signals |
| Engagement | `reactionCount`, `reactionCountRounded`, `topReactions`, `commentCount`, `shareCount`, `viewCount` | Public engagement numbers |
| Media | `attachments`, `media` | Photos, albums, videos and reels attached to the post |
| Flags | `isSponsored`, `isShare`, `sharedPostId`, `commentsDisabled`, `feedbackId` | Sponsored, shared and comment status |
| Author | `author` | Author id, name and URL |
| Source | `facebookUrl`, `scrapedAt`, `number` | The Page you scraped, collection time and position |

The `type` field takes values such as `status`, `photo`, `album`, `video`, `reel`, `link` and `event`, depending on what the Facebook post contains. That makes Facebook Posts Scraper handy for comparing formats.

### 🚀 How to Use Facebook Posts Scraper

Running Facebook Posts Scraper takes a few steps in Apify Console.

- **Step 1 – Open the Actor:** start Facebook Posts Scraper from the Apify Store and go to the Input tab.
- **Step 2 – Add your sources:** enter Facebook usernames such as `nike` or paste Facebook Page URLs into *Start URLs*.
- **Step 3 – Set a limit:** choose *Max items* to cap the number of Facebook posts per source.
- **Step 4 – Add dates if needed:** fill *Posts newer than* or *Posts older than* to narrow the window.
- **Step 5 – Run:** start Facebook Posts Scraper and watch the dataset fill as Facebook posts are collected.
- **Step 6 – Export:** download the results as JSON, CSV or Excel, or read them through the Apify API.

> **💡 Tip:** the input is prefilled with a sample username. If you only want your own URLs, clear the *Usernames* list before you run Facebook Posts Scraper.

### 📥 Facebook Posts Scraper Input

Facebook Posts Scraper has five input fields. All of them are optional, but you need at least one username or URL.

| Field | Type | Description |
|---|---|---|
| `usernames` | array | Facebook Page usernames, vanity names or numeric ids, for example `nike` or `natgeo`. |
| `startUrls` | array | Facebook Page or public profile URLs, such as `https://www.facebook.com/natgeo`. Tab suffixes like `/reels` are removed. |
| `postsNewerThan` | string | Keep only posts published on or after this date, in `YYYY-MM-DD` format (UTC). Collection stops once posts get older. |
| `postsOlderThan` | string | Keep only posts published before this date, in `YYYY-MM-DD` format (read as 00:00 UTC). Newer posts are skipped. |
| `maxItems` | integer | Maximum number of posts per Page or profile. The default is 30. |

Every entry in `usernames` and `startUrls` gets its own limit, so three sources with `maxItems` set to 20 can return up to 60 posts.

Here is a sample input for Facebook Posts Scraper that collects up to 25 posts from one Page inside a date window:

```json
{
  "usernames": ["natgeo"],
  "startUrls": [],
  "postsNewerThan": "2026-09-01",
  "postsOlderThan": "2026-11-01",
  "maxItems": 25
}
```

### 📤 Facebook Posts Scraper Output

Facebook Posts Scraper writes one record per post to the default dataset. Fields without a value are returned as `null`, so every record has the same shape.

```json
{
  "postId": "1234567890123456",
  "storyId": "UzpfSTEyMzQ1Njc4OTAxMjM0NTY6MTIzNDU2Nzg5MDEyMzQ1Ng==",
  "url": "https://www.facebook.com/samplepage/posts/pfbid0ExampleSamplePostId",
  "topLevelUrl": "https://www.facebook.com/100000000000001/posts/1234567890123456",
  "time": "2026-10-28T14:30:00.000Z",
  "timestamp": 1793197800,
  "type": "photo",
  "text": "Golden hour at the harbor. Which shot is your favorite? #photography #sunset",
  "hashtags": ["#photography", "#sunset"],
  "mentions": null,
  "reactionCount": 2480,
  "reactionCountRounded": "2.5K",
  "topReactions": [
    { "reaction": "Like", "reaction_id": "1635855486666999", "count": 2100 },
    { "reaction": "Love", "reaction_id": "1678524932434102", "count": 310 },
    { "reaction": "Wow", "reaction_id": "478547315650144", "count": 70 }
  ],
  "commentCount": 96,
  "shareCount": 41,
  "viewCount": null,
  "attachments": [
    { "type": "photo", "id": "9876543210987654", "url": "https://example.com/photo/9876543210987654", "width": 1080, "height": 1350 }
  ],
  "media": [
    { "type": "photo", "id": "9876543210987654", "url": "https://example.com/photo/9876543210987654", "width": 1080, "height": 1350 }
  ],
  "links": null,
  "isSponsored": false,
  "isShare": false,
  "sharedPostId": null,
  "feedbackId": "ZmVlZGJhY2s6MTIzNDU2Nzg5MDEyMzQ1Ng==",
  "commentsDisabled": false,
  "author": {
    "id": "100000000000001",
    "name": "Sample Page",
    "url": "https://www.facebook.com/samplepage"
  },
  "facebookUrl": "https://www.facebook.com/samplepage",
  "scrapedAt": "2026-11-06T15:15:23.000Z",
  "number": 1
}
```

#### 🧾 Output field guide

- `postId` and `storyId` identify the post, and `url` links to it.
- `time` and `timestamp` give the publish time in two formats.
- `type` describes the kind of post, and `text` holds the caption.
- `hashtags` and `mentions` list the tags and mentions found in the text.
- `reactionCount` is the total, and `topReactions` breaks it down by reaction type.
- `commentCount`, `shareCount` and `viewCount` are the public counters.
- `attachments` and `media` list the photos, albums, videos and reels in the post.
- `links` lists external links shared in the post or its text.
- `isSponsored`, `isShare` and `commentsDisabled` flag how the post behaves.
- `author` identifies the Page or profile that published the post.
- `facebookUrl`, `scrapedAt` and `number` tell you which Facebook source, when, when and in what order the record was collected.

### 📅 How to Scrape Posts by Date Range with Facebook Posts Scraper

Date filters turn Facebook Posts Scraper into a simple monitoring tool. Set *Posts newer than* to the day of your last run, and each new run collects only the posts published since then.

For campaign reviews, set both dates. Facebook Posts Scraper keeps posts published on or after the first date and before the second date, and it stops paging once posts get older than the lower bound. Dates use `YYYY-MM-DD` and are read in UTC.

### 🎯 Facebook Posts Scraper Use Cases

Facebook Posts Scraper fits many workflows that depend on public posts.

- **Competitor analysis:** compare how often rival Facebook Pages post and which posts earn the most reactions.
- **Content research:** find the post types, topics and hashtags that perform well in your niche.
- **Brand monitoring:** keep an archive of what your own Facebook Page published and how people reacted.
- **Influencer vetting:** review recent posts and engagement before you start a partnership.
- **Social media reporting:** export post metrics to a spreadsheet or BI tool for weekly reports.
- **Link and media tracking:** collect the external links and media shared by Pages.
- **Campaign analysis:** use the date filters to study the posts of a single campaign window with Facebook Posts Scraper.

### 💰 Pricing

Facebook Posts Scraper runs on the Apify platform. The current pricing is shown on the Actor page in the Apify Store, and your cost depends on the number of results and the resources used by the run.

> **💡 Cost tip:** start with a small *Max items* value such as 10 or 20. Check the output, then increase the limit once the data looks right.

### 💡 Tips and Best Practices

- **Start small:** a short test run confirms the Page name and shows the fields before a large collection.
- **Use date filters for monitoring:** set *Posts newer than* to the date of your last run to collect only new posts.
- **Clear the sample username:** remove the prefilled `nike` if you only want your own sources.
- **Expect public data only:** Facebook Posts Scraper returns what a logged-out visitor can see on Facebook. Some Pages hide counters or limit older posts.
- **Plan your limit:** each source has its own *Max items*, so multiply by the number of sources to estimate the dataset size.
- **Check nulls:** a `null` field means the value was not shown for that post, not that Facebook Posts Scraper failed.
- **Schedule regular runs:** use Apify schedules to keep a Facebook post archive up to date.

> **⚠️ Important:** only collect data you are allowed to use. Public Facebook posts can contain personal data, so follow Facebook's terms and the privacy rules that apply to you, such as GDPR. This Actor is not affiliated with or endorsed by Meta.

### ❓ Frequently Asked Questions

#### 🔎 What is Facebook Posts Scraper?

Facebook Posts Scraper is an Apify Actor that collects public posts from Facebook Pages and public profiles. It returns text, time, reactions, comments, shares, views, attachments and links in a structured format.

#### 🧭 How do I scrape Facebook Page posts?

Open Facebook Posts Scraper, enter a Page username or paste a Page URL, set *Max items* and start the run. The posts appear in the dataset, newest first.

#### 🧩 Can I scrape posts from several Facebook Pages in one run?

Yes. Add several usernames or URLs, and Facebook Posts Scraper collects up to *Max items* posts from each one.

#### 📅 Can I scrape Facebook posts from a specific date range?

Yes. Use *Posts newer than* and *Posts older than* with `YYYY-MM-DD` dates to keep only posts inside that window.

#### 🔐 Does Facebook Posts Scraper need a Facebook login?

No. Facebook Posts Scraper reads publicly visible content, so no account, cookies or API key are required.

#### 📦 What data does Facebook Posts Scraper return?

Each record includes ids, links, time, post type, text, hashtags, mentions, reaction and comment counts, shares, views, attachments, shared links, post flags and author details.

#### 🚫 Can I scrape private Facebook profiles or groups?

No. Facebook Posts Scraper only returns public content from Pages and public profiles. For group content, use a dedicated group Actor.

#### 📊 Can I export Facebook posts to CSV or Excel?

Yes. Any Apify dataset can be downloaded as JSON, CSV, Excel, XML or HTML, or read through the Apify API.

#### 🧐 Why are some fields empty?

Posts show different details. When a value is not public for a post, Facebook Posts Scraper returns `null` for that field.

#### 🔢 How many Facebook posts can I scrape?

Set *Max items* to the number you need. Facebook Posts Scraper collects up to that many Facebook posts per source and stops earlier only when a Page has fewer public posts or the date window ends.

#### ⏰ Can I monitor a Facebook Page for new posts?

Yes. Schedule Facebook Posts Scraper in Apify and set *Posts newer than* to your previous run date. Each scheduled run then returns only the new Facebook posts.

#### ⚖️ Is it legal to scrape Facebook posts?

Facebook Posts Scraper collects public Facebook content only. You are responsible for how you use the data, so check Facebook's terms, local laws and privacy rules before you store or share personal information.

### 📞 Support

If you have questions, ideas for new fields or find a Page that does not return the expected posts, send the Page name and the input you used.

- Contact me by email: alphascraper69@gmail.com

# Actor input Schema

## `usernames` (type: `array`):

Page usernames, vanity names or numeric ids (for example nike or natgeo). Combined with 'Start URLs': clear this list if you only want to scrape the Start URLs.

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

Page or public profile URLs, for example https://www.facebook.com/natgeo or https://www.facebook.com/profile.php?id=<id>. Tab suffixes such as /reels are removed. Combined with 'Usernames'.

## `postsNewerThan` (type: `string`):

Only keep posts published on or after this date (YYYY-MM-DD, UTC). Paging stops once the posts get older than this date. Leave empty for no lower bound.

## `postsOlderThan` (type: `string`):

Only keep posts published before this date (YYYY-MM-DD, read as 00:00 UTC); newer posts are skipped. Leave empty for no upper bound.

## `maxItems` (type: `integer`):

Maximum number of posts to collect per Page / profile. Every entry of 'Usernames' and 'Start URLs' gets its own limit, so N entries return up to N x this value.

## Actor input object example

```json
{
  "usernames": [
    "nike"
  ],
  "startUrls": [
    "https://www.facebook.com/Cristiano/"
  ],
  "maxItems": 15
}
```

# Actor output Schema

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

Structured records extracted by Facebook Posts Scraper and stored in the run's default dataset.

# 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 = {
    "usernames": [
        "nike"
    ],
    "startUrls": [
        "https://www.facebook.com/Cristiano/"
    ],
    "maxItems": 15
};

// Run the Actor and wait for it to finish
const run = await client.actor("alpha-scraper/facebook-posts-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 = {
    "usernames": ["nike"],
    "startUrls": ["https://www.facebook.com/Cristiano/"],
    "maxItems": 15,
}

# Run the Actor and wait for it to finish
run = client.actor("alpha-scraper/facebook-posts-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 '{
  "usernames": [
    "nike"
  ],
  "startUrls": [
    "https://www.facebook.com/Cristiano/"
  ],
  "maxItems": 15
}' |
apify call alpha-scraper/facebook-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alpha-scraper/facebook-posts-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/XYcnBTU2fE8BBWfsl/builds/0WGXKfYKDrVm5kvxw/openapi.json
