# Facebook Followers Following Scraper (`automation-lab/facebook-followers-following-scraper`) Actor

Export public Facebook follower and following identities with names, profile URLs, IDs, images, and relationship metadata from sections visible without login.

- **URL**: https://apify.com/automation-lab/facebook-followers-following-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 60.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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/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 Followers Following Scraper

Export the follower and following identities that a Facebook Page or profile exposes publicly without login. The Actor turns the visible relationship cards into structured records with profile names, Facebook URLs, IDs, image URLs, source context, and relationship type.

Use it to refresh public audience samples, compare overlap between Pages, prepare spreadsheet exports, or feed a repeatable community-research pipeline. It does **not** log in, bypass privacy settings, or claim access to a complete private follower list.

### What does Facebook Followers Following Scraper do?

Give the Actor one or more Facebook Page or profile URLs. It visits the requested public `followers` and/or `following` section in a resource-efficient browser, validates visible relationship cards, removes duplicates, and writes accepted records to the default Apify dataset.

The Actor:

- accepts Page/profile URLs and direct `/followers` or `/following` URLs;
- supports followers, following, or both relationship types;
- uses sticky Apify datacenter browser sessions with bounded rotation;
- retries login-only/challenged responses with a fresh bounded session;
- stops at your global `maxItems` limit;
- charges only for records actually saved;
- fails clearly when no requested source exposes useful public identities.

### Who is this Facebook audience exporter for?

- **Audience researchers** comparing the publicly displayed communities around several Pages.
- **Creator and partnership teams** collecting a small public sample for manual qualification.
- **Analysts** refreshing source-attributed relationship rows for overlap analysis.
- **Automation builders** loading typed Facebook relationship data into Sheets, a warehouse, or a CRM review queue.
- **Trust and safety researchers** studying only information that Facebook displays while logged out.

This Actor is designed for source-specific public audience research. It is not a Facebook Dating scraper, Facebook Ad Library scraper, contact extractor, or account-growth tool.

### Why use this Actor?

Facebook's public relationship pages are dynamic and may return a login screen to an ordinary request. This Actor packages the working browser, datacenter proxy, session rotation, validation, deduplication, output schema, and Apify integrations into one repeatable task.

Unlike a follower-count scraper, it returns the visible **profile identities**, not only an aggregate count. Every row retains its source and relationship type so multi-Page exports remain analysis-ready.

### What Facebook follower data can I extract?

| Field | Meaning |
| --- | --- |
| `sourceUrl` | Canonical Page/profile URL inspected |
| `sourceName` | Public source display name, when available |
| `sourceProfileId` | Numeric source ID exposed by public metadata, when available |
| `relationshipType` | `followers` or `following` |
| `profileName` | Public name shown on the relationship card |
| `profileUrl` | Canonical public URL of the related profile/Page |
| `profileId` | Numeric ID parsed from the public URL, when available |
| `username` | Vanity username parsed from the URL, when available |
| `profileImageUrl` | Public image URL shown on the card; CDN URLs can expire |
| `subtitle` | Public card subtitle when Facebook supplies one |
| `scrapedAt` | ISO timestamp of extraction |

Fields are nullable where Facebook does not expose a value.

### How to export public Facebook followers

1. Create or sign in to your Apify account.
2. Open **Facebook Followers Following Scraper**.
3. Add one or more public Facebook Page/profile URLs.
4. Choose `followers`, `following`, or `both`.
5. Set the maximum number of records.
6. Click **Start**.
7. Open the Dataset tab and download JSON, CSV, Excel, XML, or another supported format.

The prefilled Leonardo DiCaprio followers URL is a real public source that currently yields useful rows while logged out.

### Input parameters

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `startUrls` | array | required | Public `facebook.com` Page/profile URLs. A direct relationship URL overrides the general relationship setting for that URL. |
| `relationshipType` | string | `both` | Inspect `followers`, `following`, or both. |
| `maxItems` | integer | `100` | Global accepted-record limit, from 1 to 10,000. |
| `maxSessionRetries` | integer | `3` | Fresh sticky datacenter sessions allowed for a login-only/challenged page, from 1 to 3. |

Example input:

```json
{
  "startUrls": [
    { "url": "https://www.facebook.com/NASA/followers" },
    { "url": "https://www.facebook.com/BarackObama/followers" }
  ],
  "relationshipType": "followers",
  "maxItems": 16,
  "maxSessionRetries": 3
}
```

### Output example

A real run produces records with this shape (personal values below are anonymized):

