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

The Facebook Posts Scraper retrieves real-time posts from any public Facebook page, including text content, images, timestamps, and engagement metrics such as reactions, comments, shares, and video views. Data is fetched live from Facebook without any caching or database layers in between.

- **URL**: https://apify.com/axesso_data/facebook-posts-scraper.md
- **Developed by:** [AxCrawler](https://apify.com/axesso_data) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 6 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

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

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

### How does Facebook Posts Scraper work?

The Facebook Posts Scraper works seamlessly to extract detailed, real-time posts directly from Facebook. It is designed for efficiency and ease of use, requiring only a few parameters to deliver precise and comprehensive post data.

Here's how it works:

1. **Input Parameters:** Simply provide the Facebook page URL along with the maximum number of posts to be scraped to extract relevant post data efficiently.

2. **Data Extraction:** The scraper retrieves posts from Facebook and extracts relevant details for each post, including text content, images, timestamps, engagement metrics (reactions, comments, shares), and other key insights.

3. **Real-Time Output:** Unlike preprocessed data, our scraper retrieves up-to-date posts directly from Facebook, ensuring accurate and fresh data every time.

4. **Download Options:** Once the posts are extracted, the data can be downloaded in your preferred format, such as JSON, CSV, Excel, XML, or HTML.

With the Facebook Posts Scraper, you get a user-friendly, reliable tool that delivers fast, accurate, and customizable data extraction to meet your specific needs.

### Input data

Input data must be provided in JSON format and must contain one mandatory array field "input". Each item in the array represents one Facebook page to scrape posts from. Every field listed below is supported:

| Parameter | Required | Type | Description |
|---|---|---|---|
| `url` | Yes | string | URL of the Facebook page for which posts should be obtained, e.g. `https://www.facebook.com/DFBTeam`. Pagination is handled automatically until `maxPosts` posts have been collected. |
| `maxPosts` | No | number | Exact number of posts to deliver for this page, counted from the newest post backwards. The Actor follows the pagination cursor page by page (up to 50 pages per input entry) and cuts the result at exactly this number. Defaults to `1`. |

The "input" field is an array, allowing you to pass multiple page URLs in one run. Each URL can be configured with an individual `maxPosts`, enabling the scraping of up to millions of posts from different pages.

#### Example input

```json
{
  "input": [
    {
      "url": "https://www.facebook.com/facebook",
      "maxPosts": 50
    },
    {
      "url": "https://www.facebook.com/Thalia",
      "maxPosts": 50
    }
  ]
}
```

### Output data

```json
[
  {
    "statusCode": 200,
    "statusMessage": "FOUND",
    "text": "2️⃣8️⃣ Happy Birthday, Benny! 🖤❤️💛\n\n#dfbteam | 📸 DFB/Philipp Reinhard",
    "pageId": "100044370281791",
    "creationDate": "Sunday, February 23, 2025 at 09:21 AM",
    "id": "UzpfSTEwMDA0NDM3MDI4MTc5MToxMTc2MDM0MjEzODg1NTc3OjExNzYwMzQyMTM4ODU1Nzc=",
    "feedbackId": "ZmVlZGJhY2s6MTE3NjAzNDIxMzg4NTU3Nw==",
    "imageUrlList": [
      "https://scontent.xx.fbcdn.net/v/t39.30808-6/480489147_1176034190552246_6362498989420048211_n.jpg?stp=dst-jpg_s1080x2048_tt6&_nc_cat=109&ccb=1-7&_nc_sid=127cfc&_nc_ohc=8tNZEltUQjAQ7kNvgEIRh3d&_nc_oc=AdhsyhdM5C-7HYhOBb72h78LO-U1IuaY0H_qUDE9hoQE_hWdUXYOe7FxyAY164iDsLI&_nc_zt=23&_nc_ht=scontent.xx&_nc_gid=APT9nsfQBQhRzDynvboehMN&oh=00_AYAtTKMaBswCu3MJBA9KafqeC_GhZGmBjll9p0rvqZqNMQ&oe=67C2984C"
    ],
    "pageUrl": "https://www.facebook.com/DFBTeam",
    "creationTime": 1740302471,
    "postUrl": "https://www.facebook.com/DFBTeam/posts/pfbid02Zg6QLAxtJ4NHtuYdBDbvemgvmHJdHGYrDBMCsKX7uZWSVPBELkVqFqVjCh4UpQzbl",
    "postId": "1176034213885577",
    "reactionCount": 321,
    "shareCount": 8,
    "commentComment": 32,
    "externalUrl": null,
    "videoViewCount": 0,
    "inputUrl": "https://www.facebook.com/DFBTeam"
  }
]
```

### How much does Facebook Posts Scraper cost?

With our Pay-Per-Result pricing model, the cost is completely transparent and predictable, unlike renting actors where expenses can be hard to forecast. The price per result can be easily obtained at the top of this listing page, giving you full visibility into your costs before you start scraping.

### What to consider when using this Actor?

We have been performing web crawling activities for over a decade. All our expertise is included in this Actor, this means the user of this Actor is not required to deal with any inconveniences of web scraping.

In detail it means we cover the whole lifecycle including

1. **Proxy Rotation:** We use our own Proxy Pool including several million proxies in all countries worldwide avoiding that our Scraper can be blocked.

2. **Geo Targeting:** We determine the correct proxy location for each request to Facebook, minimizing geo-restriction issues and ensuring reliable access to public page content.

3. **Captchas and Blocking Handling:** Captchas and temporary blocks are completely handled by this Actor under the hood ensuring the user to get always the required data.

4. **Stability and Reliability:** Designed to handle large scale requests with error handling and retries for consistent and dependable operation.

### More Facebook Actors by Axesso

Looking for a different slice of Facebook data? Axesso offers a full suite of real-time Facebook Actors - each one dedicated to a specific endpoint:

| Actor | What it does |
|---|---|
| [Facebook Comments Scraper](https://apify.com/axesso_data/facebook-comments-scraper) | Scrape real-time comments from public Facebook posts including text, timestamps, author info, and engagement metrics. |
| [Facebook Page Info Scraper V2](https://apify.com/axesso_data/facebook-page-info-scraper-v2) | Scrape real-time information from any public Facebook page, including name, follower and like counts, category, contact details, ... |
| [Facebook Post Details Scraper](https://apify.com/axesso_data/facebook-post-details-scraper) | Scrape real-time details for any public Facebook post by URL, including full text content, publish date, image URLs, and engagement ... |
| [Facebook Posts Scraper V2](https://apify.com/axesso_data/facebook-posts-scraper-v2) | Scrape real-time posts from public Facebook pages by pageId with automatic pagination and date filtering. |
| [Facebook Reels Scraper](https://apify.com/axesso_data/facebook-reels-scraper) | Scrape real-time reels from any public Facebook page, including captions, publish dates, images, video view counts, and engagement ... |
| [Facebook Video Details Scraper](https://apify.com/axesso_data/facebook-video-details-scraper) | Scrape real-time details for public Facebook video posts by video ID, including play count, view count, reactions, comments, and media URLs. |
| [Facebook Video Search Scraper](https://apify.com/axesso_data/facebook-video-search-scraper) | Search Facebook for video posts by keyword, sorting by relevance or most recent. |

All Axesso Actors are built and maintained to the same standards: real-time data without caching, high availability and active maintenance, consistent input patterns, and responsive support when you need help. If you are missing a specific endpoint, reach out - the portfolio is continuously growing.

### Where else you can find Axesso - Data Service solutions?

Axesso APIs and Actors are available through the Axesso own [API Portal](https://axesso.developer.azure-api.net/apis) and on [RapidAPI](https://rapidapi.com/search?term=axesso\&sortBy=ByRelevance). Our track record includes thousands of subscribers and stable service for over 5 years.

### Use cases for our Axesso Actors

1. **Market Research:** Businesses can utilize this Actor to gather social media data, including posts, engagement metrics, and user sentiment. This information helps in understanding market trends, analyzing competitors, and identifying gaps in content strategies.

2. **Brand Monitoring:** Companies can track mentions of their brand or products on social media using this Actor. This allows them to respond to customer feedback in real-time, manage their online reputation, and engage with their audience effectively.

3. **Audience Insights:** Marketers can analyze social media posts to gain insights into audience preferences, behaviors, and trends. This data can inform content strategies, targeting decisions, and product development.

4. **Content Strategy Development:** Brands with active social media presence can use this Actor to monitor trending topics, popular posts, and user-generated content. This helps in crafting relevant and engaging content that resonates with their audience.

5. **Sentiment Analysis:** Companies can analyze user comments and reactions on social media to gauge public sentiment about their brand, products, or industry. By identifying common themes, brands can adapt their messaging and improve customer satisfaction.

6. **Lead Generation:** Businesses can leverage this Actor to identify potential influencers, partners, or customers by scraping social media for contact information and engagement metrics. This data can be used for targeted outreach and business development efforts.

7. **Content Aggregation and Curation:** Content creators, bloggers, and publishers can use this Actor to aggregate social media posts, images, and user feedback to create curated content such as articles, reviews, or social media roundups.

8. **Competitive Analysis:** Social media marketers can use this Actor to analyze competitors' posts, engagement strategies, and audience interactions. This data can inform their own social media strategies and help them stay competitive.

9. **Ad Campaign Optimization:** Advertisers can gather insights from social media data using this Actor to identify trending topics, popular posts, and effective engagement strategies. This information can be used to optimize ad campaigns and improve overall performance.

### Disclaimer

This Actor is not affiliated or partnered with the vendors used in the Actor; only publicly available data is extracted. Users are responsible for ensuring that their use of the Actor and the returned data complies with applicable laws and the requirements of their individual use case.

# Actor input Schema

## `input` (type: `array`):

List of inputs, where each entry represents a URL of a Facebook page to scrape posts from.

## Actor input object example

```json
{
  "input": [
    {
      "url": "https://www.facebook.com/facebook",
      "maxPosts": 1
    }
  ]
}
```

# Actor output Schema

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

No description

# 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 = {
    "input": [
        {
            "url": "https://www.facebook.com/facebook",
            "maxPosts": 1
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("axesso_data/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 = { "input": [{
            "url": "https://www.facebook.com/facebook",
            "maxPosts": 1,
        }] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,axesso_data/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/dUzs2usa7YlpBzWkc/builds/evaaMIYcis3w44nea/openapi.json
