# Facebook posts scraper - Group, Page, Search (`curious_coder/facebook-post-scraper`) Actor

Scrape facebook posts from profiles, pages, groups  and search results. Get complete details such as author details, post text, attachments, engagement details, etc.

- **URL**: https://apify.com/curious\_coder/facebook-post-scraper.md
- **Developed by:** [Curious Coder](https://apify.com/curious_coder) (community)
- **Categories:** Social media
- **Stats:** 3,065 total users, 154 monthly users, 99.8% runs succeeded, 92 bookmarks
- **User rating**: 3.06 out of 5 stars

## Pricing

from $1.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/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

The **Facebook Posts Scraper** is an [Apify actor](https://apify.com/store) designed to extract [Facebook](https://facebook.com) posts from groups, pages/profiles, and Facebook search URLs.

***

### Key Features

| Feature | Description |
|---------|-------------|
| **Multiple Sources** | Scrape posts from Groups, Pages, Profiles, and Facebook Search URLs |
| **Comprehensive Data** | Post text, timestamps, author info, attachments, reactions, shares, comments |
| **Top Comments Extraction** | Get the most engaging comments with author details |
| **Cookie-Based Authentication** | Optional login for accessing more content |
| **Post date filter** | Set limits to scrape only latest posts |
| **Multiple Export Formats** | JSON, CSV, Excel, XML, HTML |
| **Anti-Blocking Technology** | Automatic smart proxy management  |

### Data Fields Extracted

- **Post URL** - Direct link to the post
- **Created Timestamp** - Unix timestamp for post creation
- **Author Information** - Name, ID, profile URL, verified status
- **Post Content** - Full text content
- **Attachments** - Images, videos, links
- **Engagement Metrics** - Reaction count, share count, comment count
- **Top Comments** - Most engaged comments with author details
- **Profile Pictures** - Author avatar URLs

### Common Use Cases

| Use Case | Application | Typical Results |
|----------|-------------|-----------------|
| **Ad Creative Research** | Scrape viral posts for ad angle inspiration | 4+ ROAS improvement |
| **Lead Generation** | Extract hiring/service request posts | 2,500+ leads/day |
| **Marketplace Arbitrage** | Source undervalued products to resell | $2,000+/month profit |
| **Competitor Monitoring** | Track competitor posts and engagement | Real-time intelligence |
| **Content Curation** | Identify trending topics and viral patterns | Data-driven content strategy |
| **CRM Enrichment** | Augment lead data with social insights | Higher conversion rates |

***

### Getting Started

#### Prerequisites

1. [Apify account](https://apify.com) (free to start)
2. [Cookie-Editor Chrome extension](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) (for authenticated scraping)

#### Quick Start Guide

##### Step 1: Get Facebook Cookies (Optional but Recommended)

For access to more content and search results:

1. Install the [Cookie-Editor extension](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm)
2. Log into your Facebook account in a browser tab
3. While on facebook.com, click the Cookie-Editor extension
4. Click "Export" and copy the cookies JSON
5. Paste into the actor's "Cookie" input field

##### Step 2: Configure Your Scrape

**Facebook URLs to Scrape:**

- **Group URL:** `https://www.facebook.com/groups/<group-name>/`
- **Page/Profile URL:** `https://www.facebook.com/<page-or-user>/`
- **Search URL:** `https://www.facebook.com/search/top?q=<query>` *(requires cookies)*

##### Step 3: Configure Proxy Settings

The actor automatically uses Apify Proxy for enhanced reliability. No additional configuration needed for most use cases. But you can provide your own proxy urls if you have

##### Step 5: Run and Export

1. Click "Start" to run the actor
2. Monitor progress in real-time
3. Export data in your preferred format (JSON, CSV, Excel, etc.)

### Related Facebook Scrapers

To extract comments from Facebook posts, use the [Facebook Comment Scraper](https://apify.com/curious_coder/facebook-comment-scraper) which collects complete comment details including replies and engagement metrics. For profile data extraction, the [Facebook Profile Scraper](https://apify.com/curious_coder/facebook-profile-scraper) extracts comprehensive information from Facebook profiles. To scrape group members, the [Facebook Group Member Scraper](https://apify.com/curious_coder/facebook-group-member-scraper) collects member details from any Facebook group you have access to. For search results, the [Facebook Search Scraper](https://apify.com/curious_coder/facebook-people-search-scraper) extracts people and content from Facebook search queries. You can also explore Facebook ads with the [Facebook Ads Library Scraper](https://apify.com/curious_coder/facebook-ads-library-scraper) and find profile email information using the [Facebook Profile Email Finder](https://apify.com/curious_coder/facebook-profile-email-finder).

***

### Sample Data Output

#### Visual Preview

![Scraped 4,000+ Facebook group posts](https://ik.imagekit.io/webscraper/facebook-group-posts-scrape.png?updatedAt=1696184556095)

#### JSON Output Example

```json
{
  "createdAt": 1715352299,
  "url": "https://www.facebook.com/groups/coldemailmasterclass/permalink/844179877727334/",
  "user": {
    "id": "100003654639487",
    "name": "James Kricked Parr",
    "url": "https://www.facebook.com/krickedart"
  },
  "text": "Hiring 2 talented VAs: 1 api/webhooks/ghl/clay PRO and 1 data filtering PRO with extreme attention to detail, will also work on instantly subsequences too. Drop 'yes me' if that's u👇",
  "attachments": [],
  "reactionCount": 12,
  "shareCount": 0,
  "commentCount": 25,
  "topComments": [
    {
      "text": "Yes me",
      "createdAt": 1715352417,
      "author": {
        "name": "Azhar Kamal",
        "id": "100005206265467",
        "gender": "MALE",
        "url": "https://www.facebook.com/mak.megamind",
        "profilePicture": "https://scontent.fblr1-3.fna.fbcdn.net/v/t39.30808-1/306762469_2023046817878841_2432511838240140780_n.jpg",
        "shortName": "Azhar",
        "isVerified": false
      },
      "reactionCount": 1,
      "commentCount": 2,
      "url": "https://www.facebook.com/groups/coldemailmasterclass/permalink/844179877727334/?comment_id=844197721058883"
    },
    {
      "text": "Let me know when you need that Clay knowledge:)",
      "createdAt": 1715366101,
      "author": {
        "name": "Josh Whitfield",
        "id": "100005815925914",
        "gender": "MALE",
        "url": "https://www.facebook.com/ragevmachine",
        "profilePicture": "https://scontent.fblr1-4.fna.fbcdn.net/v/t39.30808-1/355892298_2148165328720644_7118474293467825230_n.jpg",
        "shortName": "Josh",
        "isVerified": true
      },
      "reactionCount": 3,
      "commentCount": 2,
      "url": "https://www.facebook.com/groups/coldemailmasterclass/permalink/844179877727334/?comment_id=844314761047179"
    }
  ]
}
```

***

### Pricing

#### Cost Per Usage

Based on historical data, this scraper costs an average of **$0.35 per 1,000 Facebook posts** in Apify usage credits.

#### Plan Capacity

| Apify Plan | Monthly Capacity | Estimated Posts |
|------------|------------------|-----------------|
| **Starter** | $49 | ~130,000 posts |
| **Scale** | $499 | ~1,3000,000 posts |
| **Business** | Custom | Unlimited |

#### Cost Comparison with Competitors

| Service | Cost per 1,000 Posts | Monthly Minimum |
|---------|----------------------|-----------------|
| **This Scraper** | ~$0.35 | $30  |
| **Bright Data** | ~$0.50 | $500 |
| **Phantombuster** | ~$2.00 | $69 |
| **SociaVault** | ~$1.00 | Custom |

*Note: Competitor pricing based on published rates and estimated usage calculations.*

***

### Use Cases

Real businesses and marketers using Facebook scraping to drive measurable results:

***

#### 1. John Tay - 4.82 ROAS Ad Campaign Using Facebook Group Posts Scraping

**The Challenge:**\
[John Tay](https://substack.com/@johntay) needed high-converting ad angles for a client in the spiritual wellness niche but wanted to eliminate guesswork from creative development.

**The Solution:**\
Using Apify's Facebook post scraper, John scraped **33,567 viral posts** from 9 niche-specific Facebook groups. He filtered the top 100 most-engaged posts (minimum 500 likes each) and fed them into ChatGPT to extract emotional hooks, CTAs, and ad angles. Read more about it on [10xPlaybooks Blog](https://10xplaybooks.com/p/how-i-turned-33567-scraped-fb-posts-482-roas)

**The Process:**

1. **Scrape** - Collected posts with timestamps, likes, comments, and content using Apify
2. **Sort** - Filtered to top-performing posts by engagement metrics
3. **Analyze** - Used ChatGPT to extract marketing angles and emotional hooks
4. **Adapt** - Tested 7 angles as paid ads

**Results:**

- **4.82 ROAS on day one** with the best-performing ad angle
- Eliminated guesswork by using market-native insights
- Created a repeatable monthly system for fresh ad creative

> "By scraping niche-specific Facebook groups, I wasn't guessing. I was pulling real content that had already gone viral... written in the voice of the community." — John Tay

***

### Integrations & Workflows

#### Make (formerly Integromat)

Use [Make](https://www.make.com/en/register?pc=growthhack) to integrate Facebook post scraper with thousands of apps:

#### n8n Workflows

Automate scraping schedules and data processing with [n8n](https://n8n.io):

- Schedule daily competitor monitoring
- Filter and notify on high-engagement posts
- Auto-enrich leads with additional data sources

#### Zapier Integration

Connect with 5,000+ apps via [Zapier](https://zapier.com):

- Send new posts to CRM systems
- Create tasks from hiring posts
- Generate reports in Google Docs

### API Access

#### On-Demand Scraping

For detailed API documentation, visit the [Facebook Post Scraper API integration page](https://apify.com/curious_coder/facebook-post-scraper/api/endpoints).

#### API Endpoints

| Endpoint | Description |
|----------|-------------|
| `GET /actor-runs/{runId}/dataset/items` | Retrieve scraped data |
| `POST /actors/{actorId}/runs` | Start a new scraping job |
| `GET /actor-runs/{runId}` | Check run status |

#### Supported Export Formats

- **JSON** - Structured data for API integration
- **CSV** - Spreadsheet analysis
- **Excel (XLSX)** - Advanced filtering and formulas
- **XML** - Legacy system integration
- **HTML** - Browser viewing
- **RSS** - Feed reader integration

***

### FAQ

#### Do I need a Facebook account?

**No**, but having one unlocks more data:

- Without cookies: Can scrape most public pages and groups
- With cookies: Can access Facebook search, more groups, and personalized content

#### Can I scrape private Facebook groups?

This tool only scrapes content that is publicly visible or visible to the account whose cookies you provide.

#### Does it handle Facebook's anti-bot measures?

Yes. The actor includes:

- Automatic proxy rotation
- Rate limiting
- Automatic retries on failures

#### What data formats are supported?

JSON, CSV, Excel (XLSX), XML, and HTML. JSON is recommended for programmatic access; CSV/Excel for analysis.

#### Can I schedule automatic scraping?

Yes, via Apify Schedules or integrations with Make, n8n, or Zapier. Set up daily, weekly, or custom interval scrapes.

#### How do I get support?

- Technical issues: Create an issue on the actor's Issues tab in Apify Console
- Questions: Email <heycuriouscoder@gmail.com>

#### What's the difference between this and the Facebook API?

| Aspect | This Scraper | Official Facebook API |
|--------|--------------|----------------------|
| Setup | Immediate | Days/weeks for approval |
| Authentication | Optional cookies | Required OAuth |
| Rate Limits | Generous | Strict |
| Data Access | Public content | Varies by permissions |
| Cost | Usage-based | Free tier + overages |

***

*Last updated: March 2025 | Version 1.0*

**Keywords:** facebook scraper, facebook post scraper, facebook group scraper, social media scraper, facebook data extraction, facebook automation, facebook scraping tool, extract facebook posts, facebook marketing tool, facebook lead generation

# Actor input Schema

## `urls` (type: `array`):

Facebook group URLs (e.g. https://www.facebook.com/groups/hackgrowth), page/profile URLs (e.g. https://www.facebook.com/ZapierApp/, https://www.facebook.com/username/, or https://www.facebook.com/profile.php?id=123456), or search URLs (e.g. https://www.facebook.com/search/top?q=web%20scraping). Search URLs require cookies.

## `scrapePhotos` (type: `boolean`):

When enabled, scrapes all full-resolution photos from each post using Facebook's photo viewer API. This traverses the entire photo set, including photos not shown in the feed preview. Adds an 'all\_photos' array to each post with URLs, dimensions, and captions.

## `sortType` (type: `string`):

No description

## `scrapeUntil` (type: `string`):

Use this field if you want to only scrape posts newer than given date

## `count` (type: `integer`):

Leave this field empty if you want to scrape all items.

## `cursors` (type: `array`):

Array of cursors to resume scraping, in the same order as urls (1st cursor for 1st URL, etc.). Use the cursors stored in the key-value store from a previous run to continue from where you left off.

## `outputFormat` (type: `string`):

Choose 'raw' for complete nested Facebook data, or 'simple' for a clean flat structure with max 3 levels depth

## `cookie` (type: `array`):

Cookie used to authorize actor with facebook.com. Install [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) chrome extension. Login to your facebook.com account. Click on the extension and export the facebook.com cookies. Insert the contents here

## `minDelay` (type: `integer`):

Minimum duration in seconds to wait before scraping next page

## `maxDelay` (type: `integer`):

Maximum duration in seconds to wait before scraping next page

## `proxy` (type: `object`):

If using cookies, Choose a proxy from the country where you are logged into Facebook

## Actor input object example

```json
{
  "scrapePhotos": false,
  "sortType": "new_posts",
  "cursors": [],
  "outputFormat": "raw",
  "minDelay": 1,
  "maxDelay": 10,
  "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 = {
    "sortType": "new_posts",
    "outputFormat": "raw",
    "minDelay": 1,
    "maxDelay": 10,
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("curious_coder/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 = {
    "sortType": "new_posts",
    "outputFormat": "raw",
    "minDelay": 1,
    "maxDelay": 10,
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("curious_coder/facebook-post-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 '{
  "sortType": "new_posts",
  "outputFormat": "raw",
  "minDelay": 1,
  "maxDelay": 10,
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call curious_coder/facebook-post-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,curious_coder/facebook-post-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/AtBpiepuIUNs2k2ku/builds/9BFq5HcmURPw2BKQN/openapi.json