```json
{
  "sourceUrl": "https://www.facebook.com/samplepage",
  "sourceName": "Sample Public Page",
  "sourceProfileId": "100012345678901",
  "relationshipType": "followers",
  "profileName": "Example Profile",
  "profileUrl": "https://www.facebook.com/people/Example-Profile/61500000000001",
  "profileId": "61500000000001",
  "username": null,
  "profileImageUrl": "https://scontent.example.fbcdn.net/example-profile.jpg",
  "subtitle": null,
  "scrapedAt": "2025-01-15T12:00:00.000Z"
}
```

Results are stored in the run's default dataset, so normal Apify exports and integrations work without a custom dataset name.

### How much does it cost to export Facebook followers?

The Actor uses pay-per-event pricing:

- a **$0.005 Actor start** event once per run;
- one **public relationship record** event per accepted dataset row.

At the Bronze tier, each accepted row is **$0.00368**. Approximate Bronze totals are:

| Accepted rows | Approximate total |
| ---: | ---: |
| 1 | $0.00868 |
| 10 | $0.04180 |
| 25 | $0.09700 |
| 100 | $0.37300 |

Your actual tier may have a lower item price. Failed, duplicate, rejected, and empty cards are not charged as item events. Facebook often exposes only a small public subset per section, so a 100-row run generally requires several sources rather than one Page.

### Public visibility and list-size limits

Facebook decides whether a followers/following section is public and how many identities it displays to a logged-out visitor. The number of displayed profiles can be much smaller than the aggregate follower count.

The Actor cannot:

- reveal private or login-only identities;
- guarantee that both sections exist;
- turn an aggregate follower count into a full identity list;
- bypass a Facebook checkpoint or privacy control;
- preserve an expiring Facebook CDN image URL indefinitely.

When one requested section is unavailable but another yields rows, the run keeps the useful rows. When every requested source yields zero identities after bounded retries, the run fails instead of returning a misleading successful empty dataset.

### Tips for reliable runs

- Start with a URL that you can open in a private/incognito window without signing in.
- Use a direct `/followers` URL when you only need followers; this avoids checking an unavailable following section.
- Use several source URLs for overlap work because one public section commonly exposes only a sample.
- Schedule moderate refresh intervals; repeated rapid runs do not make Facebook expose more public identities.
- Store downloaded images yourself if your lawful workflow needs them later; source CDN links can expire.

### Refresh and compare public audience lists

Create an Apify Schedule for a weekly or monthly run. Export each dataset with its `scrapedAt`, `sourceUrl`, `relationshipType`, and `profileUrl` fields. In your warehouse or spreadsheet:

1. use `sourceUrl + relationshipType + profileUrl` as a stable comparison key;
2. compare the newest snapshot with the prior snapshot;
3. label newly visible and no-longer-visible public rows;
4. distinguish source visibility changes from definitive follow/unfollow events.

Because Facebook shows only a public sample, describe changes as changes in the **visible sample**, not proof of a person's private activity.

### Export to Google Sheets or a data pipeline

From the Dataset tab, download CSV/Excel directly or attach an Apify integration. Common workflows include:

- append public relationship rows to Google Sheets;
- send a webhook after each scheduled run;
- load JSON into BigQuery, Snowflake, or a custom warehouse;
- trigger Make or Zapier only after a successful run;
- join profiles from two sources by `profileUrl` for overlap analysis.

Apply your own retention, access-control, and deletion policies downstream.

### Run with the Apify API using cURL

Replace `YOUR_TOKEN` with your Apify API token:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~facebook-followers-following-scraper/runs?token=YOUR_TOKEN&waitForFinish=300" \
  -H "Content-Type: application/json" \
  -d '{
    "startUrls": [{"url":"https://www.facebook.com/LeonardoDiCaprio/followers"}],
    "relationshipType":"followers",
    "maxItems":5
  }'
```

Fetch items from the `defaultDatasetId` returned by the run.

### Run with JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/facebook-followers-following-scraper').call({
  startUrls: [{ url: 'https://www.facebook.com/NASA/followers' }],
  relationshipType: 'followers',
  maxItems: 8,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Run with Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("automation-lab/facebook-followers-following-scraper").call(
    run_input={
        "startUrls": [{"url": "https://www.facebook.com/BarackObama/followers"}],
        "relationshipType": "followers",
        "maxItems": 8,
    }
)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

### Use with Apify MCP

Add the Actor to Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/facebook-followers-following-scraper"
```

#### Claude Desktop, Cursor, and VS Code MCP setup

