# Facebook Post Engagement Scraper (`premiumscraper/facebook-post-engagement-scraper`) Actor

Extract lightweight engagement metrics from Facebook posts. Output includes: total reactions, comment count, share count, video view count, per-type reaction breakdown (Like/Love/Haha/Wow/Sad/Angry), and calculated engagement rate. One row per post ✨  Facebook Post Engagement Scraper⚡

- **URL**: https://apify.com/premiumscraper/facebook-post-engagement-scraper.md
- **Developed by:** [Premium Scraper](https://apify.com/premiumscraper) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 29 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 engagement row scrapeds

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/platform/actors/running/actors-in-store#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 Post Engagement Scraper ⚡ — Lightweight Engagement Metrics

Extract **Facebook engagement** metrics from any public Facebook post URL, Page/Profile URL, or username. This Facebook engagement scraper returns one lightweight row per post with reactions, comments, shares, views, content type, thumbnail URL, and calculated engagement rate — no full post body, no media downloads.

### 🤔 Why Use This Facebook Engagement Scraper?

When you need Facebook engagement numbers fast — without the overhead of full post data, comment trees, or media downloads — this Facebook engagement scraper delivers exactly what you need. One flat row per post with every Facebook engagement metric Facebook exposes publicly. Perfect for Facebook engagement dashboards, content performance tracking, and Facebook engagement benchmarking.

### ⚙️ How This Facebook Engagement Scraper Works

1️⃣ **Provide input** — enter Facebook usernames, profile/page URLs, or direct post, video, photo, or share URLs.
2️⃣ **Post resolution** — the Facebook engagement scraper resolves each target into direct posts or profile timeline posts.
3️⃣ **Facebook engagement extraction** — reaction count, comment count, share count, video views, content type, thumbnail preview, and top reaction types are parsed.
4️⃣ **Rate calculation** — a Facebook engagement rate is calculated as (reactions + comments + shares) / views × 100 for video posts.
5️⃣ **Flat output** — one row per post with clean, focused engagement metrics.
6️⃣ **Billing** — you are charged per Facebook engagement row, and the run stops at your budget cap.

### 📦 What Facebook Engagement Data Does This Actor Extract?

For each post, this Facebook engagement scraper returns:

- ✅ **Facebook engagement reaction count** — total reactions (exact integer)
- ✅ **Facebook engagement comment count** — total comments (exact integer)
- ✅ **Facebook engagement share count** — total shares (exact integer)
- ✅ **Facebook engagement video views** — view count for video posts
- ✅ **Facebook engagement rate (%)** — (reactions + comments + shares) / views × 100
- ✅ **Total Facebook engagement** — combined reactions + comments + shares
- ✅ **Content metadata** — content type (`photo`, `video`, `reel`, `text`), thumbnail URL, text snippet, post ID, permalink, creation time, and author profile details

### ⚙️ Input Configuration

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `username` | String\[] | `["Cristiano"]` | Optional list of Facebook usernames (e.g. `Cristiano`, `IamSRK`, `nike`) |
| `facebook_urls` | URL\[] | — | Direct Facebook post, video, photo, or share URLs, or public profile/page URLs |
| `posts_count` | Integer | `10` | Number of timeline posts to request per profile/page input |
| `proxyCountry` | String | `"US"` | Country location for Apify Residential proxy exit nodes (`US`, `GB`, `CA`, `DE`, `FR`, `AU`, `BR`, `IN`, `JP`, `MX`) |

You can mix usernames, profile URLs, and direct post URLs. Duplicates are skipped automatically.

### 📊 Output Dataset — Facebook Engagement Fields

Each row is one post's Facebook engagement summary:

| Field | Type | Description |
|-------|------|-------------|
| `type` | string | Always `engagement_row` |
| `number` | integer | Sequential row number |
| `source_post_url` | string | Original input URL or post permalink |
| `post_id` | string | Post identifier |
| `permalink_url` | string | Canonical post URL |
| `created_at` | string | Post creation timestamp |
| `content_type` | string | Primary content format (`photo`, `video`, `reel`, `text`) |
| `text` | string | Post caption or message snippet |
| `profile_name` | string | Post author name |
| `profile_id` | string | Post author ID |
| `profile_url` | string | Post author profile URL |
| `profile_is_verified` | boolean | Author verification status |
| `thumbnail_url` | string | Direct image or video preview thumbnail URL |
| `reaction_count_total` | integer | Total Facebook engagement reactions |
| `comment_count_total` | integer | Total Facebook engagement comments |
| `share_count_total` | integer | Total Facebook engagement shares |
| `video_view_count_total` | integer | Facebook engagement video views |
| `total_engagement` | integer | Combined Facebook engagement (reactions + comments + shares) |
| `engagement_rate_pct` | number | Facebook engagement rate = total / views × 100 |
| `top_reaction_types` | array | Top Facebook engagement reaction type names (e.g. `["LIKE", "LOVE"]`) |
| `has_video` | boolean | Whether the post contains video |
| `attachment_types` | array | Post attachment types |

### 📋 Sample Output

```json
{
  "type": "engagement_row",
  "number": 1,
  "source_post_url": "https://www.facebook.com/Cristiano/posts/pfbid0...",
  "post_id": "pfbid0...",
  "permalink_url": "https://www.facebook.com/Cristiano/posts/pfbid0...",
  "created_at": "2025-12-15T10:00:00+0000",
  "content_type": "photo",
  "text": "Great match today! Thank you for the support.",
  "profile_name": "Cristiano Ronaldo",
  "profile_id": "1034530909912481",
  "profile_url": "https://www.facebook.com/Cristiano",
  "profile_is_verified": true,
  "thumbnail_url": "https://scontent.fbea1-1.fna.fbcdn.net/...",
  "reaction_count_total": 850000,
  "comment_count_total": 12000,
  "share_count_total": 5000,
  "video_view_count_total": 15000000,
  "total_engagement": 867000,
  "engagement_rate_pct": 5.78,
  "top_reaction_types": ["LIKE", "LOVE"],
  "has_video": false,
  "attachment_types": ["photo"]
}
```

### 💲 Facebook Engagement Pricing

Pay-Per-Event: **$0.001 per Facebook engagement row** (~$1 per 1,000 posts).

Set a **Maximum Cost Per Run** to cap spending. The actor stops gracefully at the budget limit.

# Actor input Schema

## `username` (type: `array`):

Enter one or more Facebook usernames such as Cristiano, IamSRK, or nike. Each username is automatically converted into a profile or page URL.

## `facebook_urls` (type: `array`):

One or more direct Facebook post, video, photo, or share URLs, or public profile/page URLs (e.g. https://www.facebook.com/Cristiano).

## `posts_count` (type: `integer`):

How many timeline posts to request from each profile or page. The actor keeps paginating until this limit is reached or Facebook exposes no more public posts.

## `proxyCountry` (type: `string`):

Select country location for Apify Residential proxy exit nodes.

## Actor input object example

```json
{
  "username": [
    "Cristiano"
  ],
  "facebook_urls": [
    {
      "url": "https://www.facebook.com/Cristiano/posts/pfbid0Dp9Wrmv1NAkFX1nSkKwLEKftjMSHbDYNBZE7L43y8JnTs77USeJ7cpC5FoGgm3inl"
    }
  ],
  "posts_count": 10,
  "proxyCountry": "US"
}
```

# 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 = {
    "username": [
        "Cristiano"
    ],
    "facebook_urls": [
        {
            "url": "https://www.facebook.com/Cristiano/posts/pfbid0Dp9Wrmv1NAkFX1nSkKwLEKftjMSHbDYNBZE7L43y8JnTs77USeJ7cpC5FoGgm3inl"
        }
    ],
    "posts_count": 10,
    "proxyCountry": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("premiumscraper/facebook-post-engagement-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 = {
    "username": ["Cristiano"],
    "facebook_urls": [{ "url": "https://www.facebook.com/Cristiano/posts/pfbid0Dp9Wrmv1NAkFX1nSkKwLEKftjMSHbDYNBZE7L43y8JnTs77USeJ7cpC5FoGgm3inl" }],
    "posts_count": 10,
    "proxyCountry": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("premiumscraper/facebook-post-engagement-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "username": [
    "Cristiano"
  ],
  "facebook_urls": [
    {
      "url": "https://www.facebook.com/Cristiano/posts/pfbid0Dp9Wrmv1NAkFX1nSkKwLEKftjMSHbDYNBZE7L43y8JnTs77USeJ7cpC5FoGgm3inl"
    }
  ],
  "posts_count": 10,
  "proxyCountry": "US"
}' |
apify call premiumscraper/facebook-post-engagement-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=premiumscraper/facebook-post-engagement-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/IlwJZFDFWFrNiHgCh/builds/B6ZuTKR8sehJHqTGW/openapi.json
