# Facebook Profile Scraper (Private & Public) (`igolaizola/facebook-profile-scraper`) Actor

Facebook scraper for profile posts, comments, media, links, engagement totals, and date-filtered monitoring. Run anonymously for public content or use authorized cookies for account-visible posts. Export JSON, CSV, Excel, API, or MCP-ready data for research and monitoring.

- **URL**: https://apify.com/igolaizola/facebook-profile-scraper.md
- **Developed by:** [Iñigo Garcia Olaizola](https://apify.com/igolaizola) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 3,468 total users, 94 monthly users, 100.0% runs succeeded, 12 bookmarks
- **User rating**: 3.00 out of 5 stars

## Pricing

from $15.00 / monthly usage access

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Profile Scraper — Public Posts, Comments & Media

Scrape Facebook profile posts for social listening, content monitoring, competitor research, and historical archives. Download structured post data with authors, dates, text, media, links, engagement totals, and optional comments.

### 🤖 What does Facebook Profile Scraper do?

The **Facebook Profile Scraper** collects posts from public Facebook profiles and from profiles your authorized account can view. Each result includes the post details and the engagement totals shown to that visitor.

It supports:

- **Profile timelines** — collect posts from one or more profile URLs.
- **Comments** — include visible comments with authors, dates, and text.
- **Date ranges** — focus on a period or divide a historical collection into smaller runs.
- **Media and links** — keep image, video, and link references attached to each post.
- **Anonymous or authenticated access** — choose the mode that matches the content you are allowed to view.

**Great for:** social listening, competitor monitoring, campaign research, content archives, and academic research.

> SEO keywords: **Facebook scraper**, **Facebook profile scraper**, **scrape Facebook posts**, **Facebook comments scraper**, **Facebook API alternative**, **Apify Actor**.

### 💡 Why scrape Facebook?

- 📈 **Monitor publishing activity** — follow new posts from brands, pages, creators, or public figures.
- 💬 **Understand conversations** — collect visible comments for research and reporting.
- 🔎 **Compare competitors** — review posting frequency, formats, links, and engagement totals.
- 🗂️ **Build an archive** — preserve public post information for later analysis.

### 🧠 Scraping modes

#### Anonymous mode

Leave `cookies` empty to collect content Facebook shows to logged-out visitors. This is the simplest choice for public profiles and quick tests, and it does not require a Facebook login.

#### Authenticated mode

Provide cookies from a Facebook account you control when you need content visible only to that account. The actor uses the account’s existing permissions and does not bypass Facebook privacy settings.

To provide a session:

1. Log in to Facebook in your browser.
2. Export the cookies with a trusted cookie-export tool such as [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm).
3. Paste the complete exported cookie array into the `cookies` input.

> 🔐 **Security note:** Cookies can grant access to your account. Never share them publicly, and only use a session you are authorized to use. The actor does not need your Facebook password.

Authenticated runs use a more careful request pace. If Facebook rejects the session, the run stops so you can refresh the session instead of repeatedly retrying it.

### 🚀 Quick start

1. **Open the actor** — Add **Facebook Profile Scraper** to your Apify account.
2. **Add profile URLs** — Enter one or more URLs such as `https://www.facebook.com/zuck`.
3. **Choose access** — Leave `cookies` empty for public content, or add cookies from your authorized account.
4. **Set limits** — Choose `maxItems`, `maxComments`, and an optional date range.
5. **Choose comments** — Set `comments` to `true` when conversation data is needed.
6. **Run and export** — Start the run and download JSON, CSV, or another dataset format.

### 💳 Pricing

Apify’s **Free plan** includes monthly credits for small tests. Larger histories, many profiles, and comment-heavy runs require enough runtime and proxy capacity for the workload.

### 📝 Input parameters

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `urls` | Array of strings | Yes | Facebook profile URLs. Supports profile names and numeric `profile.php?id=...` URLs. |
| `maxItems` | Integer | No | Maximum number of posts across the run. Default: `10`; `0` means no configured post limit. |
| `maxComments` | Integer | No | Maximum comments per post when `comments` is enabled. Default: `10`; `0` means no configured comment limit. |
| `startDate` | String | No | Newer boundary of the inclusive date range, in `YYYY-MM-DD` format. |
| `endDate` | String | No | Older boundary of the inclusive date range, in `YYYY-MM-DD` format. |
| `comments` | Boolean | No | Include visible comments in each post. Default: `false`. |
| `cookies` | Array | No | Complete cookie export for authenticated mode. Leave empty for anonymous mode. |
| `waitTime` | Integer | No | Seconds between requests for authenticated runs. Default: `2`; `0` also uses the 2-second default. Anonymous runs ignore this setting. |
| `proxyConfiguration` | Object | No | Apify Proxy settings. Residential proxies are recommended for reliable public-profile runs and larger workloads. |

#### Example inputs

**Anonymous public-profile collection**

```json
{
  "urls": [
    "https://www.facebook.com/zuck",
    "https://www.facebook.com/facebook"
  ],
  "maxItems": 100,
  "maxComments": 50,
  "comments": true,
  "startDate": "2026-01-01",
  "endDate": "2025-01-01",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

**Authenticated collection**

```json
{
  "urls": ["https://www.facebook.com/example.profile"],
  "cookies": [
    {
      "domain": ".facebook.com",
      "name": "c_user",
      "value": "REPLACE_WITH_EXPORTED_VALUE",
      "path": "/",
      "secure": true
    },
    {
      "domain": ".facebook.com",
      "name": "xs",
      "value": "REPLACE_WITH_EXPORTED_VALUE",
      "path": "/",
      "secure": true
    }
  ],
  "maxItems": 50,
  "maxComments": 25,
  "comments": true,
  "waitTime": 3
}
```

Replace the cookie values with the complete export from your authorized session.

### 📊 Output and results

Each dataset item represents one Facebook post. The `comments` array is included only when `comments` is enabled and Facebook makes comments visible. Optional fields are omitted when Facebook does not provide them.

**Field reference:**

- **`id`** *(string)* — Unique post ID.
- **`attached_id`** *(string)* — Related or attached post ID, when present.
- **`profile_url`**, **`profile_name`** *(string)* — Profile being scraped.
- **`pinned`** *(boolean)* — Whether the post is pinned.
- **`created_at`** *(date)* — Publication date and time.
- **`permalink`** *(string)* — Direct Facebook URL for the post.
- **`author`** *(object)* — Author ID, name, profile URL, and image.
- **`message`** *(string)* — Post text.
- **`comment_count`**, **`reaction_count`**, **`share_count`** *(number)* — Engagement totals shown by Facebook.
- **`comments`** *(array)* — Visible comments with ID, date, author, and message.
- **`images`** *(array)* — Attached image IDs, URLs, and permalinks.
- **`videos`** *(array)* — Attached video IDs, URLs, thumbnails, and permalinks.
- **`links`** *(array)* — Links found in the post.
- **`location`** *(object)* — Location information when available.

#### Example result

```json
{
  "id": "1627099462795401",
  "profile_url": "https://www.facebook.com/facebook",
  "profile_name": "Facebook",
  "pinned": false,
  "created_at": "2026-08-28T13:20:58Z",
  "permalink": "https://www.facebook.com/facebook/posts/1627099462795401",
  "author": {
    "id": "20531316728",
    "name": "Facebook",
    "url": "https://www.facebook.com/facebook",
    "image": "https://scontent.example/facebook.jpg"
  },
  "message": "Building communities together.",
  "comment_count": 2950,
  "reaction_count": 21640,
  "share_count": 96,
  "comments": [
    {
      "id": "28258528367119103",
      "parent_id": "",
      "created_at": "2026-08-30T15:14:11Z",
      "author": {
        "id": "100002327993075",
        "name": "Jiali Yang",
        "url": "https://www.facebook.com/jiali.yang.10",
        "image": "https://scontent.example/jiali.jpg"
      },
      "message": "This is a great reminder."
    }
  ],
  "images": [
    {
      "id": "image-123456",
      "url": "https://scontent.example/community.jpg",
      "permalink": "https://www.facebook.com/photo.php?fbid=123456"
    }
  ],
  "links": ["https://www.facebook.com/community"]
}
```

### 🧭 Tips for better results

- **Collect more discussion:** enable `comments` and raise `maxComments` to the number needed per post.
- **Scrape a large history:** split the period with `startDate` and `endDate` across multiple runs.
- **Keep runs focused:** set `maxItems` to the number of posts you actually need.
- **Run multiple profiles:** add all profile URLs to `urls`; `maxItems` applies across the run.
- **Start simply:** begin anonymously with comments disabled, then add depth only when needed.

### ⚙️ Best practices

- Start anonymously for public content. Use authenticated mode only when your account is authorized to view the profile.
- Treat exported cookies like account access and store them securely.
- Keep the default `waitTime` or increase it for long authenticated runs.
- If an authenticated run stops after Facebook rejects the session, refresh the cookies before trying again.
- A `maxComments` value of `0` removes the configured cap, but Facebook may still limit what it makes visible.

### 🌍 Proxy usage

The input is prefilled with **Apify Residential Proxy**, which is recommended for public-profile runs and larger collections. Keep proxy use enabled when scraping many profiles or when the same run needs a stable connection.

### ⚖️ Legal and ethical considerations

- Respect [Facebook’s Terms of Service](https://www.facebook.com/terms.php) and applicable laws.
- Use authenticated cookies only from an account you own or are authorized to use.
- Handle personal data responsibly and follow privacy obligations such as GDPR and CCPA.
- Avoid excessive collection, respect access restrictions, and use reasonable limits.
- Do not republish personal information or content without the appropriate permission and legal basis.

This Actor is an independent tool and is **not** affiliated with, endorsed by, or sponsored by Meta Platforms, Inc. Facebook is a trademark of Meta Platforms, Inc.

### ❓ FAQ

**Do I need Facebook cookies?**

No. Anonymous mode works for content Facebook shows to logged-out visitors. Add cookies only when you need content visible to your authorized account.

**Can this access a private profile?**

Only when the supplied account is already allowed to view it. The actor does not bypass Facebook privacy settings.

**How do I collect more comments?**

Set `comments` to `true` and increase `maxComments`. The number returned can still vary with visibility, region, and Facebook’s own limits.

**Why did I receive fewer posts than expected?**

Facebook controls what is visible to each visitor. Check the profile URL, date range, `maxItems`, account permissions, and proxy location.

**What does `waitTime` do?**

It controls the pause between requests for authenticated runs. `0` uses the safe 2-second default. Anonymous runs ignore it.

**What profile URLs are supported?**

Use URLs such as `https://www.facebook.com/zuck` or `https://www.facebook.com/profile.php?id=123456789`.

### 🛟 Support

Need a custom field, filter, or export?

Open an issue or contact [the developer](https://igolaizola.com/#contact) with an example of the Facebook data you need.

# Actor input Schema

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

URLs to scrape

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

Maximum number of posts to scrape

## `maxComments` (type: `integer`):

Maximum number of comments per post (0 = no limit)

## `startDate` (type: `string`):

Newest date of posts to scrape (format: YYYY-MM-DD)

## `endDate` (type: `string`):

Oldest date of posts to scrape (format: YYYY-MM-DD)

## `comments` (type: `boolean`):

Scrape comments (this will significantly increase the runtime)

## `cookies` (type: `array`):

Cookies from Export JSON in Cookie-Editor extension

## `waitTime` (type: `integer`):

Seconds to wait between requests when cookies are provided (0 = default: 2)

## `proxyConfiguration` (type: `object`):

Select proxies to be used.

## Actor input object example

```json
{
  "urls": [
    "https://www.facebook.com/zuck"
  ],
  "maxItems": 10,
  "maxComments": 10,
  "comments": false,
  "waitTime": 2,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://www.facebook.com/zuck"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("igolaizola/facebook-profile-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 = {
    "urls": ["https://www.facebook.com/zuck"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("igolaizola/facebook-profile-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 '{
  "urls": [
    "https://www.facebook.com/zuck"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call igolaizola/facebook-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,igolaizola/facebook-profile-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/8GTnAzYpd8JQW1zoj/builds/1FlRinJbhkTiG8qzs/openapi.json