Use this same configuration in **Claude Desktop**, **Cursor**, or **VS Code** where HTTP MCP servers are supported:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/facebook-followers-following-scraper"
    }
  }
}
```

Example prompts:

- "Export up to 8 publicly displayed followers from NASA's Facebook Page."
- "Run the public Facebook followers exporter for NASA and Barack Obama, then group rows by source URL."
- "Schedule this input monthly and summarize changes in the visible public sample."

### Responsible use and legality

The Actor collects only relationship cards Facebook presents to a logged-out visitor. Public availability does not remove your legal obligations.

Use the data only with a lawful purpose. Consider privacy, data-protection, database-right, contractual, and anti-discrimination rules that apply to your location and use case. Minimize collection, avoid sensitive profiling, respect deletion requests, secure exports, and retain records only as long as needed. Do not use this Actor for harassment, surveillance, spam, or decisions that unfairly affect individuals.

When in doubt, obtain qualified legal advice for your workflow.

### Troubleshooting

#### Why did the run say no public identities were extracted?

Open the same `/followers` or `/following` URL in an incognito browser. The section may be hidden, login-only, temporarily challenged, or may display only a count. Try a known public section such as the prefilled followers URL. The Actor retries challenged sessions but does not bypass privacy controls.

#### Why are there only eight records for a Page with millions of followers?

The aggregate count and the public identity sample are different surfaces. Facebook commonly displays only a small logged-out sample. `maxItems` is a ceiling, not a promise that the source exposes that many identities.

#### Why is `username` or `subtitle` null?

Many Facebook profile links use a numeric `/people/.../<id>` route rather than a vanity username, and current public cards often contain no subtitle. The numeric `profileId` and canonical `profileUrl` remain available when exposed.

#### Why did a profile image stop loading?

Facebook CDN URLs are temporary. Download images promptly when your lawful workflow requires durable media storage.

### Frequently asked questions

#### Does this Actor need Facebook credentials?

No. It intentionally supports only sections visible while logged out and does not accept account credentials or cookies.

#### Can it scrape both followers and following?

Yes, when Facebook publicly exposes both sections. A direct relationship URL requests only that section. If a section is not public, the Actor reports the limitation and keeps useful rows from other requested sections.

#### Does it return follower counts?

The primary output is one visible relationship identity per row. The Actor does not market aggregate counts as identity records.

#### Can I monitor changes?

Yes. Use Apify Schedules to create repeat snapshots and compare public sample keys downstream. Do not interpret sample visibility changes as definitive private follow/unfollow behavior.

#### Can I export CSV or Excel?

Yes. Use the standard download options on the run's default dataset.

### Related automation-lab Actors

Combine this public audience sample with:

- [Facebook Pages Posts Scraper](https://apify.com/automation-lab/facebook-pages-posts-scraper) for Page content workflows.
- [Facebook Page Contact Info Scraper](https://apify.com/automation-lab/facebook-page-contact-info-scraper) for publicly displayed Page contact details.
- [Facebook Pages Scraper](https://apify.com/automation-lab/facebook-pages-scraper) for Page-level metadata and counts.

Each Actor has a separate input/output and pricing contract. Use only the minimum public data needed for your workflow.

# Actor input Schema

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

One or more public facebook.com Page/profile URLs. A URL ending in /followers or /following overrides Relationship type for that URL.

## `relationshipType` (type: `string`):

Choose which publicly exposed relationship sections to inspect. Facebook may expose only one section for a given source.

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

Maximum number of unique relationship records saved across all source URLs.

## `maxSessionRetries` (type: `integer`):

Number of fresh sticky datacenter browser sessions allowed when Facebook returns a login-only or challenged page.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.facebook.com/LeonardoDiCaprio/followers"
    },
    {
      "url": "https://www.facebook.com/NASA/followers"
    }
  ],
  "relationshipType": "followers",
  "maxItems": 20,
  "maxSessionRetries": 3
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing all extracted public relationship records.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.facebook.com/LeonardoDiCaprio/followers"
        },
        {
            "url": "https://www.facebook.com/NASA/followers"
        }
    ],
    "relationshipType": "followers",
    "maxItems": 20,
    "maxSessionRetries": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/facebook-followers-following-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 = {
    "startUrls": [
        { "url": "https://www.facebook.com/LeonardoDiCaprio/followers" },
        { "url": "https://www.facebook.com/NASA/followers" },
    ],
    "relationshipType": "followers",
    "maxItems": 20,
    "maxSessionRetries": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/facebook-followers-following-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 '{
  "startUrls": [
    {
      "url": "https://www.facebook.com/LeonardoDiCaprio/followers"
    },
    {
      "url": "https://www.facebook.com/NASA/followers"
    }
  ],
  "relationshipType": "followers",
  "maxItems": 20,
  "maxSessionRetries": 3
}' |
apify call automation-lab/facebook-followers-following-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/facebook-followers-following-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/PW0v05kyRWSUSfpjH/builds/zRMO8s6cCAPizA4jz/openapi.json
