# Facebook Followers & Following Scraper (`coregent/facebook-followers-following-scraper`) Actor

Extract public Facebook followers and following from Pages and profiles: names, usernames, profile URLs, images, verification, source counts and honest list-coverage status. Counts-only mode with change tracking. No login or cookies.

- **URL**: https://apify.com/coregent/facebook-followers-following-scraper.md
- **Developed by:** [Delowar Munna](https://apify.com/coregent) (community)
- **Categories:** Social media, Lead generation, Marketing
- **Features:** Limited permissions
- **Stats:** 31 total users, 11 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 relationship results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Followers & Following Scraper — Public Lists, Counts & Coverage

![Facebook Followers & Following Scraper](https://raw.githubusercontent.com/coregentdevspace/facebook-followers-following-scraper-assets/main/thumbnail-facebook-followers-following-scraper.png)

**Get the public followers and following lists of Facebook Pages and profiles as clean rows**, one per relationship, with names, usernames, profile URLs, images, verification badges and, when Facebook shows one, a subtitle, plus the source's follower and following counts. Every list also reports how complete it is.

- 👥 **Followers and following in one run**: one row per relationship (`FOLLOWER` / `FOLLOWING`)
- 🔓 **No Facebook login, cookies, account or token**
- 📄 **Pages and public profiles**, given as URLs, usernames, numeric IDs, `profile.php?id=` links or direct `/followers` / `/following` links
- 🔎 **Search within a list by name**, run by Facebook itself, so it reaches matches deep in a large list
- 🔢 **Exact vs abbreviated counts**: `28,735,511` is marked `EXACT`, `28M` is marked `ABBREVIATED` and is never treated as exact
- 📊 **Honest coverage**: every list gets a free status row saying `FULL`, `LIMITED`, `PARTIAL`, `PREVIEW_ONLY` or `PRIVATE`
- 📈 **Counts-only mode with change tracking**: schedule it daily or weekly to follow audience growth
- 💸 **You pay for rows delivered**, plus one small session charge per list read through Apify Residential proxy. Status rows, pagination, retries, duplicates and private lists are free.

***

### ⚠️ Read this first: Facebook shows only part of a big audience

To a logged-out visitor, Facebook exposes a **subset** of a large follower list. It is not the whole audience. For example, measured on 2026-11-01:

| Source                 | Followers shown on the Page | Followers Facebook exposes as a list |
| ---------------------- | --------------------------: | -----------------------------------: |
| NASA                   |                  28,735,511 |                               ~1,358 |
| Mark Zuckerberg        |                 121,454,746 |                               10,000 |
| National Geographic    |                  51,440,528 |                                 ~549 |
| A small local business |                          14 |                                    4 |

Within that exposed list, this Actor pages all the way to Facebook's own end of the list. It does not stop at the first 8 rows. It **never claims to return a complete follower graph**: when Facebook ends the list well short of the count on the Page, the list is marked `LIMITED`. Following lists are usually short, and they are often returned in full (NASA follows 52 accounts, and all 52 come back, marked `FULL`).

***

### Quick start

```json
{
    "startUrls": ["https://www.facebook.com/NASA"],
    "lists": ["FOLLOWERS"],
    "maxFollowers": 100
}
```

That is all that is required. Leave the proxy at its default (Apify Residential, which full lists need). Run with the form's defaults and you get NASA's first 25 followers and first 25 accounts it follows: 50 relationship rows plus 2 free status rows.

#### More examples

**A deep follower list** (this input produced the sample output below: 1,000 followers over 125 pages, about 5 minutes):

```json
{
    "startUrls": ["https://www.facebook.com/NASA"],
    "lists": ["FOLLOWERS"],
    "maxFollowers": 1000
}
```

**Followers and following of several sources:**

```json
{
    "startUrls": ["NASA", "natgeo", "https://www.facebook.com/profile.php?id=100044561550831"],
    "lists": ["FOLLOWERS", "FOLLOWING"],
    "maxFollowers": 250,
    "maxFollowing": 250,
    "includeSourceCounts": true
}
```

**Search within a follower list:**

```json
{
    "startUrls": ["https://www.facebook.com/NASA"],
    "lists": ["FOLLOWERS"],
    "searchByName": "john"
}
```

**Counts only:**

```json
{
    "startUrls": ["NASA", "natgeo", "zuck"],
    "mode": "COUNTS"
}
```

**Track counts over time** (schedule it daily or weekly):

```json
{
    "startUrls": ["NASA", "natgeo"],
    "mode": "COUNTS",
    "monitorCounts": true,
    "trackerKey": "competitor-pages"
}
```

***

### Input

| Field                                                           | What it does                                                                                                                                       |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `startUrls`                                                     | Pages / profiles: URL, username, numeric ID, `profile.php?id=`, or a `/followers` / `/following` URL (a list URL reads only that list). Up to 500. |
| `mode`                                                          | `RELATIONSHIPS` (default) or `COUNTS`                                                                                                              |
| `lists`                                                         | `FOLLOWERS`, `FOLLOWING` or both (default both)                                                                                                    |
| `maxFollowers` / `maxFollowing`                                 | Most rows per source for each list (default 100, max 10,000)                                                                                       |
| `searchByName`                                                  | Only list entries whose name matches, e.g. `john`                                                                                                  |
| `includeSourceCounts`                                           | Source follower / following counts on every row (default on)                                                                                       |
| `includeProfileImage`, `includeSubtitle`, `includeVerification` | Include those target fields (default on)                                                                                                           |
| `parseSubtitle`                                                 | Fill `targetLocation` / `targetWorkplace` / `targetSchool` from the subtitle when it says what it is (default on)                                  |
| `deduplicate`                                                   | Two inputs that are the same account are read and charged once (default on)                                                                        |
| `monitorCounts`, `trackerKey`                                   | COUNTS mode: return the change since the last run under that tracker name                                                                          |
| `maxConcurrency`                                                | Sources read in parallel (default 3)                                                                                                               |
| `proxyConfiguration`                                            | Apify Residential (default, needed for lists past 8 rows), Apify Datacenter, no proxy, or your own proxy URLs                                      |

***

### Output

#### Relationships table

![Relationships table view](https://raw.githubusercontent.com/coregentdevspace/facebook-followers-following-scraper-assets/main/facebook-followers-following-scraper-output-relationships-table-view.png)

#### Relationship row (charged)

One row per follower / followed account. `rank` is the position in Facebook's list. It is **Facebook's display order, not when the follow happened or how important the account is.** A real row from the 1,000-follower NASA run above:

```json
{
    "rowType": "RELATIONSHIP",
    "relationshipType": "FOLLOWER",
    "rank": 8,
    "sourceInput": "https://www.facebook.com/NASA",
    "inputIndex": 0,
    "sourceId": "100044561550831",
    "sourcePageId": "54971236771",
    "sourceHandle": "NASA",
    "sourceName": "NASA - National Aeronautics and Space Administration",
    "sourceUrl": "https://www.facebook.com/NASA",
    "sourceType": "PAGE",
    "sourceVerified": true,
    "sourceFollowersCount": 28734245,
    "sourceFollowersCountText": "28,734,245",
    "sourceFollowersCountPrecision": "EXACT",
    "sourceFollowingCount": 52,
    "sourceFollowingCountText": "52",
    "sourceFollowingCountPrecision": "EXACT",
    "targetId": "61596177028989",
    "targetName": "Hoạt Hình Oriental TV",
    "targetUsername": "oriental.tv",
    "targetUrl": "https://www.facebook.com/oriental.tv",
    "targetImageUrl": "https://scontent.fsyq4-1.fna.fbcdn.net/v/t39.30808-1/884940550_…_n.jpg?…",
    "targetVerified": false,
    "targetSubtitle": "Ho Chi Minh City, Vietnam",
    "targetLocation": "Ho Chi Minh City, Vietnam",
    "targetWorkplace": null,
    "targetSchool": null,
    "matchedSearchTerm": null,
    "listExposedCount": 1392,
    "status": "SUCCESS",
    "scrapedAt": "2026-11-02T05:26:50.760Z"
}
```

In that run, 82 of 1,000 rows had a subtitle (Facebook shows none for most accounts), and 131 had a vanity username.

#### Status row (free): one per source and list

The status row from the same run:

```json
{
    "rowType": "STATUS",
    "relationshipType": "FOLLOWER",
    "status": "SUCCESS",
    "coverageStatus": "PARTIAL",
    "sourceInput": "https://www.facebook.com/NASA",
    "sourceName": "NASA - National Aeronautics and Space Administration",
    "sourceType": "PAGE",
    "requestedLimit": 1000,
    "returnedRelationships": 1000,
    "exposedListCount": 1392,
    "sourceListCount": 28734245,
    "sourceListCountText": "28,734,245",
    "sourceListCountPrecision": "EXACT",
    "searchByName": null,
    "stoppedBy": "LIMIT_REACHED",
    "pages": 125,
    "duplicatesRemoved": 0,
    "message": "Delivered 1000 of the 1,392 followers Facebook lists for this source (stopped at your limit).",
    "scrapedAt": "2026-11-02T05:31:52.621Z"
}
```

| `coverageStatus` | Meaning                                                                                                         |
| ---------------- | --------------------------------------------------------------------------------------------------------------- |
| `FULL`           | The list was read to Facebook's end, and it matches the count the source shows                                  |
| `LIMITED`        | Read to Facebook's end, but Facebook exposes far fewer accounts than the source's count (typical for big Pages) |
| `PARTIAL`        | Stopped at your limit (or the run stopped) while Facebook had more                                              |
| `PREVIEW_ONLY`   | Only the first rows Facebook embeds in the page could be read; pagination was not available this run            |
| `PRIVATE`        | Facebook does not show this list publicly. This is **not** "0 followers"                                        |
| `UNAVAILABLE`    | The source could not be read (not found, blocked, failed)                                                       |
| `UNKNOWN`        | No count to compare with, or a name search (which has no total)                                                 |

Statuses: `SUCCESS`, `NO_RESULTS`, `PRIVATE_OR_RESTRICTED`, `PAGE_NOT_FOUND`, `UNSUPPORTED_SOURCE`, `DUPLICATE_SOURCE`, `PAGINATION_UNAVAILABLE`, `PAGINATION_FAILED`, `PARTIAL_RESULT`, `RATE_LIMITED`, `BLOCKED`, `PROVIDER_ERROR` (plus `BASELINE_CREATED` in COUNTS mode).

#### Counts row (COUNTS mode, charged)

A real row from the Counts example above (`NASA`, `natgeo`, `zuck`):

```json
{
    "rowType": "COUNTS",
    "sourceInput": "https://www.facebook.com/NASA",
    "sourceId": "100044561550831",
    "sourcePageId": "54971236771",
    "sourceHandle": "NASA",
    "sourceName": "NASA - National Aeronautics and Space Administration",
    "sourceUrl": "https://www.facebook.com/NASA",
    "sourceType": "PAGE",
    "sourceVerified": true,
    "followersCount": 28734247,
    "followersCountText": "28,734,247",
    "followersCountPrecision": "EXACT",
    "followingCount": 52,
    "followingCountText": "52",
    "followingCountPrecision": "EXACT",
    "talkingAboutCount": 80377,
    "previousFollowersCount": null,
    "previousFollowingCount": null,
    "previousObservedAt": null,
    "followersDelta": null,
    "followingDelta": null,
    "trackerKey": null,
    "status": "SUCCESS",
    "observedAt": "2026-11-02T05:26:35.352Z"
}
```

With `monitorCounts: true`, the first run stores a baseline (`BASELINE_CREATED`, deltas empty). Later runs under the same `trackerKey` fill `previous…` and `followersDelta` / `followingDelta`.

Dataset views: **Relationships**, **List coverage & status**, **Counts**, **All fields**. The key-value store holds `RUN_SUMMARY` (per-source results and coverage totals) and, when something did not finish, `RETRY_INPUT`, a ready-to-run input with just those sources.

***

### FAQ

**Can it scrape a Page's followers? The accounts a Page follows?** Yes and yes. Pick `FOLLOWERS`, `FOLLOWING` or both.

**Are full lists always available?** No. Facebook exposes only part of a large audience to logged-out visitors (see the table at the top). The Actor reads the exposed list to its end and labels the result honestly. `FULL` is used only when the result matches the source's own count.

**What does `PREVIEW_ONLY` mean?** Facebook embeds the first 8 accounts of a list in the page itself. Normally the Actor continues past them. If it cannot (most often because the run uses Apify Datacenter or no proxy, which Facebook refuses for pagination), you get those rows marked `PREVIEW_ONLY`, never presented as the whole list.

**How many rows can a list return?** At most what Facebook exposes. That number is in `exposedListCount` and `listExposedCount`; the largest lists stop at 10,000. Facebook serves 8 accounts per page, so deep lists take longer.

**What if a big run reaches its timeout?** Shortly before the run timeout (default 1 hour), the Actor stops paging and still writes a STATUS row for every list, with `stoppedBy: "RUN_STOPPED"` and the message "stopped before the run's timeout". The run ends SUCCEEDED, every delivered row is kept, and `RETRY_INPUT` in the key-value store lists the sources that did not finish. To collect more, raise the run timeout in the run options or lower `maxFollowers` / `maxFollowing`.

**Does it need a Facebook login, cookies or a proxy?** No login and no cookies. For lists past the first 8 rows it needs the default Apify Residential proxy: Facebook refuses list pagination from datacenter addresses. Counts mode needs no pagination: it always uses Apify Datacenter (even when Residential is selected) and is never charged a residential session.

**Pages and profiles?** Both. `sourceType` is `PAGE` or `PROFILE`. Some profiles hide a list (Mark Zuckerberg's following list is not public). That list comes back `PRIVATE_OR_RESTRICTED`.

**Which input forms work?** `https://www.facebook.com/NASA`, `NASA`, `@NASA`, `100044561550831`, `https://www.facebook.com/profile.php?id=…`, `…/people/Name/<id>/`, `https://www.facebook.com/NASA/followers` and `…/following`. `m.facebook.com` links work too. Groups, events and non-Facebook URLs get an `UNSUPPORTED_SOURCE` status row.

**Can I get followers and following in one run?** Yes. An account in both lists is two rows, one per relationship.

**Can I search within a follower list?** Yes, with `searchByName`. Facebook does the matching, so a name deep in a large list is found without paging through the whole list.

**Are profile images, verification badges and subtitles included?** Yes (`targetImageUrl`, `targetVerified`, `targetSubtitle`). The subtitle is the short line Facebook shows under a name, e.g. "Works at Samsung" or a town. Image links from Facebook expire after a few days.

**Why are subtitle, location, workplace and school often empty?** Facebook shows a subtitle for only a minority of accounts in these lists (roughly 5–35% in our tests), and the Actor never invents one. When there is a subtitle, it is parsed only where the wording says what it is: "Works at …" or "Engineer at …" → workplace; "Lives in …" or "City, Country" → location; "Studied at …" or a name containing College / University / School → school. A single bare word such as "Chittagong" could be a town, an employer or a school, so it stays in `targetSubtitle` only. These three columns are in the **All fields** view rather than the main table.

**What is `targetUsername`?** The account's vanity username taken from its profile link (e.g. `john.smith`). Accounts whose link is `/people/…/<id>` have none, so it is empty for them.

**Are the counts exact?** The follower count is usually exact (`28,735,511`, from the Page's own description). Some counts are only shown abbreviated, like `121M`. Each count has a `…Precision` field: `EXACT`, `ABBREVIATED` or `UNKNOWN`. Facebook no longer shows a "likes" count for these Pages, so none is returned. A "talking about this" count is returned where Facebook shows it.

**Can counts be tracked over time?** Yes: `mode: COUNTS` + `monitorCounts: true`. The first run is the baseline (`BASELINE_CREATED`, deltas empty, not 0). After that you get `followersDelta` / `followingDelta`, computed only when both values are exact. A failed run never overwrites the stored counts.

**Private or restricted lists?** They are not bypassed. You get a free `PRIVATE_OR_RESTRICTED` status row instead of a misleading zero.

**Can I use it through the API or MCP?** Yes, like any Apify Actor: the Apify API, the JavaScript / Python clients, integrations, and Apify's MCP server. The input is plain JSON (examples above).

***

### Pricing

Pay per event:

- **Relationship result**: each unique follower / following row delivered.
- **Source count result**: each counts row delivered in COUNTS mode.
- **Residential proxy session**: one per followers or following list read through Apify Residential proxy that delivers at least one row. It covers the residential traffic of loading that list's page and is shown openly rather than hidden in the row price. It is not charged with Apify Datacenter, no proxy, or your own proxy URLs.

Never charged: status rows, private or empty lists, sources that are not found, page loads, pagination, retries and duplicates. See the **Pricing** tab for live rates. This README deliberately does not quote figures.

#### 🚦 Proxy policy

**Apify Residential proxy is the default, and full lists need it.** Facebook answers the list page from any address, but refuses the requests for further pages from datacenter addresses (measured: every one refused across dozens of Apify Datacenter addresses).

| Proxy | Followers / following lists | Counts mode | Residential session event |
|---|---|---|---|
| Apify Residential (default) | full exposed list | ✅ | yes, one per list that delivers rows |
| Apify Datacenter / no proxy | first 8 rows per list, marked `PREVIEW_ONLY` | ✅ | no |
| Your own proxy URLs | depends on your provider (residential works) | ✅ | no |

When every address is refused, the Actor stops asking for further pages within seconds and says so in the log, rather than retrying for minutes.

To use your own residential provider, put it in the proxy editor's **Custom proxy URLs** field. That traffic goes through your provider, not Apify:

```
http://user:pass@proxy.iproyal.com:12321
http://user:pass@proxy.brightdata.com:22225
http://user:pass@proxy.oxylabs.io:7777
```

***

### Good to know

- **Unofficial.** Not affiliated with, endorsed by, or connected to Meta or Facebook. This is not Graph API data.
- **Public data only.** Only what Facebook shows a logged-out visitor. It does not reveal hidden friends, private profiles or private follower lists.
- **List order is Facebook's** and is not chronological.
- Public list availability and depth vary by account and can change when Facebook changes its site.
- Count tracking starts from your first run. There is no history before it.

# Actor input Schema

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

The Pages or public profiles to read. Accepts a Page or profile URL (https://www.facebook.com/NASA), a username (NASA), a numeric ID (100044561550831), a profile.php?id= URL, or a direct /followers or /following URL — a direct list URL reads only that list for that source. Up to 500 per run; inputs that are not a Page or profile (groups, events, other sites) get a free UNSUPPORTED_SOURCE status row instead of failing the run.

## `mode` (type: `string`):

RELATIONSHIPS: one row per follower / followed account. COUNTS: one row per source with its follower, following and "talking about" counts — no lists, much faster.

## `lists` (type: `array`):

Which lists to read in RELATIONSHIPS mode. FOLLOWERS: accounts that follow the source. FOLLOWING: accounts the source follows. The same account in both lists is two separate rows.

## `maxFollowers` (type: `integer`):

The most follower rows to save for EACH source. Facebook exposes only part of a large audience to logged-out visitors (measured: NASA exposes about 1,358 of its 28.7 million followers; the largest lists stop at 10,000), so a list often ends before this number — every list's STATUS row says how far it got. You are charged only for rows delivered.

## `maxFollowing` (type: `integer`):

The most following rows to save for EACH source. Same rules as the followers limit.

## `searchByName` (type: `string`):

Optional. Only return list entries whose name matches this text — e.g. "john". The search runs on Facebook's side, so it reaches matches deep in a large list without paging through it. RELATIONSHIPS mode only. Every row records the term in matchedSearchTerm.

## `includeSourceCounts` (type: `boolean`):

Add the source's follower and following counts (with the text Facebook showed and whether it is exact or abbreviated, e.g. "28M") to every relationship row.

## `includeProfileImage` (type: `boolean`):

Include each follower / followed account's profile picture URL (targetImageUrl). Facebook image links expire after a few days.

## `includeSubtitle` (type: `boolean`):

Include the short line Facebook shows under each name in the list (targetSubtitle), e.g. "Works at Samsung" or a town.

## `parseSubtitle` (type: `boolean`):

Fill targetLocation, targetWorkplace and targetSchool when the subtitle says what it is ("Lives in …", "Works at …", "Studied at …"). A bare place or name is left in the subtitle rather than guessed.

## `includeVerification` (type: `boolean`):

Include whether each follower / followed account carries Facebook's verified badge (targetVerified).

## `deduplicate` (type: `boolean`):

When two inputs are the same account (e.g. NASA and its profile.php?id= URL), read and charge its lists once. Within one list a repeated row is always dropped.

## `monitorCounts` (type: `boolean`):

Remember each source's counts between runs and return the change since the last run (followersDelta, followingDelta). The first run creates the baseline (status BASELINE_CREATED, deltas empty). A change is only computed when both counts are exact — never from abbreviated values like "28M". Schedule it daily or weekly.

## `trackerKey` (type: `string`):

Optional. A name for the count history, so separate watchlists keep separate baselines (e.g. "competitor-pages"). Lower-case letters, digits and dashes.

## `maxConcurrency` (type: `integer`):

How many sources are read at the same time. Pages of one list are always read in order.

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

Apify Residential proxy is the default and is required for full lists: Facebook refuses list pagination from datacenter addresses (measured), so with Apify Datacenter or no proxy each list stops at the first 8 rows (coverage PREVIEW_ONLY). Each followers or following list read through Apify Residential that delivers rows adds one residential-proxy-session event, shown in Pricing. Counts mode needs no pagination and always uses Apify Datacenter, with no session event. Custom proxy URLs are your own traffic and add no session event.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.facebook.com/NASA"
  ],
  "mode": "RELATIONSHIPS",
  "lists": [
    "FOLLOWERS",
    "FOLLOWING"
  ],
  "maxFollowers": 25,
  "maxFollowing": 25,
  "includeSourceCounts": true,
  "includeProfileImage": true,
  "includeSubtitle": true,
  "parseSubtitle": true,
  "includeVerification": true,
  "deduplicate": true,
  "monitorCounts": false,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `coverage` (type: `string`):

No description

## `counts` (type: `string`):

No description

## `runSummary` (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 = {
    "startUrls": [
        "https://www.facebook.com/NASA"
    ],
    "mode": "RELATIONSHIPS",
    "lists": [
        "FOLLOWERS",
        "FOLLOWING"
    ],
    "maxFollowers": 25,
    "maxFollowing": 25,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("coregent/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": ["https://www.facebook.com/NASA"],
    "mode": "RELATIONSHIPS",
    "lists": [
        "FOLLOWERS",
        "FOLLOWING",
    ],
    "maxFollowers": 25,
    "maxFollowing": 25,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("coregent/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": [
    "https://www.facebook.com/NASA"
  ],
  "mode": "RELATIONSHIPS",
  "lists": [
    "FOLLOWERS",
    "FOLLOWING"
  ],
  "maxFollowers": 25,
  "maxFollowing": 25,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call coregent/facebook-followers-following-scraper --silent --output-dataset

```

## MCP server setup

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